jruggiero
New member
Hello!
Facing a problem with making TOS save yesterdays RTH High and Low when Extended Trading Hours are ON.
Need this as a part for my pre-market scanner.
Using thin piece of code and its not working.
Any help is highly appreciated!!!
Code:def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and GetTime() <= RegularTradingEnd(GetYYYYMMDD()); def yHighRTH = if !RTH then yHighRTH[1] else if RTH and high > yHighRTH[1] then high else yHighRTH[1]; #yesterday's high
Hi here is what I figured out to scan on PM for yesterday High break Out, same for low, just adjust it. In order to use it put this on the scanner on an intraday aggregation, like 10 min with ext hours.
Code:
def yRTH =if gettime()>regularTradingStart(GetYYYYMMDD()[1]) and gettime()<regularTradingEnd(GetYYYYMMDD()[1]) then 1 else 0;
def yh= if yrth[1]==0 and yrth==1 then high else
if yrth and high>yh[1] then high else yh[1];
plot H =if close>yh then 1 else 0;