♥ 0 |
Hello, I am trying to build a script to plot RTH data on RTH and ETH charts. For instance, I would like to plot RTH-only pivot point (high + low + close) / 3 on an ETH chart of /ES
I have tried to use some of your code, buy my results are inconsistent and they also plot on every bar rather than one horizontal bar across the day.
Here is the code I have tried: <pre> def regularSessionHours = RegularTradingStart(GetYYYYMMDD()) <= GetTime(); def extendedSessionLow = CompoundValue(1, if extendedSessionStart then low else if extendedSessionHours then Min(low, extendedSessionLow[1]) else extendedSessionLow[1], 0); 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); plot ydayHigh = HighestAll(if IsNan(regularsessionhigh[-1]) then regularsessionhigh else double.nan) ; plot PP = (regularSessionHigh[1] + RegularSessionLow[1] + close[1]) / 3; </pre>
Thank you for your help.
Marked as spam
|
Please log in to post questions.