Traders Laboratory - View Single Post - Trend Indicator for TS?
View Single Post
  #13 (permalink)  
Old 03-27-2008, 06:17 AM
Blu-Ray's Avatar
Blu-Ray Blu-Ray is offline
Blu-Ray has no status.

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 406
Thanks: 92
Thanked 40 Times in 26 Posts
Re: Trend Indicator for TS?

Thanks for the chart J-S.

The reason I asked for a chart is, as we all know, you can look at a chart and say " it's in an uptrend", but putting that into coding language is not so straight forward. Let me explain using your chart.

You could go for, for example, 3 higher highs.........so the code would be

if H > H[1] and H > H[2] and H > H[3] then plot............

but using your chart it would stop where I've marked A.

Alternatively you could use the code so if the high is higher or equal to previous bar, this would get you above A, but it would also signal an uptrend at B for example.

You could then move on to higher highs and higher lows and this would again stop at A.

You could then do as above so the high and low are greater or equals to the previous, but realise that could result in C.

Another thing that you might ( edit: you will ) find is that where I've marked D. for example if that low was 1 tick above the previous low then your downtrend is invalidated ( via the code ) but you're still clearly in a downtrend.

Basically what I'm trying to point out is that although visually we can spot a trend, but putting that into code needs criteria.

Hope this helps

Blu-Ray

Attached Images
File Type: png JS_Chart.png (260.5 KB, 107 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote