Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I would like to display the range (High-Low) of the first bar of the trading day
on a 5 minute TOS chart. I would also like to add a user option to display the range
of the first 3 bars of the trading day as an alternative if it's possible. I know how to
display the result, I just need to know what script to use to identify the range for the
first bar or first 3 bars. I appreciate any suggestions.
Can you help answer these questions from other members on NexusFi?
def na=double.nan;
input ORBegin = 0930;
input OREnd = 0935;
input ShowTodayOnly={"No", default "Yes"};
def s=ShowTodayOnly;
Def ORActive = if secondstilltime(OREnd)>0 AND secondsfromtime(ORBegin)>=0 then 1 else 0;
def today=if s==0 OR getday()==getlastday() AND secondsfromtime(ORBegin)>=0 then 1 else 0;
Rec ORHigh = if ORHigh[1]==0 or ORActive[1]==0 AND ORActive==1 then high else if ORActive AND high>ORHigh[1] then high else ORHigh[1];
Rec ORLow = if ORLow [1] ==0 or ORActive [1] ==0 AND ORActive ==1 then low else if ORActive AND low < orlow [1] then low else ORLow [1];
Def ORWidth = ORHigh - ORLow;
Plot ORH=if ORActive OR today<1 then na else ORHigh;
Plot ORL=if ORActive OR today<1 then na else ORLow;
ORH.setdefaultcolor(color.green);
ORH.setStyle(Curve.FIRM);
ORH.setlineweight(3);
ORL.setdefaultcolor(color.red);
ORL.setStyle(Curve.FIRM);
ORL.setlineweight(3);