MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Heikin-Ashi

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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: TOP
Metastockusers [at] yahoogroups [dot] com  

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!