Ubzen System Development Process - page 4

 
sakis:


i am interresting for both system it must sell when the market change direction

If you make a simple cross over between 3WLMA and 100SMA 30 min chart EUR/USD tp 150pips and exit when cross over happent not SL you will end up with extreme

profittable system which i use it for somme time look the results and write to me back with 13% drawndowm

This system (3LWMA 100SMA cross) does not work on EURUSD H1,H4 and Daily chart
 
zzuegg:
This system (3LWMA 100SMA cross) does not work on EURUSD H1,H4 and Daily chart

hi zzuegg i know that it works in 30min chart and works only in euro min chart just put the system its self with out macd
 

sakis:

hi zzuegg i know that,

it works in 30min chart and works only in euro

just put the system its self with out macd
 
sakis:


some times the system s work better in live trading than in automatic because of the human eye you never fx enter a consolidation before the 6th tuch

of the chanel and before a thrust happent as well

as you never take a countertrend move before overlaping waves happent folowed by channel overshoot spike

also you all ways take a breackouts when hapent in a 3th or 4th move in short period of 1 or 2 days and high tick values because it means that prices are in strong hands

so we need filters to gover this human eye

 

Ok, Here's the bad period I was referring to. Now, I'm going to run this backwards, 1 year at a time. 2009,2008 etc.

Here's the yearly results:

2010--Max-DD= 6.47____Rel-DD= 6.47____Net_Profit=4588____Factor=2.48
2009--Max-DD=26.76____Rel-DD=26.76____Net_Profit=-380____Factor=0.94
2008--Max-DD=19.79____Rel-DD=19.79____Net_Profit=1096____Factor=1.20
2007--Max-DD= 7.10____Rel-DD= 7.10____Net_Profit=1506____Factor=1.62
2006--Max-DD=20.46____Rel-DD=20.46____Net_Profit=-1612____Factor=0.63
2005--Max-DD= 8.79____Rel-DD= 8.79____Net_Profit= -23____Factor=0.99

2005----------------

2006-----------------

2007-----------------

2008--------------

2009 ------------------

2010----------------

Couple of observations.

1) System tends to lose in a Row instead of randomly most of the time. Z-Score from the Article might help with this.

This helps underscores the fact why Professional traders look for 20-30% returns per year.

 

For now I can only do back-to-2005 because I'm using Fxdd's data found here. The reason why I'm using this data is because Fxdd closes for the weekend, just like my broker and have the weekend gaps by default. Also, their time settings is closer to my broker's. I may test on the 2000-2005 data from here if I have the time. Their week-open starts on Wednesday and they run 6-days a week.

Tho, the only period I've viewed visually is the Jan-March 2010 period, My best guess is that this system is losing in sequential manner because it's in Tight or Very Volatile Ranges. But that only applies best to 2008, and even if you have limited experience staring at charts, you could guess it may have had something to do with the Global Financial Crisis and the markets may have been moving on Fear more at that time.

So, what to do now?

-Accept results (like having a losing year is OK), Calculate our Kelly and not be greedy?

-Keep moving forward with more Statistical Analysis like Z-Score. But even if I got a confirmation about correlation among losses then what? I may still have to result to other methods like below to filter data.

-Look at this thing in visual mode during the bad periods and try to avoid what's killing it? The drawback is that this can lead to curve fitting ... if too much past knowledge avoiding is use just to make the back-test look good.

-Apply some Blind filters like range, volatility, time, volume etc? The drawback here is that filters limit the #-of-trades. Example: trade in 1-direction at a time or holding on to long trends is filter most people don't realize is acting as a filter. My only fuss with this system is that it's not active enough to turn like $1,000 into happiness within reasonable time to make most people happy. But that could be overcome by adding other stable systems to the account.

-Last but my least favorite option: Change the system a allot more. Example:

a) Scalp on Direction - Drawback we'll need tick data. Can Solid MM principles Work with such add-ons?

b) Pyramid on Direction - add lots as price goes our way - Drawback how do we close them as it goes against us?

c) Dollar cost Averaging -add via Time intervals but before the take profit. Drawback, there no consideration to situational.

d) Grid - Add same size as position goes fixed distance against us - Drawback, leads to up-side down RRR, and MM cannot keep up.

