Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Heiken Ashi Candlestick Oscillator for Amibroker (AFL)
xawarr
over 13 years ago
Amibroker (AFL)

Rating:
4 / 5 (Votes 2)
Tags:
trading system, amibroker, heikin

Heiken Ashi Candlestick Oscillator with some back test settings added.

Screenshots

Similar Indicators / Formulas

heikin ashi with KPL system
Submitted by viplavmba about 14 years ago
Projection Oscillator
Submitted by kaiji over 14 years ago
Heikin Ashi
Submitted by kaiji almost 15 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
Miftha remix for dse
Submitted by coolpace over 14 years ago

Indicator / Formula

Copy & Paste Friendly
PositionSize = MarginDeposit = 1;
RoundLotSize = 1; // this you can set also in the Settings page
PointValue = 20;

_SECTION_BEGIN("Heiken Asi Candlestick Oscillator");
function ZeroLagTEMA( array, period ) 
{ 
 TMA1 = TEMA( array, period ); 
 TMA2 = TEMA( TMA1, period ); 
 Diff = TMA1 - TMA2; 
 return TMA1 + Diff ; 
} 

///////////////////// 
// Heikin-Ashi code 
HaClose = (O+H+L+C)/4; 
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 ); 

avp = Param("Up TEMA avg", 34, 1, 100 ); 
avpdn = avp; //Param("Dn TEMA avg", 34, 1, 100 ); 

avp = Optimize("Periods", 34, 1, 100, 1);

// Velvoort is using not original, but modified Heikin-Ashi close 
HaClose = ( HaClose + HaOpen + Max( H, HaOpen ) + Min( L, HaOpen ) )/4; 

// up average 
ZlHa = ZeroLagTEMA( HaClose, avp ); 
ZlCl = ZeroLagTEMA( ( H + L ) / 2, avp ); 
ZlDif = ZlCl - ZlHa; 

keep1 = Hold( HaClose >= HaOpen, 2 ); 
keep2 = ZlDif >= 0; 
keeping = keep1 OR keep2; 
keepall = keeping OR ( Ref( keeping, -1 ) AND ( C > O ) OR C >= Ref( C, -1 ) ); 
keep3 = abs( C - O ) < ( H - L ) * 0.35 AND H >= Ref( L, -1 ); 
utr = keepall OR ( Ref( keepall, -1 ) AND keep3 ); 

// dn average 
ZlHa = ZeroLagTEMA( HaClose, avpdn ); 
ZlCl = ZeroLagTEMA( ( H + L ) / 2, avpdn ); 
ZlDif = ZlCl - ZlHa; 

keep1 = Hold( HaClose < HaOpen, 2 ); 
keep2 = ZlDif < 0; 
keeping = keep1 OR keep2; 
keepall = keeping OR ( Ref( keeping, -1 ) AND ( C < O ) OR C < Ref( C, -1 ) ); 
keep3 = abs( C - O ) < ( H - L ) * 0.35 AND L <= Ref( H, -1 ); 
dtr = keepall OR ( Ref( keepall, -1 ) AND keep3 ); 

upw = dtr == 0 AND Ref( dtr, -1 ) AND utr; 
dnw = utr == 0 AND Ref( utr, -1 ) AND dtr; 

Haco = Flip( upw, dnw ); 

Short   = (Cross (Haco, 0.5) && Hour() > 9 && Hour() < 14);
Buy = (Cross (0.5, haco) && Hour() > 9 && Hour() < 14);
Sell = (Cross (Haco, 0.5) && Hour() > 9 && Hour() < 14) OR Hour() == 14;
Cover  = (Cross (0.5, haco) && Hour() > 9 && Hour() < 14) OR Hour() == 14;

if( ParamToggle("Chart Type", "Price with color back|HACO wave" ) ) 
{ 
 Plot( Haco, "Haco", colorRed ); 
} 
else 
{ 
 Plot( C, "Close", colorBlack, 
       ParamStyle( "Style", styleCandle, maskPrice ) ); 
 Plot( 1, "", IIf( Haco, colorPaleGreen, colorRose ), 
       styleArea | styleOwnScale, 0, 1 ); 
}
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back