REQ Help with Trend Indicator - Page 3 - Traders Laboratory

Go Back   Traders Laboratory > Trading Resources > Trading Indicators > Coding Forum

Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
 
LinkBack (3) Thread Tools Display Modes
  #21 (permalink)  
Old 11-29-2007, 07:32 PM
Blu-Ray's Avatar
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 406
Thanks: 92
Thanked 40 Times in 26 Posts
Re: REQ Help with Trend Indicator

Quote:
View Post
AHh I think I see what's missing!

If the MA goes from down to up then it goes red to green immediately. If it is still down but close is above then it will go white.

Yes I think that's it, I'll recode it up tomorrow

Cheers

Blu-Ray

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #22 (permalink)  
Old 11-29-2007, 07:48 PM
gassah has no status.

Trader Specs
 
Join Date: Nov 2007
Location: Phoenix
Posts: 214
Thanks: 44
Thanked 94 Times in 50 Posts
Send a message via Yahoo to gassah
Re: REQ Help with Trend Indicator

Thanks a lot guys for the help.

gassah


Last edited by gassah; 11-29-2007 at 07:58 PM.
Reply With Quote
  #23 (permalink)  
Old 11-30-2007, 07:01 AM
Blu-Ray's Avatar
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 406
Thanks: 92
Thanked 40 Times in 26 Posts
Re: REQ Help with Trend Indicator

Here's a revised version, using BlowFish's observations, I've compared it with the original picture JJ posted at the start of the thread. It's very close to Traderguiders version using, as you can see on the charts below, there are 3 rogue dots. So the code might not be exact, but this could be down to different platforms handling different data.






Here's the code for it.

inputs: Price( Close ), Length( 5 ),Upcolor( DarkGreen),DnColor ( DarkRed),NColor(White) ; variables: Avg( 0 ) ; Avg = average( Price, Length ) ; Condition1 = Close >= avg and avg >= avg[1]; { Green Dots } Condition2 = Close < avg and avg > avg[1]; { White Dots } Condition3 = Close <= avg and avg <= avg[1]; { Red Dots } Condition4 = Close > avg and avg < avg [1]; {White Dots } plot1(avg,"avg"); if Condition1 then setplotcolor (1,Upcolor); if Condition2 then setplotcolor (1,Ncolor); if Condition3 then setplotcolor (1,Dncolor); if Condition4 then setplotcolor (1,Ncolor);
Hope this helps