e) Martingale/Progression (ha.ha.ha.ha) on any of the above methods. For someone wanting to built small account into big this could sound attractive. Drawback, definitely cannot follow proper MM.

I'm personally leaning toward calling this for what it is and moving forward with MM.

I'll like to know what others think as others may feel "No-Way, I'll require something Better".

 
ubzen:

For now I can only do back-to-2005 because I'm using Fxdd's data found here. The reason why I'm using this data is because Fxdd closes for the weekend, just like my broker and have the weekend gaps by default. Also, their time settings is closer to my broker's. I may test on the 2000-2005 data from here if I have the time. Their week-open starts on Wednesday and they run 6-days a week.

Tho, the only period I've viewed visually is the Jan-March 2010 period, My best guess is that this system is losing in sequential manner because it's in Tight or Very Volatile Ranges. But that only applies best to 2008, and even if you have limited experience staring at charts, you could guess it may have had something to do with the Global Financial Crisis and the markets may have been moving on Fear more at that time.

So, what to do now?

-Accept results (like having a losing year is OK), Calculate our Kelly and not be greedy?

-Keep moving forward with more Statistical Analysis like Z-Score. But even if I got a confirmation about correlation among losses then what? I may still have to result to other methods like below to filter data.

-Look at this thing in visual mode during the bad periods and try to avoid what's killing it? The drawback is that this can lead to curve fitting ... if too much past knowledge avoiding is use just to make the back-test look good.

-Apply some Blind filters like range, volatility, time, volume etc? The drawback here is that filters limit the #-of-trades. Example: trade in 1-direction at a time or holding on to long trends is filter most people don't realize is acting as a filter. My only fuss with this system is that it's not active enough to turn like $1,000 into happiness within reasonable time to make most people happy. But that could be overcome by adding other stable systems to the account.

-Last but my least favorite option: Change the system a allot more. Example:

a) Scalp on Direction - Drawback we'll need tick data. Can Solid MM principles Work with such add-ons?

b) Pyramid on Direction - add lots as price goes our way - Drawback how do we close them as it goes against us?

c) Dollar cost Averaging -add via Time intervals but before the take profit. Drawback, there no consideration to situational.

d) Grid - Add same size as position goes fixed distance against us - Drawback, leads to up-side down RRR, and MM cannot keep up.

e) Martingale/Progression (ha.ha.ha.ha) on any of the above methods. For someone wanting to built small account into big this could sound attractive. Drawback, definitely cannot follow proper MM.

I'm personally leaning toward calling this for what it is and moving forward with MM.

I'll like to know what others think as others may feel "No-Way, I'll require something Better".


Hi,

Pyramiding on directions seems powerful, this is exactly what my version does. I pyramid with the secondary trades.

Unfortunately MAE shows us that averaging in might not work in this strategy, i say unfortunately because i like that ;)


But another question i have is to phillip.

In your script you are investigating the time between OrderOpen and OrderClose, but as you diagram show's you should also investigate some time before and after open/close in order to get an overview and a right MAE/MFE calculation? Am i on the wrong path?

 
zzuegg:

But another question i have is to phillip.

In your script you are investigating the time between OrderOpen and OrderClose, but as you diagram show's you should also investigate some time before and after open/close in order to get an overview and a right MAE/MFE calculation? Am i on the wrong path?


Correct. On a trade-by-trade basis you should calculate if the time to MAE occurred first or last relative to the time to MFE. Trades that have MAE occur before MFE are called "Type 1". Trades that have MFE occur before MAE are called "Type 2".

An easy metric for expressing your strategy's market forecasting ability is to simply ratio the occurences of Type 1 trades by the total number of trades and multiply by 100%. Say you have 100 trades in one year, 90 of them turn out to be Type 1 trades and 10 of them are Type 2. So your "prediction success rate" is 90/100 x 100% = 90%.

Strategies with a better near-term market prediction rate are more desirable than strategy's which fail to correctly predict the near-term market direction. (for all the obvious reasons)
 

Ok, understood that, but should you also allow TimeToMAE realtive to the opentime to be nagative and positive? Positive tToMAE when you entered the trade to early and negative when you entered to late. Of course averaging the values might result in a perfect strategy so you have also to look at the StdDev of the tToMAE.

