Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Lagging MA-Xover
Author/Uploader: Thomas Heyen - (email hidden)
Date/Time added: 2006-06-08 05:27:49
Origin: Result of testing futures intraday models
Keywords: Model Moving Average Crossover
Level: medium
Flags: system

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

Fast DEMA crossing its same period lagging EMA.

Formula:

/* ###################
Lagging MA-Xover
Author: Thomas Heyen
Intraday Trading Model

Please set your Chart to
the Timeframe of the Model!
Otherwise Trading Ribbbon and
Shapes will not correspond to
the Graph.
#####################*/


MarketHours = TimeNum()>=094000 AND TimeNum()<=154400; 
MarketClose= TimeNum()>=154444 AND TimeNum()<=240000;


TimeFrameSet(120);
smooth = Optimize("smooth",20,2,40,1);
Lag = Optimize("lag",22,2,40,1);
fast = DEMA(C,smooth);
slow = Ref(EMA(C,smooth),-Lag);
Buy = Cross(fast,slow) AND MArkethours;
Sell = Cross(slow,fast) OR slow == fast OR MArketclose;
Cover = Cross(fast,slow) OR slow == fast OR MArketclose;
Short = Cross(slow,fast) AND MArkethours;


PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen);
PlotShapes(IIf(Short,shapeDownArrow,shapeNone),colorRed);
// Plot Trading Ribbon
Color = IIf( BarsSince(Sell)>BarsSince(Buy), colorGreen, IIf(
BarsSince(Cover)>BarsSince(Short), colorRed, colorWhite ));
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 15 );
TimeFrameRestore();

Comments:

M Ramu
ramu.manjunath [at] vignani.com
2007-08-07 10:42:01
for india stock market what should be the timenum


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM