Hi Can anybody help me with writing some code. I want an alert when HA changes colour and the bar has closed on a 30 min time frame?
Is it possible to have the alert only if say daily chart or weekly chart is also the same colour which will then reduce number alerts.
Thank you
Gio
I found this in the forum made some changes on the code, but it could written in Chinese
//Heikin-Ashi
xClose = (Open+High+Low+Close)/4
if(barindex>2) then
xOpen = (xOpen[30] + xClose[30])/2
endif
changeToGreencandle = xClose[30]>xOpen[30] AND xClose[30]<xOpen[30]
ChangeToRedcandle = xClose[30]<xOpen[30] AND xClose[30]>xOpen[30]
Greencandle=xclose>xopen
redcandle=xclose<xopen
If changeToGreencandle then
Indicator1=1
elsif greencandle then
indicator1=0.5
Else
Indicator1=0
Endif
If ChangeToRedcandle then
Indicator22=-1
elsif redcandle then
indicator22=-0.5
Else
Indicator22=0
Endif
Return indicator1 COLOURED(0,255,0) as "Buy", indicator22 COLOURED(255,0,0) as "Sell"