Hello Yofa,
In an attempt to improve stops optimizing a FX system I was piking
trades randomly out of signals generated by my entry logic.
The funny thing is that I get better results by removing the entry logic
completely.
|
SetOption( "initialequity", 100 );
SetOption( "FuturesMode" , 1);
SetOption( "ActivateStopsImmediately", 0 );
SetOption( "Allowsamebarexit", 0 );
SetOption( "PriceBoundChecking", 0 );
SetOption( "MaxOpenPositions" , 500);
*PointValue* = 1;
*MarginDeposit* = -2;
SetBarsRequired(-2,-2);
sl= Optimize("stop loss", 200, 10 , 200, 20)/100;
tp = Optimize("take profit", 10, 10 , 200, 20)/100;
tmf =*inHourly*;
TimeFrameSet(tmf);
*Buy* = mtRandomA()>mtRandomA();
*Short* = !*Buy*;
sl = sl* ATR(10);
tp = tp*ATR(10);
*Buy* = *Buy* * !IsNull(sl);
*Short* = *Short* * !IsNull(sl);
TimeFrameRestore();
*Buy* = TimeFrameExpand(*Buy*, tmf );
*Short* = TimeFrameExpand(*Short*, tmf );
*Buy* = BarsSince(!*Buy*)==1;
*Short* = BarsSince(!*Short*)==1;
sl = TimeFrameExpand(sl, tmf );
tp = TimeFrameExpand(tp, tmf );
spread = 0;//2* TickSize ;
*BuyPrice* = *C* * (1+ spread);
*ShortPrice* = *C* * (1- spread);
*Sell* = *Cover* = 0;
ApplyStop( *stopTypeLoss*, *stopModePoint*, sl, 1,0 );
ApplyStop( *stopTypeProfit*, *stopModePoint* , tp, 1,0 );
SetPositionSize( 5 , *spsPercentOfEquity* );
eq = Equity(1);
Plot(eq,"", *colorRed*, *styleLine*+*styleOwnScale*);
totbuy = Cum(*Buy*);
totshort = Cum(*Short*);
tot = totbuy + totshort;
pctLongs = totbuy/tot*100;
SetChartOptions( 0, *chartShowDates* | *chartShowArrows* );
Plot( *C*, "Longs %: "+ pctLongs +"\n" + Date() , *colorWhite*,
*styleBar* );
PlotShapes( *Buy** *shapeSmallUpTriangle*, *colorGreen*, 0, *L* );
PlotShapes( *Short** *shapeSmallDownTriangle*, *colorRed*, 0, *H* );
|
Yofa wrote:
Hi All,
I'm trying to improve my optimization method. So I divided my trading
system into parts: entry logic, trade management logic (trailing,
profit target, volatility exit, etc ), filters, etc.
I created a random entry system, that uses the same trade management
logic as my trading system.
With random entries I optimized the parameters of the trade management
logic. I also try to improve filters the same way.
My questions:
Is there anyone who uses similar technic for optimization?
Is there anyone how uses similar approach to validate the trading
system and its parameters?
Is it reasonable optimization method?
Any opinion or experiance appreciated.
Regards,
Y