Dublin Ireland
Experience: Intermediate
Platform: Ninja, TOS
Broker: RCG Direct/Continuum
Trading: ZB
Posts: 18 since Mar 2012
Thanks Given: 4
Thanks Received: 7
|
Hi and thanks for taking a look.
I am trying to plot yesterdays RTH high, low & close on todays ETH chart in TOS. I have used some script from the profile indys to get this far. I am stumped on defining the time period though to get the value I am looking for and could do with others input please. How do I arrange all the elements to give me a value to plot?
ie Define yesterdays RTH. Find the highest high. Plot it on todays chart. Do the same for the Low and Close.
I can do the plotting and rework the code for the Low and Close - just need help defining the RTH and getting the value.
I have resigned myself to using a manual input for the RTH hours as I couldn't get the TOS function 'RegularTradingStart' 'RegularTradingEnd' to work in a script and I cant find a 'Get' function that you would use in C. However if there is a genius out there that can find a way of automating this I would be truly grateful.
So far I have:
input rthbegin = 0930;
input rthend = 1400;
def rth = secondsfromTime(rthbegin)>=0 and secondstillTime(rthend)>0;
def cond = rth[1] != rth;
#script to get the right day
def day = GetDay();
def lastDay = GetLastDay();
def isToday = If(day == lastDay, 1, 0);
def pastOpen = If((SecondsTillTime(rthbegin) > 0), 0, 1);
def pastClose = If((SecondsTillTime(rthend) > 0), 0, 1);
def marketOpen = If(pastOpen and !pastClose, 1, 0);
def firstBar = If (day[1] != day, day - 1, 0);
def date = getyyYYMMDD();
#Highest High during RTH
def yRthHi = ? How do I get the script to give me the highest high of the bar numbers that just fall within the RTH session ?
#Plot the value
Plot YestRthHi = yRthHi;
Thanks for taking a look - all contributions gratefully received.
|