log in     sign up for free
 
If you really think the stock is going to make a big move - and that should be the only reason you are buying the stock to begin with - then there is no reason to haggle over an eighth of a point. Just buy the stock.
David Ryan
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Heikin-Ashi

Formula for: MetaStock

indicator


 

 

Views:  2622

Added: June 28, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, indicator
 
Your Ad Here
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

 

 



Code:

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

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


 





Source: Metastockusers [at] yahoogroups [dot] com

 

View similar (indicator for MetaStock):

Volatility as Percent
ATR Exit 2
LinRegSlope & Standard Deviation of Daily ROC's
Coppock Curve Oscillator
Shifted TSMA Indicator
Trailing Stops - Volatility-Based
Exponential Moving Average - ATR Volatility Adjusted
GANN - HiVisual & LoVisual
Price Oscillator Wave
MACD of Relative Strength
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012