Opinion on Backtest results

dell

Well-Known Member
#21
Take your time.....
abhi , r u only using psar and adx ?
as i try on ur theme but result is only 4lakhs for 4 lots ?
also use some trailing sl which is used in my system , but i think psar itself act as a trailing sl ?
also ur signal is coming after closing of bar or u are consedring open as trigger ?
 

dell

Well-Known Member
#22
If I answer your questions briefly I will have to tell everything that I used. Do you want me to share it before you do it yourself?

Technically yes. I have only 2 indicators i.e. PSAR and ADX.
Yep, PSAR itself acts as a trailing SL or you can use a custom SL using Highest High and Lowest Low. Here is the code: (I am depending on PSAR)
Code:
// Trailing stop loss
_SECTION_BEGIN("Trailing SL");
no		= Param( "Swing", 5, 3, 20, 1);
no		= Optimize( "Swing", no, 3, 20, 1);
res		= HHV(H,no);
sup		= LLV(L,no);
tsl		= // IIf(ValueWhen(IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0))!=0,IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0)),1)==1,sup,res);
tsl		= IIf(ValueWhen(IIf(NNClose>psar,1,IIf(NNClose<psar,-1,0))!=0,IIf(NNClose>psar,1,IIf(NNClose<psar,-1,0)),1)==1,sup,res);
Plot(tsl, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleStaircase));
_SECTION_END();
// End trailing stop loss
Buy or short is PSAR cross Open on charts. But my code is customized so the working is different.
no abhi , u are consedring wrong about me ,
i not asked ur system ,
i try to code a system on ur theme , thinking that if u can do it , why i can't ....
but when i try to code , i get totally different result , may be i missed some thing , than i think may be u are using some other things also ,
just for info ,i casually ask u about whether u are using some other thing also ?
will try again on same theme .......

regarding my system sharing , i already shared with 7 peoples of this forum ,also never intended to make money by this type of titbits ....i want to improve myself ,that's it ....
moreover u will be suprised to know that i don't know coding , i only try to code by looking at other's code and afl libary and with help of some senior's here.....
 
#24
this might help to improve your thing not sure
this is my coding for ATR
I made for my market but looks good on NIFTY too 5 M


multi=Param("multi",2.5,0,10,0.25);
pds=Param("pds",10,1,252,1);
pds1=Param("pds1",21,1,252,1);
//plo=Param("plot",1,1,3,1);
adv=Param("todayTrailingStop",0,0,1,1);
delay=Param("delay",0,0,5,1);

//TrailingStop
StLong = HHV(C-multi*EMA(ATR(1),pds),pds1);
StShort = LLV(C+multi*EMA(ATR(1),pds),pds1);
stopLong = IIf(C<Ref(C,-1),StLong,Max(Stlong,Ref(StLong,-1)));
stopShort = IIf(C>Ref(C,-1),StShort,Min(StShort,Ref(StShort,-1)));

//Trade flags/signals
In = Cross(C,Ref(stopShort,-1));
Out = Cross(Ref(stopLong,-1),C);
Init = Cum(IsTrue(In+Out))==1;
x = ValueWhen((In-Out)!=0 OR Init,In-Out,1);
lg = x==1 AND ((x!=1 OR Ref(x,-1)!=1) OR Init);
Sh = x==-1 AND ((x!=1 OR Ref(x,-1)!=1) OR Init);
Signals = lg-Sh;
flag = ValueWhen(Signals!=0 OR Init, Signals,1);

//Switch between Long/Short stops
stop = Ref(IIf(flag==1,stopLong,stopShort),-1+adv);

//Plot(Ref(stopLong,-1+adv),"stopLong",colorRed,styleLine);
//Plot(Ref(stopShort,-1+adv),"stopShort",colorBrightGreen,styleLine);
Plot(stop,"stop",colorYellow,styleLine);

Buy = ExRem(lg,sh);
Sell = ExRem(Sh,Buy);
shapeB = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shapeB, IIf( Buy, colorBrightGreen, colorOrange ), 0, IIf( Buy, Low, High ) );
GraphXSpace = 5;

_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();
 

dell

Well-Known Member
#26
Take your time.....
thankyou abhi , for provoking ,

am sorry despite of my all effort , i not reach above 10 lakhs profit by using ur theme ,
but suprisingly when i add some features while testing on my system .......i find this report ,
finetuning and opti. is remaining .....testing period is same 1-1-10 to 31-12-13 with 4lots on bnf-1....0.6% is deducted as brokerage and slippage









