I need to create a condition for MA so that stocks only show up near their highs and lows. I got almost all my MA conditions coded for the scan I need but having real troubles with this part. Mainly because I have no clue what the code wants or needs as far as a retrace more/less than. I need the code for the high/low of the regular session of trading stocks on the NASDAQ/NYSE.
I want the code to set a condition so the stocks in the MA have to have retraced less then 25% or more then 75% from their highs on the day.
I am hoping this part of the code is most of what I need?
barsAgoHigh = HighestBar(High, Bars.BarsSinceSession -1);
myDateTime = Time[barsAgoHigh];
If this finds me the high of the day from open, how do I set that I want the price to be less then 25% away and more then 75% away from the high?
Thanks for any help,
R.T.

Comment