Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, dr_panther, TedMar), 872 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Strategy decline after update to Zorro 1.51 [Re: Finstratech] #462987
11/09/16 20:46
11/09/16 20:46
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
Now I have the feeling that for one of my (relatively) high-frequency strategies the backtest produces much better results than in the previous version of Zorro. Even with the EXTRADATA flag set. For example Sharpe Ratio has almost doubled in one year compared with the old results I saved while the volume and transaction costs remained almost the same.

Unfortunately I don't have the old version anymore. Can anyone please share an old version of Zorro (1.4X) so I can find out if there's really a difference or whether it was my fault? Or is there an official place to download previous releases?

Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463000
11/10/16 12:03
11/10/16 12:03
Joined: Apr 2016
Posts: 27
Frankfurt, Germany
M
MIGI Offline
Newbie
MIGI  Offline
Newbie
M

Joined: Apr 2016
Posts: 27
Frankfurt, Germany

Re: Strategy decline after update to Zorro 1.51 [Re: MIGI] #463008
11/10/16 14:07
11/10/16 14:07
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
Thank you very much, MIGI.

It seems that there is a big difference between the versions indeed. This is a backtest of the strategy for 2014. Same code, same data (FXCM .bar files), same asset configuration, very different results. There is no training involved and it's very simple mean reversion strategy based on one indicator with no parameters. Before I investigate further - any ideas why is this happening?



Code:
Test IsIbs EUR/USD

Simulated account   AssetsFix 
Bar period          1 hour (avg 86 min)
Test period         07.01.2014-31.12.2014 (5963 bars)
Lookback period     80 bars (3 days)
Monte Carlo cycles  200
Simulation mode     Realistic ticks (slippage 5.0 sec)
Avg ticks per bar   61.3
Spread              0.5 pips (roll -0.42/0.06)
Contracts per lot   100000.0

Gross win/loss      97530$ / -78307$ (+1922p)
Average profit      19605$/year, 1634$/month, 75$/day
Max drawdown        -5875$ 31% (MAE -5875$ 31%)
Total down time     92% (TAE 94%)
Max down time       26 days from Feb 2014
Max open margin     2236$
Max open risk       1400$
Trade volume        173272874$ (176720192$/year)
Transaction costs   -6525$ spr, 8668$ slp, -116$ rol
Capital required    12512$

Number of trades    1305 (1331/year, 26/week, 6/day)
Percent winning     65.8%
Max win/loss        1030$ / -1962$
Avg trade profit    15$ 1.5p (+11.4p / -17.6p)
Avg trade slippage  6.64$ 0.7p (+1.4p / -0.7p)
Avg trade bars      3 (+2 / -5)
Max trade bars      35 (35 hours)
Time in market      83%
Max open trades     1
Max loss streak     5 (uncorrelated 7)

Annual return       157%
Profit factor       1.25 (PRR 1.15)
Sharpe ratio        2.48
Kelly criterion     3.92
R2 coefficient      0.873
Ulcer index         9.0%



Code:
Test IsIbs EUR/USD

Simulated account   AssetsFix 
Bar period          1 hour (avg 86 min)
Test period         07.01.2014-31.12.2014 (5963 bars)
Lookback period     80 bars (3 days)
Monte Carlo cycles  200
Assumed slippage    10.0 sec
Avg ticks per bar   61.3
Spread              0.5 pips (roll -0.42/0.06)
Contracts per lot   100000.0

Gross win/loss      94183$ / -81382$ (+1280p)
Average profit      13056$/year, 1088$/month, 50$/day
Max drawdown        -6644$ 52% (MAE -6639$ 52%)
Total down time     96% (TAE 95%)
Max down time       7 weeks from Oct 2014
Max open margin     2236$
Max open risk       1400$
Trade volume        173272829$ (176720146$/year)
Transaction costs   -6525$ spr, 2238$ slp, -116$ rol
Capital required    13858$

Number of trades    1305 (1331/year, 26/week, 6/day)
Percent winning     64.4%
Max win/loss        1041$ / -1984$
Avg trade profit    9.81$ 1.0p (+11.2p / -17.5p)
Avg trade slippage  1.71$ 0.2p (+0.4p / -0.2p)
Avg trade bars      3 (+2 / -5)
Max trade bars      35 (35 hours)
Time in market      83%
Max open trades     1
Max loss streak     8 (uncorrelated 7)

