NF Swing Trading using Fractal AFL

vijkris

Learner and Follower
#61
Sir, Actually till the beginning of last year I was doing backtesting. I started trading the results only afterwards. I have done backtest of almost all the AFL's I could find. I have listed only the Top 17 here.
nice work:thumb:

what is the avg winners% in all these afl?
btw did u backtest these afl in lower tf for intraday?
if yes can u share that result also.
 
#62
Lincoln once told me that he has 5000 AFLs and asked me if I wanted them.He also said none of them work well.My answer was if they don't work,then what do I do with them ? Put them in my AFL collection?

Smart_trade
 

hmp

Well-Known Member
#63
Dear Oldtrader ji
Rely hats off to you for your hard work & to your success which is otherwise so much of tedious task.Keep it up.
One thing i want to know is in Fractal afl you have given two adjusted parameters(0.057 & 0.008),are they Acceleration & Max acceleration respectively?
Thanks & regards.
 

vijkris

Learner and Follower
#64
Dear Oldtrader ji
Rely hats off to you for your hard work & to your success which is otherwise so much of tedious task.Keep it up.
One thing i want to know is in Fractal afl you have given two adjusted parameters(0.057 & 0.008),are they Acceleration & Max acceleration respectively?
Thanks & regards.
dear hmp ji, u can safely consider using fractal afl 7min tf for swing trading..
supertrend is good as well
 

oldtrader

Well-Known Member
#67
nice work:thumb:

what is the avg winners% in all these afl?
btw did u backtest these afl in lower tf for intraday?
if yes can u share that result also.
I have the optimization results file for the AFL . By varying the number of trades the AFL can be made suitable from Intraday to Positional trading. The optimization file is of 26MB size. It is taking a long time to open. I will post some example tomorrow.
 

oldtrader

Well-Known Member
#68
Dear Oldtrader ji
Rely hats off to you for your hard work & to your success which is otherwise so much of tedious task.Keep it up.
One thing i want to know is in Fractal afl you have given two adjusted parameters(0.057 & 0.008),are they Acceleration & Max acceleration respectively?
Thanks & regards.
Yes you are right. The parameters are Acceleration and Max. Acceleration. Optimization is done with an increment of 0.001. Which means Amibroker will analyse the data starting with parameters 0,0 then 0,0.001, then 0,0.002 and so on. Believe me the computer took 2 days of continous running for the optimization.
 

oldtrader

Well-Known Member
#69
great work..post afls too so people can test it themselves too ..if not all..then at least top 10...
-
-
Here is the first one in the list
AFL Name = St-wst
TF = 7 min
Parameters = 6 & 2.5


HTML:
// translation in Amibroker AFL, Edward Pottasch, 9/29/2011
SetChartBkGradientFill( ParamColor("Inner panel upper",colorWhite),ParamColor("Inner panel lower",colorLightYellow));
Factor=Param("Factor",3,1,10,1);
Pd=Param("ATR Periods",10,1,100,1);
Up=(H+L+C)/3+(Factor*ATR(Pd));
Dn=(H+L+C)/3-(Factor*ATR(Pd));

aa=Cross(C,LLV(Up,13));
bb=Cross(HHV(Dn,13),C);
Td[0]=1;
for(i=1;i<BarCount;i++ )
{
	prev=Td[i-1];
	if(aa[i])
	{
		Td[i]=1;
	}
	else if(bb[i])
	{
		Td[i]=-1;
	}
	else
	{
		Td[i]=prev;
	}
}
aa=Dn==HighestSince(Cross(Td,0),Dn);
Dnx=Dn[0];
for(i=1;i<BarCount;i++ )
{
	prev=Dnx[i-1];
	if(aa[i])
	{
		Dnx[i]=Dn[i];
	}
	else
	{
		Dnx[i]=prev;
	}
}
aa=Up==LowestSince(Cross(0,Td),Up);
Upx=Up[0];
for(i=1;i<BarCount;i++ )
{
	prev=Upx[i-1];
	if(aa[i])
	{
		Upx[i]=Up[i];
	}
	else
	{
		Upx[i]=prev;
	}
}
aa=Td==1;
bb=Td==-1;
ST[0]=1;
trend=Null;
for(i=1;i<BarCount;i++ )
{
	prev=ST[i-1];
	if(aa[i])
	{
		ST[i]=Dnx[i];
		trend[i]=1;
	}
	else if(bb[i])
	{
		ST[i]=Upx[i];
		trend[i]=-1;
	}
	else
	{
		ST[i]=prev;
		trend[i]=trend[i-1];
	}
}

Buy=Cover=aa;
Sell=Short=bb;
PositionSize = MarginDeposit = 1;	
Buy = ExRem(Buy, Short);
Short = ExRem(Short, Buy);
PlotShapes( Buy * shapeUpArrow + Short * shapeDownArrow, IIf( Buy, colorBlack, colorBlack ) );
//r1=AmiTradingSA();
BuyBar = BarsSince ( Buy );
SellBar = BarsSince ( Sell );

//AlertIf( Buy , "EXEC D:\\Documents and Settings\\msa\\Desktop\\tr\\BuyOrderPlacer.exe", "Launching external application", 3 );
//AlertIf( Sell , "EXEC D:\\Documents and Settings\\msa\\Desktop\\tr\\SellOrderPlacer.exe", "Launching external application", 3 );



