I’m trying to draw a custom line using the below code based on the time 10pm from the night before. Whilst the code below works, I want to draw this as a segment from the time identified in “Opentime” to the end of the current day but the code keeps kicking up an error and i wasn’t sure that this is even possible. Would someone be able to advise?
defparam drawonlastbaronly=true
if opentime=220000 then
value1=open
endif
if intradaybarindex>=0 then
drawhline(value1)coloured(0,0,255)
endif
return
Thanks
Nilesh
JSParticipant
Senior
Hi @nbhudia
Is this what you want…
DefParam DrawOnLastBarOnly=True
If OpenTime=220000 then
Value1=Open
endif
If IntradayBarIndex=0 then
BarValue=BarIndex
EndIf
If IntraDayBarIndex>=0 then
DrawSegment(BarValue,Value1,BarIndex,Value1)Coloured("Red")
Endif
Return
hi JS,
This is exactly what i was after, works better now.
Many Thanks