st1=high-close
st2=low-close
return st1 coloured (255,0,0,255), st2 coloured (0,255,0,255)
this can be applied to chart to create support/resistance points of true high/lows or used alone as an indicator to show divergence
st1=(low+close+high)[50]
st2=(low+close+high)[200]
return st1 as "50", st2 as "200"
this can be used as a standard alone indicator to show divergence in the trend or applied to the chart to show support/resistance of the true 50/200 day averages
I don’t use such fast TF’s, but I think they can be useful in greater TF’s , as well.
Thanks for sharing you code and ideas 🙂
The st1 and st2 variables are not averages, but the values from 50 and 200 bars ago.
Hi,
I used the code and it gives exactly the same results as illustrated in your screen captures, what I don’t understand (and please forgive my ignorance) is how this can be used as part of a trading strategy, am I missing something?
Best regards
Also if you are adding it to a 1 second chart you need to add a TIMEFRAME instruction to get the daily 50 and 200 day averages. I also changed it to add AVERAGE.
timeframe(daily)
st = (low+close+high)
st1 = average[50](st)
st2 = average[200](st)
return st1 as "50", st2 as "200"