[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: AFL for Intraday



PureBytes Links

Trading Reference Links

Hi there! There are many indicators which can be used for intraday
buy/sell signals. But I kind of like this Heikin-Ashi code and the
signals it gives. Can't recall where I got it from, but here it is:

_SECTION_BEGIN("Heikin-Ashi With Reliable Crossovers");
Title = "";
function ZeroLagTEMA( array, period )
{
TMA1   = TEMA( array, period );
TMA2   = TEMA( TMA1, period );
Diff   = TMA1 - TMA2;
return TMA1 + Diff ;
}

period  = Param("Avg. TEMA period", 18, 1, 100 );
SwitchHA = ParamToggle("Plot Heikin-Ashi?", "No,Yes", 1);
ModifiedHA = ParamToggle("Modified Heikin-Ashi?", "No,Yes", 0);


// Heikin-Ashi code
HaClose  = (O+H+L+C)/4;
HaOpen  = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh  = Max( H, Max( HaClose, HaOpen ) );
HaLow   = Min( L, Min( HaClose, HaOpen ) );
if(ModifiedHA)// Modified Heikin-Ashi:
HaClose = ( HaClose + HaOpen + HaHigh + HaLow )/4;

// Switch between Heikin-Ashi chart and regular candlestick chart:
if(SwitchHA)
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Heikin Ashi " + Name(),
colorBlack, styleCandle | styleNoTitle | styleNoLabel);
else
Plot( C, "Regular candles " + Name(), colorBlack, styleCandle |
styleNoLabel );

Plot(Close,"",colorBrightGreen, styleNoLine );

HaClose = (HaClose + HaOpen + HaHigh + HaLow)/4;
ZLHa   = ZeroLagTEMA(HaClose, period);
ZLTyp   = ZeroLagTEMA(Avg, period);

if( ParamToggle("Plot Crossovers?", "No,Yes", 0 ) )
{
Plot( ZLHa, "ZLTema(Ha,"+period+")", colorRed, styleNoLabel);
Plot( ZLTyp, "ZLTema(Typ,"+period+")", colorBrightGreen, styleNoLabel);
}

Buy  = Cross( ZLTyp, ZLHa );
Sell = Cross( ZLHa, ZLTyp );

PlotShapes( shapeUpArrow * Buy, colorGreen, 0, HaLow );
PlotShapes( shapeDownArrow * Sell, colorRed, 0, HaHigh );
_SECTION_END();

Jorgen



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/