dist = 1.0*ATR(20); 

for( i = 0; i < BarCount; i++ ) 
{ 
//if( Buy[i] ) PlotText( "Buy\n@" + C[ i ]+"\n sl :"+ValueWhen( supbase==Base, LLV(L,HHVperiod) ) , i, L[ i ]-dist[i], colorBlack,colorGreen ); 
//if( Short[i] ) PlotText( "Sell\n@" + C[ i ]+"\n sl :"+ ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), i, H[ i ]+dist[i], colorBlack, colorRed ); 
if( Buy[i] ) PlotText( "Buy\n@" + C[ i ] , i, L[ i ]-dist[i], colorBlack,colorWhite ); 
if( Short[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorBlack, colorWhite ); 


} 

t1= Flip(Buy,Sell);
t2= Flip(Sell,Buy);
BPrice=ValueWhen(t1 AND Ref(t1,-1)==0,C,1);
SPrice=ValueWhen(t2 AND Ref(t2,-1)==0,C,1);

Buyplus1=(Bprice*1.008);
Buyplus2=(Bprice+80);
Buyminus=(Bprice*0.995);
//Plot(Buyplus1,"R1",colorGreen);
//Plot(Buyplus2,"R1",colorBlue,styleDots|styleThick|styleNoTitle);
//Plot(Buyminus,"R2",colorGreen);

Sellplus=(Sprice*1.005);
Sellminus1=(Sprice*0.992);
Sellminus2=(Sprice-80);
//Plot(Sellplus,"R3",colorRed);
//Plot(Sellminus1,"R4",colorRed);
//Plot(Sellminus2,"R4",colorBlack,styleDots|styleThick|styleNoTitle);
SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0,0)));
SetChartOptions(0,chartShowDates);
SetBarFillColor(IIf(C>O,ParamColor("Candle UP Color", colorGreen),IIf(C<=O,ParamColor("Candle Down Color", colorRed),colorLightGrey)));
Plot(C,"\nPrice",IIf(C>O,ParamColor("Wick UP Color", colorDarkGreen),IIf(C<=O,ParamColor("Wick Down Color", colorDarkRed),colorLightGrey)),64,0,0,0,0);
Plot(IIf(trend==1,ST,Null),"\nUP",colorGreen,styleDashed);
Plot(IIf(trend==-1,ST,Null),"\nDN",colorRed,styleDashed);


GfxSetBkMode(1);
GfxSelectPen( colorBlack, 1, 0) ;
GfxSelectSolidBrush( colorPink ); 
GfxRoundRect( 2, 15, 95, 35, 9, 9 ) ;
GfxSelectFont("romans", 9, 700 ); 
GfxTextOut("ST-7  6.0 2.5", 5, 18);

GfxSetBkMode(1);
GfxSelectPen( colorBlack, 1, 0) ;
GfxSelectSolidBrush( colorPink ); 
GfxRoundRect( 100, 15, 200,42, 9, 9 ) ;
GfxSelectFont("romans", 18, 700 ); 
GfxTextOut( ""+C , 110, 13);
//GfxTextOut( ""+Buybar , 110, 13);


GfxSetBkMode(1);
GfxSelectPen( colorBlack, 1, 0) ;
GfxSelectSolidBrush( colorRed ); 
GfxRoundRect( 205, 15, 330, 35, 9, 9 ) ;
GfxSelectFont("romans", 9, 700 ); 
GfxTextOut("" +Date() , 210, 18);
//GfxTextOut("" +Sellbar , 210, 18);



for(i=BarCount-1;i>1;i--)
{
if(Buy[i] == 1)
{
entry = C[i];
sig = "BUY";


 
bars = i;
i = 0;
}
if(Short[i] == 1)
{
sig = "SELL";
entry = C[i];


 
 
bars = i;
i = 0;
}
}
Offset = 20;
//Clr = IIf(sig == "BUY", colorLime, colorRed);
//ssl = IIf(bars == BarCount-1, TrendSL[BarCount-1], Ref(TrendSL, -1));
//sl = ssl[BarCount-1];
pxHeight = Status( "pxchartheight" ) ;
y = pxHeight;
x = 5;
x2 = 140;
GfxSelectPen( colorGreen, 1); // broader color
GfxRoundRect( x, y - 48, x2, y , 7, 7 ) ;
//GfxTextOut( ("Last " + sig + " appeared ") , 13, y-45) ; // The text format location
//GfxTextOut( ("  BuyBar      "  + round((BarCount-bars-1) /55) + " Days ago") , 13, y-32) ; // The text format location
//GfxTextOut( ("" + WriteIf(sig =="BUY",sig + " @ ",sig + " @") + " : " + entry), 20, y-20);

Pls find attached the chart for the above AFL . See the aggressiveness of the system . The SAR is at 7901.81 whereas Frac7 is at 7802.1

 
Last edited:

hmp

Well-Known Member
#70
Thanks dear Oldtraderji.
In your system how to keep stop loss? & someone after booking profit by keeping some points or certain percentage for target,he wants to enter again in trade between crossovers how can he enter? And pl. guide us about how you personally trade to achieve max.optimization.
Thanks & regards.
 

Similar threads