I have been trying very hard to *not* change major sections of code, to keep it running as originally intended. The addition of comments with version numbers was a community suggestion I heartily endorsed for many reasons. I do spraypaint my name in comments, as well as the contributor. If anyone notices a problem in the code, they know who to blame (so far that is me).
Cockeyedcowboy, I would love it if you joined us in the appropriate thread (developer/suggestion), and contributed detailed comments or code.
Settings for GBPUSD
I seem to be turning in circles with optimization. Maybe I'm missing something.
1. With tick data downloaded from GainCapital and using 5.7.0 optimized over the past 2 months on GBPUSD, I have very promising results in all 3 modes. A friend of mine started using the mode 3 settings I found on Mode 3 and lost money on many consecutive trades.
2. If I run the same settings on timeframe data from Alpari the results are negative for both M1 and M15.
3. I optimized Mode 1 on Alpari timeframe data at M15, according to instructions with excellent results. On M1 data the same settings yield disastrous results.
Can someone put me straight on backtesting optimization for GBPUSD? What settings should be used to start optimization? What data should be used? What timeframe?
I think we are all working together better and better.
Stealth mode trading requires a different way to store the expected TP/SL levels than posted trades. There are some different ways of doing this and some get very ugly. Whatever the method is, all of the systems that affect trades would need to be updated and rewritten to interface the tracking system instead of the trade window. This either means A) almost a complete rewrite to stealth only or B) a huge amount of code duplication based on a settings check.
Changes like this are better when the design allows for them. Phoenix 6 is going to have a much more flexible design and hopefully we can keep using it simple.
The first recommendation is the most straightforward. Use the data from your broker (GAIN, Alpairi, FXDD, NF, etc) for your optimization. Optimize the signal enough, and any timeframe will work but the default settings are set for a timeframe of M15.
When you want to optimize signal, I recommend mode1, signal_count between 5-30 and maxtrades=5-20. Turn off moneymanagement. This way you are only optimizing your signals. Significant changes TP and SL should be done here.
Once the signal is optimized for your currency, choose a mode to trade in, turn on MM, and fine tune your TP and SL if you like. (Adjusting Mode3 T1adj T2adj T3adj is modifying both money management and TP but not SL.) You can skip this optimization but if you can turn a loosing signal into a winning system all you have done is curve fit your money management to your wins. Adjusting TP/SL levels slightly and getting much better performance is also a form of curve fitting money management. I don't consider changing T1adj T2adj T3adj a form of curve fitting, but I could easily be wrong too.
I personally approach indicator tuning and profit tuning as two separate steps, and valid profit tuning should not turn loosers into winners.
I personally like to backtest a chunk of data minus the most recent data. The most recent data (a week or two) I deal with separately and apply my backtested optimizations against. Sometimes trading the "next week" performs well for an EA and sometimes the results are really awful. This is my clue that I might have come up with 'optimized settings' or 'optimized results'.
Keep in mind that Phoenix Contest, 4 and 5:
Is a counter trend system.
Is unaware of S&R
Is unaware of trends
Will sometimes fight strong trends - turn it off during these periods if it keeps loosing.
Phoenix 6 will hopefully handle some of these issues gracefully without loosing profitability. Phoenix Contest, 4 and 5 have worked well for months, but there are times (like Monday) when a strong trend kicks it for a day or two. A long trend (like June) would be very hard on current versions of Phoenix.
At the end here, I'd like to paraphrase Hendrick from his interview: It is mostly instinct.
Settings for Optimization
Much obliged Daraknor, I'll try to implement the plan you sketched here.
One question remains, however. When you work on signalcount and maxtrades settings, do you also work on the signals themselves? Or are the actual settings for the 4 signals optimized in a different stage?
Also, as a point of departure should one start with the mode and signal settings that were published for the contest?
Thanks again for all your help.
I don't optimize maxtrades, I just give it a big value so I can test hundreds of entry signals instead of 4-6 entry signals. If I get too many bad trades, I turn up signal count in blocks of 5 to see if that helps. Setting these numbers manually is useful for checking the signals better. The whole point of the higher signal count and max trades is to optimize signals. (I don't know if I would have the stomach for 10 countertrend trades at once.)
We haven't found amazing new settings yet for the current currencies. A monthly tune up may help in the future but so far Phoenix is more trend averse than settings dependent. If making new settings for a new currency, I would start with settings for a similar currency, similar market volatility and price. Highly corresponding currencies may benefit from similar settings. The best (so far) settings for EURUSD were really weird compared to the others.
Optimization for dummies
Thanks Daraknor, I think I'm getting the gist of it. But just for the record, would it be at all possible to write up step-by-step procedures for optimization?
I did quick runs first with maxtrades and signal count, and then TP and SL, and finally SL and TP with MM on and maxtrades constant. This resulted in the following for a the last 3 months of M15 data on GBPUSD:
Net 2632.41 on 110 trades
4.00 23.93 398.42 3.40% drawdown
signal_count=5 TakeProfit=85 StopLoss=79 MaxTrades=9 PhoenixMode=1 Lots=0.1 MaximumRisk=0.05 DecreaseFactor=1 PeriodGraceHours=0 PeriodForceHours=0 BreakEvenAfterPips=28 TrailingStop=0 Mode2_OpenTrade_2=37 Mode2_TakeProfit=111 Mode2_StopLoss=38 Mode3_CloseTrade2_3=38 Mode3_TakeProfit=42 Mode3_StopLoss=59 T1adj=1.5 T2adj=1.3 T3adj=0.3 Percent=0.0023 EnvelopePeriod=6 SMAPeriod=3 SMA2Bars=14 OSMAFast=23 OSMASlow=17 OSMASignal=15 Fast_Period=25 Fast_Price=1 Slow_Period=37 Slow_Price=1 DVBuySell=0.00042 DVStayOut=0.05
Is this a valid result, and should I go on to fine tune the signals from here?
Sorry for all the questions, but I would like to make sure that I'm on the right track, and others can certainly also benefit from a clear exposition of the art of optimization.
Certainly, I'm not sure these steps are going to work better - this is just my gut feeling and little pieces of knowledge I picked up along the way tuning other EA.
Please keep in mind that I think MaxTrades is only tested with Mode1, I haven't tried Mode3 with MaxTrades set.
Did you leave last week out of the optimization testing? If so, running GBPUSD against the last week and comparing the results vs published forward testing here should tell you if it is valid.