Good day,
I need some assistance coding a candle a different color after breakout of an indicator.
Criteria:
When price crosses over supertrend 3,10 then the 6th candle should be black unless it crossed back over again.
thank you,
kind regards,
Try this (not tested):
[scode]
ONCE Count = 0
If Count > 0 then
Count = Count + 1
Endif
MyST = SuperTrend[3,10]
If Close crosses over MyST Then
Count = 1
Endif
If Count = 6 Then
Count = 0
Drawcandle(open,high,low,close) coloured(0,0,0,255) bordercolor(0,0,0,255)
Endif
[/scode]
If you want to clear Count even when there is a crossunder, then place these lines after line 5:
[scode]
If Close crosses Under MyST Then
Count = 0
Endif
[/scode]
You need to append this line at the end:
[scode]
Return
[/scode]
Thank you so much, I appreciate it 🙂