Hello, I'm trying to write a script that will draw a line from a set time and extend right. Specifically, I'm looking to visually see where the settlement price is for /ES and /NQ futures.
The issue is that if I try to use SecondsFromTime() or SecondsTilTime(), the result may not be 0.
The attachment shows what i'm looking for. I'd like to be able to use a specific time rather than simply using the close on /ES and /NQ.
Thank you
The issue is that if I try to use SecondsFromTime() or SecondsTilTime(), the result may not be 0.
Ruby:
def settlementAtTimeValue = if SecondsTillTime(settlementTime) == 0 then close else settlementAtTimeValue[1];
#find the bar where settlement is for the purpose of plotting from that bar
def settlementAutoBar = if !isRTH and close == settlementAtTimeValue then BarNumber() else settlementAutoBar[1];
The attachment shows what i'm looking for. I'd like to be able to use a specific time rather than simply using the close on /ES and /NQ.
Thank you