Pre market opening price


Category:
0
0

Hi Pete,

How can I draw an auto line on pre-market (1st price after 4 AM ) opening price?

Thanks

RESOLVED
Marked as spam
Posted by (Questions: 4, Answers: 7)
Asked on February 11, 2019 6:01 pm
589 views
1
Private answer

This should work for both futures and stocks. Didn’t test it on Forex.

def newDay = GetDay() <> GetDay()[1];
def start = newDay or SecondsTillTime(400) == 0;
rec premarketOpen = if start then open else premarketOpen[1];
plot po = premarketOpen;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 15, 2019 11:09 am
0

Thx

( at February 15, 2019 4:07 pm)
0
Pete, Thanks for this! How can we add this to a scan where I'd like ToS to alert me whenever a stock from a pre-defined watchlist is less than 0.25% away (either above or below) from the plotted line from the above script? Thanks in advance. Happy to contribute to your page - it's a great resource!
( at March 23, 2021 10:50 am)
0
Change the following line:
plot po = premarketOpen;
to
plot scan = close > premarketOpen * (1 - 0.025) and close < premarketOpen * 1.025;
( at March 23, 2021 2:36 pm)