Annual return       94%
Profit factor       1.16 (PRR 1.07)
Sharpe ratio        1.64
Kelly criterion     2.85
R2 coefficient      0.705
Ulcer index         16.4%
Prediction error    122%


Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463009
11/10/16 15:19
11/10/16 15:19
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
How funny! In the thread I already mentioned before I began my posting with 'different results in different versions'. The last one was caused by the EXTRADATA flag but the cause in prior versions I don't know. You can find my post and jcl's answers here: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=461906#Post461906.

Re: Strategy decline after update to Zorro 1.51 [Re: Sphin] #463017
11/10/16 17:04
11/10/16 17:04
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
OK, lets go deeper laugh

I exported all the prices and indicator values into .csv files and compared them. They are all the same. The trade entry and exit times match exactly and rollover as well. So the only difference are entry and exit prices and the corresponding profit.

Example trade from the trade log (the second number is from the newer Zorro version):
Code:
Open 2014-01-08 14:00 @ 1.3595 and @ 1.3596
Close 2014-01-08 16:00 @ 1.3601 and @ 1.3600
Profit: -55.72 and -37.66



Exported prices (OHLC):
Code:
2014-01-08 13:00, 1.35843, 1.35950, 1.35827, 1.35903
2014-01-08 14:00, 1.35903, 1.35989, 1.35685, 1.35955
2014-01-08 15:00, 1.35955, 1.36093, 1.35907, 1.36023
2014-01-08 16:00, 1.36023, 1.36194, 1.36003, 1.36012
2014-01-08 17:00, 1.36012, 1.36056, 1.35858, 1.35873



Why is there the big difference in profit? And why are entry and exit prices rounded differently in each version? Why is there any rounding at all? Wouldn't it be better for everyone if the logs contained prices with maximum possible precision?

Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463020
11/10/16 17:29
11/10/16 17:29
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
I think it has something to do with slippage. With the new Zorro there's 5 seconds default slippage. It's funny actually, because with increasing slippage the profit always increases:
Code:
slippage=0: AR 73%, SR 1.35
slippage=1: AR 89%, SR 1.57
slippage=2: AR 107%, SR 1.80
slippage=3: AR 125%, SR 2.02
slippage=4: AR 141%, SR 2.25
slippage=5: AR 157%, SR 2.48
slippage=6: AR 163%, SR 2.70
...
slippage=2000: AR 2504%, SR 15.78


Wish it worked that way:) But even with slippage=0 the results don't match the results from the old Zorro version so I guess there has to be another difference.

Btw. this should be fixed as soon as possible, the backtests with slippage are useless and people can lose money because of it. It's especially unfortunate because of the default settings (5 second slippage) so maybe an email to all current users should be considered.

Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463021
11/10/16 17:36
11/10/16 17:36
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
So the new version with Slippage set to 0 matches the old version with Slippage set to 0 (maybe there was also default slippage > 0 in the old version?). Here are the values I get with Zorro 1.44:
Code:
slippage=0: AR 73%, SR 1.35
slippage=1: AR 75%, SR 1.37
slippage=2: AR 77%, SR 1.40
slippage=3: AR 79%, SR 1.43
slippage=4: AR 81%, SR 1.46
slippage=5: AR 83%, SR 1.49
slippage=6: AR 85%, SR 1.52
...
slippage=2000: AR 2663%, SR 15.91


Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463022
11/10/16 18:15
11/10/16 18:15
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
Another note - maybe it has to do something with the fact that the strategy is mean reverting. When testing different strategy (Intraday Seasonality) it works more like one would expect.

Re: Strategy decline after update to Zorro 1.51 [Re: pcz] #463023
11/10/16 19:49
11/10/16 19:49
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Referring slippage I just saw the actual last point on the bug list:

> Slippage simulation was not 100% neutral in some cases, but affected by the price slope inside the current bar (fixed in V 1.52.0).

But the 1.52.0 ist not yet available, it's the 1.51.9 as beta on download page.

Last edited by Sphin; 11/10/16 19:58. Reason: 1.52 availability
Re: Strategy decline after update to Zorro 1.51 [Re: Sphin] #463033
11/11/16 13:13
11/11/16 13:13
Joined: May 2016
Posts: 180
Prague
pcz Offline
Member
pcz  Offline
Member

Joined: May 2016
Posts: 180
Prague
Originally Posted By: Sphin
Referring slippage I just saw the actual last point on the bug list:

> Slippage simulation was not 100% neutral in some cases, but affected by the price slope inside the current bar (fixed in V 1.52.0).

But the 1.52.0 ist not yet available, it's the 1.51.9 as beta on download page.


I've just tried it - the problem is not fixed in the beta version.

Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1