From what i see you are not allowing negative tToMAE's.

By in introducing the variables WatchBarsBeforeOpen and WatchBarsAfterClose i think i have overcome this issue. Note that this is still early work in progress. tToMAE and tToMFE are in minutes as precise as the used timeframe allow.

There are no analyses included yet, just raw data

//+------------------------------------------------------------------+
//|                                      AdvancedReport_03_04_11.mq4 |
//|                                                           zzuegg |
//|                                       when-money-makes-money.com |
//+------------------------------------------------------------------+
#property copyright "zzuegg"
#property link      "when-money-makes-money.com"

extern int WatchBarsBeforeOpen=10;
extern int WatchBarsAfterClose=10;
extern int WatchPeriod=0;

int ticket[];
int mae[];
int mae.time[];
int mfe[];
int mfe.time[];
int mfee[];
int profit[];
int missed[];

void reportTrade(int trade){
   OrderSelect(trade,SELECT_BY_TICKET,MODE_HISTORY);
   int start   =(iBarShift(OrderSymbol(),WatchPeriod,OrderOpenTime(),false) +WatchBarsBeforeOpen)+1;
   int end     =iBarShift(OrderSymbol(),WatchPeriod,OrderCloseTime(),false) -WatchBarsAfterClose;
   int highest =iHighest (OrderSymbol(),WatchPeriod,MODE_HIGH,(start-end)+1,end);
   int lowest  =iLowest  (OrderSymbol(),WatchPeriod,MODE_LOW,(start-end)+1,end);
  // Print(OrderTicket()+"  "+start+"  "+end+"  "+highest+"  "+lowest);
   ArrayResize(ticket,ArraySize(ticket)+1);   
   ArrayResize(mae,ArraySize(mae)+1);
   ArrayResize(mae.time,ArraySize(mae.time)+1);
   ArrayResize(mfe,ArraySize(mfe)+1);
   ArrayResize(mfe.time,ArraySize(mfe.time)+1);
   ArrayResize(mfee,ArraySize(mfee)+1);
   ArrayResize(profit,ArraySize(profit)+1);
   ArrayResize(missed,ArraySize(missed)+1);
   
   //Print(TimeMinute(OrderOpenTime())+"  "+TimeMinute(OrderCloseTime())+"  "+TimeMinute(iTime(OrderSymbol(),WatchPeriod,lowest))+"  "+TimeMinute(iTime(OrderSymbol(),WatchPeriod,highest)));
   ticket[ArraySize(ticket)-1]            =OrderTicket();
   switch(OrderType()){
      case OP_BUY:{
         mae[ArraySize(mae)-1]            =(OrderOpenPrice()-iLow(OrderSymbol(),WatchPeriod,lowest))/MarketInfo(OrderSymbol(),MODE_POINT);
         mae.time[ArraySize(mae.time)-1]  =(OrderOpenTime()-iTime(OrderSymbol(),WatchPeriod,lowest))/60;
         mfe[ArraySize(mae)-1]            =(iHigh(OrderSymbol(),WatchPeriod,highest)-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT);
         mfe.time[ArraySize(mae.time)-1]  =(OrderOpenTime()-iTime(OrderSymbol(),WatchPeriod,highest))/60;
         profit[ArraySize(profit)-1]      =(OrderClosePrice()-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT);
         missed[ArraySize(missed)-1]      =(mae[ArraySize(mae)-1]+mfe[ArraySize(mfe)-1])-profit[ArraySize(profit)-1];
         mfee[ArraySize(mfee)-1]          =(mfe[ArraySize(mfe)-1])-profit[ArraySize(profit)-1];
      break;
      }
      case OP_SELL:{
         mae[ArraySize(mae)-1]            =(iHigh(OrderSymbol(),WatchPeriod,highest)-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT);
         mae.time[ArraySize(mae.time)-1]  =(OrderOpenTime()-iTime(OrderSymbol(),WatchPeriod,highest))/60;
         mfe[ArraySize(mae)-1]            =(OrderOpenPrice()-iLow(OrderSymbol(),WatchPeriod,lowest))/MarketInfo(OrderSymbol(),MODE_POINT);
         mfe.time[ArraySize(mae.time)-1]  =(OrderOpenTime()-iTime(OrderSymbol(),WatchPeriod,lowest))/60;
         profit[ArraySize(profit)-1]      =(OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT);
         missed[ArraySize(missed)-1]      =(mae[ArraySize(mae)-1]+mfe[ArraySize(mfe)-1])-profit[ArraySize(profit)-1]; 
         mfee[ArraySize(mfee)-1]          =(mfe[ArraySize(mfe)-1])-profit[ArraySize(profit)-1];      
      break;
      }
   }  
}

