NexusFi: Find Your Edge


Home Menu

 





Displaying Range of First Bar of Day


Discussion in ThinkOrSwim

Updated
    1. trending_up 9,543 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Displaying Range of First Bar of Day

  #1 (permalink)
sat1234
North Vancouver BC Canada
 
Posts: 1 since Nov 2010
Thanks Given: 1
Thanks Received: 0

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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
What broker to use for trading palladium futures
Commodities
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
musofir
Russia.Kazan.Butlerova str.
 
Posts: 1 since Jul 2012
Thanks Given: 0
Thanks Received: 1


sat1234 View Post
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.

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);

Reply With Quote
Thanked by:




Last Updated on May 15, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts