Hi,
I want to draw a coloured colured zone only if the closing bar at 15 min TF is higher than a certain level. I tried the following code where I set a colour zone between ZUP and ZDOWN but it doesn’t work and the zone doesn’t disappear when the condition isn’t fulfilled.
defparam drawonlastbaronly=true
TimeFrame(15 minutes)
if close[0]>6900 then
ZUP=6900
ZDOWN=6800
endif
Return ZUP as “ZUP”, ZDOWN as “ZDOWN”
Can you please help me?
Thank you in advance!
John
JSParticipant
Senior
Try this one…
DefParam DrawOnLastBarOnly=True
TimeFrame(15 minutes,UpdateOnClose)
If Close>42100 then
ZUp=42100
ZDown=42000
ColorBetween(ZUp,ZDown,"Green",50)
Else
ColorBetween(ZUp,ZDown,"Green",0)
EndIf
Return
Unfortunately this doesn’t work. The zone doesn’t disappear when the instrument drops below a certain level.
JSParticipant
Senior
Hi John,
Try this one…
ZUp=42100
ZDown=42000
If Close>42900 then
drawrectangle(BarIndex-50,ZDown,barindex,ZUp) coloured(0,255,0,30) bordercolor(0,255,0,0)
else
drawrectangle(BarIndex-50,ZDown,barindex,ZUp) coloured(255,0,0,0) bordercolor(0,255,0,0)
endif
Return