Trading Nifty by Levels

As per my knowledge ....when you trade according to chart, then you should not set 3 or 5 min time interval...We should always work in 7 min and above...specially PSAR or SAR (As Khushiji posted in above post) pattern can give best result in 7 /9 / 12 / 15 time interval....Try it out...
 

sunny_cool

Well-Known Member
Khushi ji sent email 3 times on rocket from aquapuneet... hope you wil reply today

MSA plz plz check this also
(when free)

Khushi ji sent email 3 times on rocket from aquapuneet... hope you wil reply today


_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("Auto Trading System");
acc = Param("Acceleration", 0.019, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.019, 0, 1, 0.001 );
Plot( SAR( acc, accm ), _DEFAULT_NAME(), ParamColor( "Color", colorYellow ),
ParamStyle("Style", styleLine | styleLine, maskDefault | styleLine | styleLine )
);

Buy = Cross(Open, SAR(acc,accm));
Sell = Cross(SAR(acc,accm), Open );
Short=Sell;
Cover=Buy;
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone), colorYellow, 0, Low, Offset=-15);
PlotShapes(IIf(Sell, shapeDownArrow,shapeNone), colorBlue, 0, High,
Offset=-15);

AlertIf( Buy, "SOUND C:\\Windows\\Media\\Chord.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );

Filter = Buy OR Sell;

AddColumn( Buy, "Buy", 1);
AddColumn( Sell, "Sell", 1);

_SECTION_END();

_SECTION_BEGIN("BW Fractal");

//Fractal up

FUp =
((Ref(H,-4)<Ref(H,-2)) AND (Ref(H,-3)<Ref(H,-2)) AND (Ref(H,-1) <Ref(H,-2)) AND (H <Ref(H,-2))) OR
((Ref(H,-5)<Ref(H,-2)) AND (Ref(H,-4)<Ref(H,-2)) AND (Ref(H,-3)<=Ref(H,-2)) AND (Ref(H,-1)< Ref(H,-2)) AND (H <Ref(H,-2))) OR
((Ref(H,-6)<Ref(H,-2)) AND (Ref(H,-5)<Ref(H,-2)) AND (Ref(H,-4)<=Ref(H,-2)) AND (Ref(H,-3)<=Ref(H,-2)) AND (Ref(H,-1)<Ref(H,-2)) AND (H <Ref(H,-2))) OR
((Ref(H,-7)<Ref(H,-2)) AND (Ref(H,-6)<Ref(H,-2)) AND (Ref(H,-5)<=Ref(H,-2)) AND (Ref(H,-4)<=Ref(H,-2)) AND (Ref(H,-3)<=Ref(H,-2)) AND (Ref(H,-1)<Ref(H,-2)) AND (H <Ref(H,-2))) OR
((Ref(H,-8)<Ref(H,-2)) AND (Ref(H,-7)<Ref(H,-2)) AND (Ref(H,-6)<=Ref(H,-2)) AND (Ref(H,-5)<=Ref(H,-2)) AND (Ref(H,-4)<=Ref(H,-2)) AND (Ref(H,-3)<=Ref(H,-2)) AND (Ref(H,-1)<Ref(H,-2)) AND (H <Ref(H,-2)));

FractalUp = ValueWhen(FUp ,Ref(H,-2) ,1);

FUpBuyPrice = FractalUp + 0.01;
FUpHit = FUpBuyPrice <= H AND FUpBuyPrice >= L;
FUpSignalOn = Flip(Ref(FractalUp,-1) != FractalUp, FUpHit);

//Fractal Down

FDown=
((Ref(L,-4)>Ref(L,-2)) AND (Ref(L,-3)>Ref(L,-2)) AND (Ref(L,-1) >Ref(L,-2)) AND (L > Ref(L,-2))) OR
((Ref(L,-5)>Ref(L,-2)) AND (Ref(L,-4)>Ref(L,-2)) AND (Ref(L,-3)>=Ref(L,-2)) AND (Ref(L,-1) >Ref(L,-2)) AND (L > Ref(L,-2))) OR
((Ref(L,-6)>Ref(L,-2)) AND (Ref(L,-5)>Ref(L,-2)) AND (Ref(L,-4)>=Ref(L,-2)) AND (Ref(L,-3)>=Ref(L,-2)) AND (Ref(L,-1) >Ref(L,-2)) AND (L > Ref(L,-2))) OR
((Ref(L,-7)>Ref(L,-2)) AND (Ref(L,-6)>Ref(L,-2)) AND (Ref(L,-5)>=Ref(L,-2)) AND (Ref(L,-4)>=Ref(L,-2)) AND (Ref(L,-3)>=Ref(L,-2)) AND (Ref(L,-1)> Ref(L,-2)) AND (L > Ref(L,-2))) OR
((Ref(L,-8)>Ref(L,-2)) AND (Ref(L,-7)>Ref(L,-2)) AND (Ref(L,-6)>=Ref(L,-2)) AND (Ref(L,-5)>=Ref(L,-2)) AND (Ref(L,-4)>=Ref(L,-2)) AND (Ref(L,-3)>=Ref(L,-2)) AND (Ref(L,-1)> Ref(L,-2)) AND (L >Ref(L,-2)));

FractalDown=ValueWhen(FDown, Ref(L,-2), 1);

FDownSellPrice= FractalDown+ 0.01;
FDownHit = FDownSellPrice <= H AND FDownSellPrice >= L;
FDownSignalOn = Flip(Ref(FractalDown,-1) != FractalDown, FDownHit );

FractalBuy = Cross(C,FractalUp);
FractalSell = Cross(FractalDown,C);

//Plot Fractal on the title
ShowFSign = ParamToggle("Display Fractal Point", "No|Yes", 1);
ShowBSign = ParamToggle("Display Fractal Buy/Sell", "No|Yes", 1);

//PlotShapes(IIf(FractalBuy AND ShowBSign, shapeUpArrow, 0) ,colorCustom11, 0, L);
//PlotShapes(IIf(FractalSell AND ShowBSign, shapeDownArrow, 0) ,colorRed, 0, H);

Plot(Ref(FractalUp,4), "Fractal Up", ParamColor("Fractal Up Color", colorBrown) , ParamStyle("Fractal Up Style",styleLine|styleThick));
Plot(Ref(FractalDown,4), "Fractal Down", ParamColor("Fractal Down Color", colorBrown), ParamStyle("Fractal Down Style",styleLine|styleThick));
//PlotOHLC(Ref(FractalUp,4),Ref(FractalDown,4),Ref(FractalUp,4),Ref(FractalDown,4),"",colorAqua,styleCloud|4096,0,0,0);

//Looks into the future. This is done only to display Fractal arrow at the right bar.
//The calculation of the fractal up is done without looking into the future.
//PlotShapes(IIf((Ref(FractalUp,2) != Ref(FractalUp,1)) AND ShowFSign, shapeSmallCircle, shapeNone), colorWhite,0,Ref(FractalUp,2), 12);
//PlotShapes(IIf((Ref(FractalDown,2) != Ref(FractalDown,1)) AND ShowFSign, shapeSmallCircle, shapeNone), colorPink,0,Ref(FractalDown,2), -12);

_SECTION_END();




 
Yes this is a good one. 15 min TF gives good results over a period of time. 3 min TF will give many whipsaws. Also the Parameters need to be fine tuned a bit to get good results. Current Parameters are 0.019 and 0.019.
but msa sir, dis afl looks in to future, so dont u think, backtest result will always give a rosy picture????
 
Bought nifty 4800pe at 107 around senti level of 4686 and booked profit at116, thanks Khushi ji and ff35 ji. :clapping:
 
Last edited:

Similar threads