see what i improve ..........drawdown .....sharpe ratio and many things get improved , but trade increased from 533 to 624
also get some more idea's while testing whole day ....will do it on sunday as today i left trading after seeing ur report and from morning i am working on it ,
but i am failed on working on ur theme, i try all things , but by closing price .....what is miss i don't know ...if u throw some idea than a great help ......
thanks abhi
 
Last edited:

dell

Well-Known Member
#27
Report is good. You have improved drawndown, recovery factor, profit ratio, RAR/MDD and CAR/MDD.....

There is one thing, which if I tell you should increase the accuracy and winning factor. Should I or you need more time?
i can improve winning streaks upto 62% but net profit will come drastically down ,
yes we both need some more time to settle on ........
 

dell

Well-Known Member
#28
It happens all the time... I have been able to get 80-90% accuracy using optimization results but profits always drops and too drastically...

And i was genuinely asking if you need more time to do your research as you said you would like to try.

Anyways the secret to my system is Heikin Ashi. Use it with normal PSAR, trailing SL using HHV,LLV or ATR or anything...... or just plain Heikin Ashi....
thanks abhi , i never used heikin ashi till now , is it really helps ?
also thanks for guidence , will try one more time on sunday ,
have u enabled ur pm, want to share some details with u ...
goodluck for future ......
 
#29
before tommorow , i will try to post an afl with similiar result , as i love challanges , i myself want to create some thing better , hope i am able to do that ........
, i want to try it as a challenge.........
I am looking forward to the afl before tomorrow...:thumb:
 
#30
Hi Dell
I was trying to see your code in ither post
see my segguestion in few lines
do you want me to fix it for you but not sure if it is write concept or not
what i am doing here , is :
a condition here i do for getting signals within scronize of 15m tf , but when i switch to my trading tf which is 3Min , arrows are NOT coming ...........where i am making mistake ,help plz
OR plz give me a rough idea , how to take signals in 3Min charts with taking reference from 15m charts , here our motto is
if Buy Signal is in 15m charts than we take all Buy signals of 3m charts AND Cover them by using 3Min charts ........
similarly if Sell Signal is generated by 15m charts than we take all Sell signals of 3m charts AND Cover them according to 3m charts ........hope i am able to explain things clearly .....

BuyX= condition1;
SellX=condition2;
ShortX= condition3;
CoverX=condition4;

TimeFrameSet(in1Minute*15);
tbuyx=BuyX;
tsellx=SellX;
tshortx=ShortX;
tcoverx=CoverX;
TimeFrameRestore();

ttbuyx=TimeFrameExpand(tbuyx,in1Minute*15,expandFi rst);
ttsellx=TimeFrameExpand(tsellx,in1Minute*15,expand First);
ttshortx=TimeFrameExpand(tshortx,in1Minute*15,expa ndFirst);
ttcoverx=TimeFrameExpand(tcoverx,in1Minute*15,expa ndFirst);

Buy= condition1 AND ttbuyx;
Sell=condition2 ;
Short= condition3 AND ttshortx;
Cover=condition4;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-20);
PlotShapes(IIf(Sell, shapeHollowStar, shapeNone),colorPink, 0,H, Offset=-45);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-45);
PlotShapes(IIf(Cover, shapeHollowStar, shapeNone),colorLime, 0,L, Offset=-45);






Reply :::::

without seeing atleast one of the conditions from condition1 to condition4 diff to Say.....but in case condition1...4 is dependent on information of 15Min TF ....then there will be a problem as you are using conditionx AND ttxxxx in the same statement AND they would be of array from diff TFs

I know here you have shown it before TimeFrameSet...but NOT sure exactly what it is so diff to comment on exact issue


Reply Here is The four LIne

yes sir , here condition 1-4 are dependent on 15mtf which are further dependent on hourly AND all are dependent on daily so overall there are 4 TimeFrameSet function used for a single condition .......

AND if we assume ;
condition 1= MA(20,C)>MA(50,C);
condition2=MA(20,C)<MA(50,C);
condition3=MA(20,C)<MA(50,C);
condition4=MA(20,C)>MA(50,C);
than what will be the procedure ,for seeing signals of 15m in 3Min ?rough idea will also help sir ....




*** REPLY -> All four Conditions you want to decision On TimeFrame 15Min Have to Calculate On that 15Min timeframe; then, use TimeFrameExpand in Other timeframe.
Currently mistake is this Code use the result in general timeframe AND pass the result to 15Min timeframe instead.