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
