| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Zorro https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=921 |
Page 5 of 12 |
| Author: | jcl [ Tue Feb 05, 2013 9:43 am ] |
| Post subject: | Re: Zorro |
Ok, trailing a basket is quite similar to entering and exiting trades with it. Only difference is that you now need a specific function for trailing. The standard trailing would trail every asset individually, not all together. You can see an example of a specific trailing function in the manual under "Trade Parameters". Your function has to trail using not the asset price but the overall price of the basket, which is calculated as in the code snippet under "Tips&Tricks". |
|
| Author: | falsedave [ Tue Feb 12, 2013 10:27 pm ] |
| Post subject: | Re: Zorro |
Hello again, I'm trying to develop yet another strategy in Zorro. Now I'm probably used to to way Empty4/MT5 backtests thing takes the starting capital and works its way through and displays how much you would have at the end of the test. With Zorro using code to reinvest profit from workshop 6, I end up with a value for capital of many thousands as as it gets further through the test. Would this be the drawdown when get to be using higher lotsizes. ? Is it possible to test in the Empty4 style ? Give the strategy £2000 and see how much it would make ? Also when using WFO Zorro seems to always choose the values with the least trades. I can have 600 trades and 200% proftablity but it will pick the values that only take 10 trades and have about 10% profitablity. If 8/10 trades are profitable rather that 400/600 it does have a better win rate but the profits are a hell of a lot smaller as well. Am I doing something wrong here when it comes to WFO ? |
|
| Author: | jcl [ Wed Feb 13, 2013 12:08 pm ] |
| Post subject: | Re: Zorro |
Yes, you don't need starting capital for testing a strategy performance. Obviously the performance of a strategy should not depend on what you enter as starting capital. It is the whole point of Zorro to do a real test and not a pseudo test Empty4 style. But if you want, you can enter a starting capital with the Balance parameter - you can see the example under "Tips&Tricks". The required capital is calculated from the equity curve, so when reinvesting profits as in workshop 6, the displayed capital is required at the end of the test period, not at the start. The starting capital is the value you got without reinvesting profits. The WFO training process selects the parameter values with the most, not with the least trades. But you can modify that. In the file "default.c" you'll find a function named "objective" that calculates the selection criterion. You can see that more trades are preferred. You can also define your own objective function in your script and thus have different selection criteria. |
|
| Author: | falsedave [ Wed Feb 13, 2013 1:43 pm ] |
| Post subject: | Re: Zorro |
O.k So what I have at the moment is. Code: Select all 90Win compiling................ BackTest: 90Win EUR/USD 2012..2013 Read 90Win_EURUSD.fac Profit 765$ MI 58$ DD 556$ Capital 1478$ Trades 137 Win 38% Avg +69.8p Bars 30 AR 76% PF 1.47 SR 0.96 UI 26.4% Error 48% Would this mean that with £200 the system would fail as the capital result is £1478. Surely the lotsizes couldnt have got that high to get this result. |
|
| Author: | jcl [ Wed Feb 13, 2013 1:59 pm ] |
| Post subject: | Re: Zorro |
No. The required capital is calculated from the equity curve. When you reinvest, drawdown is increased, and so is the required capital. Therefore the $1478 is the capital that you need at the _end_ of the simulation for continuing trading, not at the start. You can calculate the starting capital only from a test run without reinvesting. Also, your initial balance has no effect because you're doing nothing with it. When you want to simulate a Empty4 style test, you need to calculate the margin or lot size from the current balance, just as in the typical Empty4 EAs. This will then make the strategy result dependent on the initial capital. |
|
| Author: | falsedave [ Wed Feb 13, 2013 8:30 pm ] |
| Post subject: | Re: Zorro |
O.k so I changed the code to Code: Select all Code: Select all But if I do the same but only test 2008-2009 I get. Reinvested Code: Select all Am I right in thinking that from £80 reinvested it could have made 6 million in a year ? If that result is true. I'll buy you the sports car of your choice Sorry for all the stupid questions. You've been a great help JCL. |
|
| Author: | jcl [ Thu Feb 14, 2013 10:03 am ] |
| Post subject: | Re: Zorro |
I fear I won't get the sports car at this point, as the result is unrealistic. You must test more than 2 years - I think 4 years is the minimum. It must also be a WFO test, not a mere backtest. A backtest with optimized data is too optimistic due to overfitting bias. You can see that your backtest gets 610% annual profit with no reinvesting - this high percentage is the result of overfitting and of a too short test period. It can not be achieved with the relatively simple algorithms of workshop 6. That's why you need a WFO test here. When you reinvest, the annual gain, the 571%, is also not a useful performance measure as it's calculated from the end capital, not from the start capital. Instead, CAGR or some similar measure must be used for a reinvesting system. Zorro can not calculate the CAGR directly because the start capital must be known for that. Theoretically two tests were required for this, one with and one without reinvesting. This had to be done manually at the moment, it's not implemented yet as an automatic process. That's why the manual states that the values in the performance report are for systems without reinvesting only. |
|
| Author: | magft [ Mon Feb 18, 2013 2:54 pm ] |
| Post subject: | Re: Zorro |
jcl Another question for you, i've been trying to put the ALF Empty4 indicator in Zorro for testing but i cannot get it to work correctly and i think i am missing something very simple but can't spot it! I have attached the mq4 file that i based the code on and the Zorro code is below. Any help would be gladly appreciated. Regards Mike Code: Select all |
|
| Author: | jcl [ Mon Feb 18, 2013 4:20 pm ] |
| Post subject: | Re: Zorro |
Ok, that's the problems that I spot: - Sep 1, 2012 was a weekend. So your simulation contains no bars. - For zooming in a certain period use StartDate and EndDate, not NumBars. NumBars would stop the simulation after the number of bars. For limiting the number of bars in the chart use PlotBars instead. - You tried to convert code from Empty4, but Empty4 does not support series. The "for (i=limit;i>=0;i--)" etc. loop looks like a Empty4 workaround for replacing series. It makes no sense in other platforms. If you have the choice, always use the original code from the author of that system for conversion, not some mq4 version. I believe Laguerre filters have been used by John Ehlers, but John Ehlers would never use Empty4, he has most likely published this indicator for TradeStation. So try to get the TradeStation version of the code. It happens frequently that the mq4 version of indicators from other platforms does not work properly, and converting it would also convert the errors. When developing a complex indicator, split it into parts if possible - in this case, program the Laguerre filter first, and if it works, then add the alfa adaption. I do not really understand in the code how the alfa adation is supposed to work, but the Laguerre filter itself is pretty straightforward: Code: Select all |
|
| Author: | magft [ Mon Feb 18, 2013 7:08 pm ] |
| Post subject: | Re: Zorro |
Thanks for the response, i did get the basic version working like you posted before but was unable to get it working as a separate function that can be called. I found a link for a generic version of the adaptive part to update the alphas here. My current code is still not quite right, any thing obviously wrong Code: Select all Mike |
|
| All times are UTC | Page 5 of 12 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|