Welcome to NexusFi: the best trading community on the planet, with over 200,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 -- discounts are available after registering.
-- The NexusFi team
(If you already have an account, login at the top of the page)
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.
def regularSessionHigh = CompoundValue(1, if regularSessionStart then high else if regularSessionHours then Max(high, regularSessionHigh[1]) else regularSessionHigh[1], 0);
def regularSessionLow = CompoundValue(1, if regularSessionStart then low else if regularSessionHours then Min(low, regularSessionLow[1]) else regularSessionLow[1], 0);
def regularSessionOpen = CompoundValue(1, if regularSessionStart then open else if regularSessionHours then regularSessionOpen[1] else regularSessionOpen[1], 0);
def regularSessionClose = CompoundValue(1, if regularSessionHours then close else if extendedSessionHours then regularSessionClose[1] else regularSessionClose[1],0);
plot yestRthHi = if okToPlot and extendedSessionHours then regularSessionHigh else Double.NaN;
plot yestRthLo = if okToPlot and extendedSessionHours then regularSessionLow else Double.NaN;
plot yestRthOpen = if okToPlot and extendedSessionHours then regularSessionOpen else Double.NaN;
plot yestRthClose = if okToPlot and extendedSessionHours then regularSessionClose else Double.NaN;