Karthik's EOD Strategy...

karthik_sri

Well-Known Member
Code:
_SECTION_BEGIN("Karthik's_EOD_System");
//SYSTEM
M3  	=	EMA(C, 3);
M10 	=	EMA(C,10);
M30 	=	EMA(C,30);

Long_Setup 	=	M3 > M30 AND M10 > M30;
Short_Setup	=	M3 < M30 AND M10 < M30;

Buy 	=	Long_Setup AND M3 > M10 AND PDI(14) > MDI(14);
Sell	=	M3 < M10 OR  PDI(14) < MDI(14);
Buy 	=	ExRem(Buy,Sell);
Sell	=	ExRem(Sell,Buy);

Short	=	Short_Setup AND M3 < M10 AND  PDI(14) < MDI(14);
Cover	=	M3 > M10 OR PDI(14) > MDI(14);
Short	=	ExRem(Short,Cover);
Cover	=	ExRem(Cover,Short);
SetPositionSize(1,4);

//Plots
Plot(M3, "M03",colorBlue, styleLine);
Plot(M10,"M10",colorRed,  styleLine);
Plot(M30,"M30",colorGreen,styleThick);
Plot(2,"",IIf(MDI(14) > PDI(14),colorRed,colorBlue), styleNoLabel | styleOwnScale | styleArea,-3,100);

PlotShapes(Buy   * shapeUpArrow,   colorBlue,0,L); 
PlotShapes(Short * shapeDownArrow, colorRed, 0,H); 
PlotShapes(Cover * shapeSmallUpTriangle,   colorBlue,0,L); 
PlotShapes(Sell  * shapeSmallDownTriangle, colorRed, 0,H); 
_SECTION_END();

_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();
Just quickly put it together, please check if the code matches your system.

Cheers
:thumb:
Thanks bro for your contribution...yes the code matches with the setup...what is the "Triangle" which is comming apart from the Buy/Sell arrows?
 

rkkarnani

Well-Known Member
See the big candle on 24.09.12 in Bharti Airtel. The scrip was in sideways and inside the candle range of 24th. The candle didnt breached the high/low of 24th candle from 25.09.12 to 12.11.12 and on 13.11.12 it breached the high. Though this is not related with this strategy but thought to share the same to avoid whipsaw! The ADX & EMA fulfilled the condition for long and made good high.

http://i.imgur.com/1io0edG.png
Karthik, Just sharing my observation ! The BIG bar in Bharti Futures of 24th Sep 2012 candle that we see encompassing all next 25 bars , has a high of 283 and low of 250 !!
Now if we look at the data of same day for Bharti Cash : The High and Low are 283 and 273 !
If we look at the Premium Future was to Cash in Bharti during that period , it was around 0.50 paise or less.
Such trades occur off and on during the first few micro seconds of the market opening. In Bharti Futures on 24th Sep 2012, after first 1/2 minutes, price never fell below 275.45 !
 

Gaur_Krishna

Well-Known Member
Anant Sir,
Need your help for backtesting this strategy. I remember you doing it for a couple of strategies, so now this please...
Few thoughts:
1. Segment could be NIFTY, BNF and only F&O stocks as all short & long calls can be considered.
2. May be from 2000 till date; only in the form og points gained as LOT SIZES have changed in between many times. (The same way done by you & SG sir for Quadra...if I recall correctly....)

Regards,
Gaur_Krishna
I have not done backtesting based on AFL. I dont know AFL programming, req Anant sir to help.:)
 

Similar threads