Niludeepak : 15 Min Time Frame Trading in Nifty

As u used zig zag now code looking in to future. Your earlier code is fine. You can make easy your code by putting:
upbar=Optimize("UpBar",13,1,21,1);
dnbar=Optimize("DnBar",13,1,21,1);
TrendUp = C > Ref(upbar,-1);
TrendDn = C < Ref(dnbar,-1);
TrendUp = ExRem(TrendUp,TrendDn);
TrendDn = ExRem(TrendDn,TrendUp);

U can optimize by changing a bit. Hope this will help you.

johnnypareek at yahoo.com
jhonny i m only new in afl creations, will u pl add the above mentioned codes and reconstruct the whole thing as u r suggesting
 
hi deepak

can u give the changes in strategy without afl?
i dont use ami... please help in this case ... :confused:
strategy is to buy on breakout of highest high of 8 periods and sell on breakdn of lowest low of 8 periods, new addition is to take the trades after a reversal from high or low of .6% , means both above conditions r there
 

kingkrunal

Well-Known Member
strategy is to buy on breakout of highest high of 8 periods and sell on breakdn of lowest low of 8 periods, new addition is to take the trades after a reversal from high or low of .6% , means both above conditions r there
thanks for the reply...
can u pls explain wit a sample chart and an example?
I am using tradetiger if possible can u explain me in that setting?
also good to knw u a gujju ... me too :)
 

johnnypareek

Well-Known Member
jhonny i m only new in afl creations, will u pl add the above mentioned codes and reconstruct the whole thing as u r suggesting
hi,

here it is
HTML:
_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 ) ) ));
upbar=Optimize("UpBar",13,1,21,1);
dnbar=Optimize("DnBar",13,1,21,1);


TrendUp = C > Ref(HHV(H,upbar),-1);
TrendDn = C < Ref(LLV(L,dnbar),-1);
TrendUp = ExRem(TrendUp,TrendDn);
TrendDn = ExRem(TrendDn,TrendUp);

Plot(Ref(HHV(H,upbar),-1),"\n 8H Hi", colorBlue);
Plot(Ref(LLV(L,dnbar),-1),"8H Lo", colorRed);

up=Ref(((Ref(HHV(H,upbar),-3))+(Ref(LLV(L,dnbar),-3)))/2,-1)<((Ref(HHV(H,upbar),-3))+(Ref(LLV(L,dnbar),-3)))/2;
dn=Ref(((Ref(HHV(H,upbar),-3))+(Ref(LLV(L,dnbar),-3)))/2,-1)>((Ref(HHV(H,upbar),-3))+(Ref(LLV(L,dnbar),-3)))/2;
Vcolor=IIf( BarsSince(up) < BarsSince(dn),colorBrightGreen ,colorOrange);
Plot(((Ref(HHV(H,upbar),-3))+(Ref(LLV(L,dnbar),-3)))/2,"\n8H Piv 3 back shifted", Vcolor);

_SECTION_BEGIN("Chart");
D=IIf( C > Ref(HHV(H,upbar),-1), colorBlue ,IIf( C < Ref(LLV(L,dnbar),-1), colorRed ,0 ));

Vcolor1=IIf( (trendup),colorBlue,IIf((trenddn), colorRed,D));//
GraphXSpace = 5;
PlotOHLC( Open, High, Low, Close, "", vcolor1, styleCandle | styleThick );
PlotShapes(IIf(trenddn, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(trendup, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);

_SECTION_END();

// for back testing, 15 pt SL, target 70 pt
SetPositionSize( 50, spsShares ); // 50 shares by default

Buy=Cover= C > Ref(HHV(H,upbar),-1) ;
Sell=Short = C < Ref(LLV(L,dnbar),-1) ;

johnny
 
HI Niludeepakji

where r u ?

i have visited ur thread many times but never posted any.

but thanks your method is superb:clap: and just going to start trades with it.

ur zigzag afl looks good and want some more light on it.

thanks :clapping:
 

Similar threads