Questa è la definizione delle candele HA, che solitamente si mette all’inizio del codice e comunque prima che tu le utilizzi:
Heikin Ashi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
ifbarindex>0then
xClose=(open+close+low+high)/4
xOpen=(xOpen[1]+xClose[1])/2
//haHigh = Max(xOpen, xClose)
//haLow = Min(xOpen, xClose)
//xHigh = Max(High,haHigh)
//xLow = Min(Low,haLow)
//xRange = abs(xClose - xOpen)
else
xClose=(open+close+low+high)/4
xOpen=Open
//haHigh = Max(xOpen, xClose)
//haLow = Min(xOpen, xClose)
//xHigh = Max(High,haHigh)
//xLow = Min(Low,haLow)
//xRange = abs(xClose - xOpen)
endif
Ho commentato tutte le righe che non ti servono, in quanto tu farai riferimento solo ad xClose ed xOpen, che userai al posto di CLOSE ed OPEN quando ti servirà.
Una media calcolata su HA sarà:
1
Media=average[20,0](xClose)//invece di usare CLOSE
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok