Good afternoon,
I would appreciate if you help me make the following screener
When the Heiken Ashi candle touches both the upper and lower bands of the Bollinger Band
And that once the band has played the next Heiken Ashi candle changes color
For example:
In an uptrend, the green Heiken Ashi candle touches the upper Bollinger band and once touched it warns when the next Heinken Ashi candle turns red.
And backwards:
In a downtrend, the red Heiken Ashi candle touches the lower Bollinger band and once touched it warns when the next Heinken Ashi candle turns green.
Thanks
Greetings
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Thank you 🙂
There you go:
IF BarIndex < 1 THEN
CondS = 0
CondL = 0
x = 0
ENDIF
IF x <> 0 THEN
CondS = 0
CondL = 0
ENDIF
// HA definition
xOpen = open
xClose = (open + high + low + close) / 4
IF BarIndex > 0 THEN
xOpen = (xOpen[1] + xClose[1]) / 2
ENDIF
xHigh = max(high,max(xOpen,xClose))
xLow = min(low, min(xOpen,xClose))
// Definition END
//
xBullish = xClose > xOpen
xBearish = xClose < xOpen
UpperBand = BollingerUp[20](Close) //xClose
LowerBand = BollingerDown[20](Close) //xClose
//
IF CondS = 0 THEN
CondS = (xHigh >= UpperBand) AND xBullish
IF CondS <> 0 THEN
CondL = 0
ENDIF
ENDIF
IF CondL = 0 THEN
CondL = (xLow <= LowerBand) AND xBearish
IF CondL <> 0 THEN
CondS = 0
ENDIF
ENDIF
x = 0
IF CondL <> 0 AND xBullish THEN
x = 1
ELSIF CondS <> 0 AND xBearish THEN
x = 2
ENDIF
SCREENER[x](x AS "1=↑, 2=↓")
in lines 22-23 I appended a comment to each line; to show what to use with the bands if you want them to be calculated on HA.
Good morning robertogozzi
I am sorry.
I will not republish a duplicate post in two languages.
I thank you for the screener posted.
Thanks for your good work
Greetings