dear all
i have complted the AFL
use it directly and post your suggestion
regds
Tipss_Bse_Nse
http://www.tipssbsense.blogspot.com
/* Originally Posted by TradersEdge
I want to address a question commonly asked by investors AND traders new to technical analysis AND trading systems,
"What is a good simple system to follow, to get in and out of markets?".
Most people are comfortable with the herd, market rumours, broker tips, etc. But by confirming your trading decision with the
help of this trading system, you will be on the way to more profitable trading.
This simple AND robust trading systems will NOT only identify trends, but will also provide you with entry AND exit trading signals.
The Trading System
Remember the numbers 3 x 13 = 39
Simple daily moving averages of 3,13 AND 39 can keep you in AND out of markets fairly efficiently AND profitably,
(in any time frame actually). Here's how.
Some basic principles to understand are:
-The market moves in long (secular) trends.
-Intermediate trends can last for months to years.
-Short term trends can last for days to weeks.
-Trade intermediate trends in either direction.
-Trade Short term trends only in the direction of the intermediate trend.
Proxies:
3 Day MA - a proxy for price
13 Day MA - a proxy for the Short term trend (a moving trend line)
39 Day MA - a proxy for the intermediate trend (a moving trend line).
The Basics of MAs
MAs lag market reversals at tops AND bottoms, the larger the MA the longer the lag period, the shorter the MA the shorter the lag
but the more frequent the whipsaws. MAs work well when markets trend but get frequently whipsawed when they are in a range.
Therefore, trade trends with the MAs but do NOT trade ranges using MAs. Just stand aside AND be patient until a new trend emerges.
The intermediate trend is in the direction of the 39 MA which acts like a moving trend line. if the 39 MA is pointing up
then the intermediate trend is up, if down the trend is down. if the 39 MA is horizontal the market is in a range, from
which a trend will, sooner OR later, emerge.
Simple Trading Rules
1. When the 39 MA is moving up Buy when the 3 MA crosses up over the 13 MA. AND/OR when the 3 MA crosses above the 39 MA..
When the 13 MA crosses above the 39 MA consider adding to your long position. Exit AND stand aside when the 3 crosses back
below the 13 MA..
*/
MA3 = MA(C,3);
MA13 = MA(C,13);
MA39 = MA(C,39);
cond1 = (MA39 > Ref(MA39,-1)) AND
(Ref(MA39,-1) > Ref(MA39,-2)) AND
(Ref(MA39,-2) > Ref(MA39,-3)); // 39 moving up
Cond2 = Cross(MA3,MA13); // 3 crosses 13
Cond3 = Cross(MA3,MA39); // 3 crosses 39
Cond4 = Cross(MA13, MA39);
Cond5 = Cross(MA13,MA3) OR Cross(MA39,MA3);
Buy = Cond1 AND (Cond2 OR Cond3);
Holdbuy = cond4;
Short = (Buy OR Holdbuy) AND Cond5;
// buy arrows
PlotShapes(shapeUpArrow*Buy ,colorBlue, 0,MA3,-25);
PlotShapes(shapeUpTriangle*holdbuy, colorBlue,0,MA39,-12);
PlotShapes(shapeDownTriangle*Short, colorBlue,0,MA3,-12);
/*
2. When the 39 MA is moving down Sell Short when the 3 MA crosses below the 13 MA. AND/OR when the 3 MA crosses below the 39 MA..
When the 13 MA crosses below the 39 MA consider adding to your Short position. Exit AND stand aside when the 3 MA crosses
back up over the 13 MA.
*/
cond6 = (MA39 < Ref(MA39,-1)) AND
(Ref(MA39,-1) < Ref(MA39,-2)) AND
(Ref(MA39,-2) < Ref(MA39,-3));
Cond7 = Cross(MA13,MA3);
Cond8 = Cross(MA39,MA3);
Cond9 = Cross(MA39,MA13) ;
Cond10 = Cross(MA3,MA13) OR Cross(MA3,MA39);
Sell = cond6 AND (cond7 OR Cond8);
Holdsell = Cond9;
Cover = (Sell OR holdsell) AND Cond10;
// sell arrows
PlotShapes(shapeDownArrow*Sell,colorWhite, 0,MA13,-12);
PlotShapes(shapeHollowDownTriangle*Holdsell, colorWhite,0,MA39,-12);
PlotShapes(shapeHollowDownTriangle*Cover, colorWhite,0,MA3,-12);
/*
3. Only initiate trades in the opposite direction of the intermediate trend when the 3 MA crosses above OR below the 39 MA,
preferably after the 39 MA has already changed direction.
4. This 3:13 MA crossover will keep you trading in the trend with only a small lag AND on the sidelines during corrections.
The lag only becomes more substantial at reversals of the intermediate trend (a 3:39 crossover), a small price to pay at
these uncertain times of trend transition.
You can set your technical analysis sofware to show bar charts with these 3X13x39 simple MAs. This trading system will help you
select the best traders while avoiding the less profitable trades in choppy markets.
*/
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 3,3,3);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 13,13,13);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("MA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 39,39,39);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();