void writeCSV(string EA.name,string EA.parameter=""){
   int hnd=FileOpen(EA.name+"-"+EA.parameter+".csv",FILE_CSV | FILE_WRITE,";");
   FileWrite(hnd,"Ticket","MAE","TimeToMAE","MFE","TimeToMFE","MFEE","Profit","Missed");
   for(int i=0;i<ArraySize(mae);i++){
      FileWrite(hnd,ticket[i],mae[i],mae.time[i],mfe[i],mfe.time[i],mfee[i],profit[i],missed[i]);
   }
   FileClose(hnd);
}


void AdvancedReport.doStatistics(string EA.name,string EA.parameters="",int EA.limitMagicNumber=-1){
   for(int i=0;i<OrdersHistoryTotal();i++){
      OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
      if(OrderMagicNumber()==EA.limitMagicNumber || EA.limitMagicNumber==-1){
         reportTrade(OrderTicket());
      }
   }
   
   
   writeCSV(EA.name,EA.parameters);
}
 
ubzen:

Ok, Here's the bad period I was referring to. Now, I'm going to run this backwards, 1 year at a time. 2009,2008 etc.

Here's the yearly results:

2010--Max-DD= 6.47____Rel-DD= 6.47____Net_Profit=4588____Factor=2.48
2009--Max-DD=26.76____Rel-DD=26.76____Net_Profit=-380____Factor=0.94
2008--Max-DD=19.79____Rel-DD=19.79____Net_Profit=1096____Factor=1.20
2007--Max-DD= 7.10____Rel-DD= 7.10____Net_Profit=1506____Factor=1.62
2006--Max-DD=20.46____Rel-DD=20.46____Net_Profit=-1612____Factor=0.63
2005--Max-DD= 8.79____Rel-DD= 8.79____Net_Profit= -23____Factor=0.99

2005----------------

2006-----------------

2007-----------------

2008--------------

2009 ------------------

2010----------------

Couple of observations.

1) System tends to lose in a Row instead of randomly most of the time. Z-Score from the Article might help with this.

This helps underscores the fact why Professional traders look for 20-30% returns per year.



When you have ROI data spanning for months and years then you have the data you need to assess your risk of ruin going forward.

http://www.futuresmag.com/Issues/2009/August2009/Pages/Minimizing-your-risk-of-ruin.aspx

This backtesting data is precisely the data needed to actually compute something from the backtesting results that can be leveraged to indicate future results.

Z-scores are not predictive of future results as they are time-series dependent, the only way a z-score from 2009 is relevant to 2011 is if the market price activity in 2011 is essentially a repeat of 2009.

Z-score is an interesting statistic to assess but it adds no value or insight into how your strategy will perform going forward. There is a reason CTA's, money managers, Morningstar, etc do not track and report on the Z-score for professionally managed accounts. It is a worthless metric of success.

Computing risk of ruin though, and median drawdown, these are things that the pro's do, and not just in the industry of forex.

Also, in terms of brokers...using different broker's for backtesting is kinda like the poor-man's effort to decouple their strategy from that of the underlying time-series. You don't know what the future time-series will look like, but not two broker's past time-series are identical so backtesting across a wide-range of historical datasets from different sources and then analyzing how robust your strategy performs is a good idea as this robustness speaks to how well your strategy could perform on future time-series.

Professionals backtest against varying historical market rates too. In some cases they use Monte Carlo methods to create entirely fictitious market data that is statistically equivalent to actual market-data just to bolster their backtesting.

Just food for thought, you may well be aware of all of this and have your own equally valid reasons for electing to pursue alternative analysis methods.
Reason: