After some effort and computing resources, I have an example which uses History of USDCAD, GBPUSD, and USDCHF from the official Downloads section. However, you must use my AssetsFix.dta file. (attached.) Max trade bars is 44, which is too much, considering there are 3 assets, 2 TradesPerBar, and ExitTime is 2. Below I demonstrate that the test.log shows positions are held too long.
Code:
Avg trade bars 5 (+5 / -4)
Max trade bars 38 (27 days)
Time in market 1490%
Max open trades 44
There was an opportunity to exit the position in bar 998, or earlier.
Code:
$ grep -n -A10 '^\[998' Log/worsttest.log
2053:[998: Wed 26.03. 00:00] 2: 470649p 188/162
2054-{GBP/USD::l9876} Long 109@1.6533 Risk 2883$ tl at 00:00
2055-[GBP/USD::L9877] Long 109@1.6533 Net trade at 00:00
2056-{USD/CHF::l9878} Long 125@0.8833 Risk 2401$ tl at 00:00
2057-[USD/CHF::L9879] Long 125@0.8833 Net trade at 00:00
2058-{GBP/USD::l7862} Sell 109@1.6533: -988$ at 12:00
2059-[GBP/USD::L8611] Sell 109@1.6533: -1107$ at 12:00
2060-{USD/CAD::l8612} Sell 54@1.1166: +569$ at 12:00
2061-[USD/CAD::S9980] Short 54@1.1166 Net trade at 12:00
2062-
2063-[999: Wed 26.03. 12:00] 2: 459578p 196/157
Re: ExitTime not respected
[Re: GPEngine]
#441665 05/30/1411:0405/30/1411:04
Thanks!! I can finally reproduce the problem here with these asset settings.
The Max open trades and Max trade bars are probably correct. After all, they are from net trades which have no fixed exit time. Not correct are phantom trades in the log that stay open over more than 2 bars. This is in my opinion a bug, possibly the same virtual hedging bug that's listed under "What's New" in the bug list. I'll forward this to the developers.
If you want, I can send you an interim version where this is fixed when I get confirmation that it is the same bug.
Re: ExitTime not respected
[Re: jcl]
#441671 05/30/1414:1305/30/1414:13
Can please you nail down the correctness of the metrics? I would really like to undestand whether I can expect Max open trades, Avg trade bars, and Time in market, and especially Capital Required to behave as described in 2.4 of Jaekle/Tomasini, regardless of Hedge setting.
If getting these numbers to be useful is not a possible for certain Hedge modes, then you should remove them from Performance Report so the user does not get a false sense.
But, remember, I noticed the odd Max open trades value first before cracking open the raw, 64,000-line test.log. If it wasn't for the funny metrics, I might have deployed a system like this in Trade mode without noticing the error.
Please add sanity checks?
Yes, please connect me with the release candidate.
Last edited by GPEngine; 05/30/1414:31.
Re: ExitTime not respected
[Re: GPEngine]
#441675 05/30/1415:0505/30/1415:05
It is principially not possible to guarantee that a software is bug free. In the case of Zorro, we find on average 3-4 bugs per release period. But I think we can safely assume that the numbers in the performance report are correct. If there were a problem, someone had certainly reported it meanwhile.
In this case we had the lucky coincidence that the numbers appeared wrong and thus made you look into the log - which revealed a real bug. BTW, I got confirmation that it was indeed the virtual hedging bug.
I'll upload an interim version next week. Inbetween you can just continue developing without virtual hedging. It has no effect on the basic system algorithm.
Re: ExitTime not respected
[Re: jcl]
#441676 05/30/1415:0805/30/1415:08