- Katılım
- 23 Eki 2020
- Mesajlar
- 1,826
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= From: Brett Sinclair <brett_j_sinclair [at] yahoo [dot] com> To: equismetastock [at] yahoogroups [dot] com <equismetastock [at] yahoogroups [dot] com> Date: Friday, February 24, 2006, 3:17:40 PM Subject: [EquisMetaStock Group] Heikin Ashi =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Can anyone code Heikin-Ashi Candlesticks in Metastock? The heikin-ashi candlestick technique uses modified open-high-low-close (OHLC) values and displays them as candlesticks. The modified values are computed using these definitions: haClose = (O+H+L+C)/4 haOpen = (haOpen (previous bar) + haClose (previous bar))/2 haHigh = Maximum(H, haOpen, haClose) haLow = Minimum(L, haOpen, haClose) The "open," "high," "low," and "close" referred to are of the current bar. The prefix ha- indicates the corresponding heikin-ashi modified values Thanks, Brett =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= From: jawjahtek <jawjahtek [at] yahoo [dot] com> To: equismetastock [at] yahoogroups [dot] com <equismetastock [at] yahoogroups [dot] com> Date: Saturday, February 25, 2006, 3:26:00 PM Subject: [EquisMetaStock Group] Re: Heikin Ashi and PREV function =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Hi Brett, Here are two ways of calculating Heikin-Ashi values in MS. Both ways can only be plotted as an indicator; as far as I know, you can't plot the candlestick format without an external dll. Method 1: |
|
Heikin-Ashi I HaClose:=(O+H+L+C)/4; HaOpen:=(PREV + (Ref(O,-1)+Ref(H,-1)+Ref(L,-1)+Ref(C,-1))/4)/2; HaHigh:=Max(Max(H,HaOpen),HaClose); HaLow:=Min(Min(L,HaOpen),HaClose); HaOpen; HaHigh; HaLow; HaClose |
Method 2 is my favorite. It is interesting to me for three reasons. 1. It provides insight into what Heiken-Ashi really is. It is the current day's Pivot vs. a moving average of the Pivot (Pivot = O+H+L+C)/4). 2. It is optimizable; you can optimize the lookback moving average of HaOpen (i.e., change the EMA period = 3 to OPT in a system test). 3. It shows a way to avoid using the PREV command in certain situations. This trick can be used in any MS formula where PREV is needed in the form Current Value + PREV. |
Heikin-Ashi II HaClose:=(O+H+L+C)/4; HaOpen:=Mov(Ref(HaClose,-1),3,E); HaHigh:=Max(Max(H,HaOpen),HaClose); HaLow:=Min(Min(L,HaOpen),HaClose); HaOpen; HaHigh; HaLow; HaClose |
Ross | |
| |
Source / From: |