Blu-Ray
Attached Images
File Type: png jjes.png (173.5 KB, 173 views)
File Type: png myes.png (16.8 KB, 182 views)
Attached Files
File Type: eld Diamond_Trend.ELD (3.7 KB, 49 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #24 (permalink)  
Old 11-30-2007, 08:16 AM
Dogpile has no status.

 
Join Date: May 2007
Posts: 577
Thanks: 0
Thanked 8 Times in 6 Posts
Re: REQ Help with Trend Indicator

hi guys...

I have been working on something similar so thought I would chime in...

rather than have the indicator follow price as in a close relative to a moving average, personally I find it more useful to compute a price in advance that signals a 'reversal' if touched. Thus you can see a 'mechanical trigger point' in advance rather than having to wait for a bar to close. I realize this is really only a minor difference in what you are doing but thought I would throw this in anyway.

Linda Rashke just did a presentation using her own indicator here:
https://lbrgroup.com/images//Bloombe.../bloomberg.pdf

her indicator paints the bar depending on where the current bar closes relative to the trailing 16 bar high/low. thus, if in a downtrend -- the bar would be red and switch to green on any close that is above the 16-bar low +2.5 avgtruerange's --- she uses: avgtruerange(9), btw.

I have played around these settings and like 1.5 true ranges better and like computing a price in advance rather than waiting for the bar close -- you can use buy and sell stops to enter when you have the computed price in advance.

Here is an example:

Attached Images
File Type: png Nov 26 P-SAR ATR.png (19.3 KB, 169 views)

Reply With Quote
  #25 (permalink)  
Old 11-30-2007, 08:54 AM
Blu-Ray's Avatar
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 406
Thanks: 92
Thanked 40 Times in 26 Posts
Re: REQ Help with Trend Indicator

That looks very interesting Dogpile, thank you for introducing us to that, would you mind sharing your code for the indicator at all?

Cheers

Blu-Ray

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #26 (permalink)  
Old 11-30-2007, 07:03 PM
BlowFish's Avatar
BlowFish is in da house

Trader Specs
 
Join Date: Mar 2007
Location: Europe Mostly
Posts: 892
Thanks: 24
Thanked 126 Times in 89 Posts
Re: REQ Help with Trend Indicator

Just had another thought...we still haven't explained 2 whites. I'm confident in guessing (not even going to look at the chart again!) that if the MA is up and you close below you get white and will continue to get white until the MA turns down (red) or you get a close back over the MA (Green).

I think that will make it identical. Its not a bad little indicator though I rather like a 3 period SMA.

Cheers.

Reply With Quote
  #27 (permalink)  
Old 11-30-2007, 08:02 PM
Dogpile has no status.

 
Join Date: May 2007
Posts: 577
Thanks: 0
Thanked 8 Times in 6 Posts
Re: REQ Help with Trend Indicator

Quote:
would you mind sharing your code for the indicator at all?
but of course. this is a constant work in process. you need a rule in the code to indicate whether the computed reversal price is off the lowest low or highest high -- you can see I set this to be where the midpoint of the last bar is relative to the range of the last 6 bars. if anyone can think of a better way to do this, I am all ears.

Quote:
Vars: LowestLow(0), HighestHigh(0);

If CurrentBar > 1 Then Begin
LowestLow = Lowest (low, 5);
HighestHigh = Highest (High, 5);

value10=highest(h,6);
value11=lowest(l,6);
value12=(value10+value11)/2;
value13=(H+L)/2;

If value13>value12 then begin
value1=highesthigh-(AvgTrueRange(5)[1] * 1.5);
plot1(value1,"SAR Value");
end;

If value13<value12 then begin
value2=LowestLow + (AvgTrueRange(5)[1] * 1.5);
plot1(value2,"SAR Value");
end;

End;
If value13>value12 then
setplotcolor(1,white)
else
setplotcolor(1,cyan);
clearly, you cannot use this indicator by itself -- you must incorporate many other factors -- ie, higher timeframe pattern, vwap etc.. whatever you use... but this indicator gives a price as an idea for an entry that you can take or leave.

Reply With Quote
  #28 (permalink)  
Old 11-30-2007, 08:36 PM
Dogpile has no status.

 
Join Date: May 2007
Posts: 577
Thanks: 0
Thanked 8 Times in 6 Posts
Re: REQ Help with Trend Indicator

here is an example from today.

I entered ES when it appeared price failed just under VWAP. I did this with a market order before the 'confirmation' of the reversal price triggered. I set a stop-market order at the computed reversal price to enter YM as a way to add to my initial order. I totally screwed up on the YM exit as you can see.

The key here was not this indicator -- but it was nice in the heat of battle to have a computed price to go with. Just an example.

Attached Images
File Type: png Nov 30 Reversal Price Indicator.png (21.6 KB, 163 views)

Reply With Quote
  #29 (permalink)  
Old 12-01-2007, 09:06 AM
jjthetrader's Avatar
jjthetrader has no status.

 
Join Date: Aug 2007
Location: Canada
Posts: 344
Thanks: 124
Thanked 72 Times in 44 Posts
Re: REQ Help with Trend Indicator

Yes there does appear to be more to it. There seems to be a condition of the closes closeness to the MA. It's almost like there's a very small MA envelope around the MA and until it breaks out of that the second close won't change from white.
There's the added observation that if you're closing above the MA then you get a drastic close below, bypassing that "envelope", it will go straight from green to red and bypass white all together.
I've posted a 5min chart of the ES with the diamonds on so if you guys would like to trouble shoot you can. I can post any chart you like with them on to test with.
Attached Images
File Type: jpg es 5min.jpg (87.1 KB, 35 views)

Reply With Quote
  #30 (permalink)  
Old 12-01-2007, 10:54 AM
jjthetrader's Avatar
jjthetrader has no status.

 
Join Date: Aug 2007
Location: Canada
Posts: 344
Thanks: 124
Thanked 72 Times in 44 Posts
Re: REQ Help with Trend Indicator

Blu-Ray, I'm just trying to make your life difficult. But here's another condition for you that will explain some of the white diamond action.
As you can see in the attached pic, point A should be "green" (mine are blue) because it's the 2nd close above the MA. But it closes below the previous bar which keeps the diamonds white. Then point B closes level to A which also keeps it white. If that would have closed up it would have been green.
Then we see Point C is white as well because it closes below the MA after a close above it. But then look at the next bar. It's wide range up and goes straight to green (blue in my case) because of my MA envelope theory.

So did I ruin your weekend thinking about programming this? lol
Attached Images
File Type: jpg white.jpg (22.5 KB, 26 views)

Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.traderslaboratory.com/forums/f56/req-help-with-trend-indicator-2428.html
Posted By For Type Date
REQ Help with Trend Indicator - Page 3 - Traders Laboratory This thread Refback 12-12-2007 11:08 AM
Traders Laboratory - forumdisplay This thread Refback 11-27-2007 12:50 PM
Traders Laboratory - forumdisplay This thread Refback 09-10-2007 03:20 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heikin Ashi Trend Indicator Soultrader Trading Indicators 25 02-21-2008 06:24 PM
3bar trend waveslider Trading Indicators 18 01-29-2008 06:39 PM
Trend lines on an indicator zardoz Technical Analysis 1 05-16-2007 12:59 PM
Volume Gradient + Heikin Ashii Trend Indicator GCB Trading Indicators 27 04-07-2007 08:29 AM
Trend Trading vs Counter Trend Trading Soultrader Technical Analysis 9 10-29-2006 11:32 AM


All times are GMT -4. The time now is 09:09 PM.

 

 
 


1 2 3 4 5 6 7 8 9 10 11 12 13