Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, AndrewAMD), 706 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Backtest realism and asset parameters #470656
01/29/18 03:11
01/29/18 03:11
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Hello,

I’d like to discuss how the asset parameters like Spread, Rollover and PIPCost affect the backtest results and how to make the results close to the live trading results. Below are my thoughts. You are encouraged to add your ideas and share your experience!

1. PIPCost
Manual says that this value should normally remain constant during the simulation for not adding artifacts to the result. If desired for special purposes, it can be calculated by script to fluctuate with the exchange rate.

I wonder what artifacts are meant and in what cases it’s better to calculate PIPCost in a script?


2. RollLong / RollShort
I believe that the ideal case is to use historical rollover costs but it’s not always possible to get this data. In this case, we assume that the rollover is a constant value and enter it into an asset list. However, Rollover costs depend on a number of variables. These variables could change dramatically throughout a backtest and can falsify backtest results, especially when it’s a long-term strategy and trades are open for a long period of time. It’s recommended to measure performance results in the worst cases to understand what to expect during the live trading.
In case of Forex, rollover costs are roughly proportional to the interest rate differential and depend on exchange rates (or PIPCost). In order to avoid false positives manual suggests to set RollShort and RollLong to their minimum (RollLong = RollShort = min(RollLong,RollShort).
In case of the stock market, rollover depends on a current asset price, an interest rate and leverage (IR / 360 * price * (1 - 1/leverage). Therefore using the highest interest rate and the current asset price (there is an assumption that the market goes up and the current price is higher then previous prices) should be relatively safe.

From your experience in what cases it’s save to use constant Rollover costs (current values) and in what cases they affect the results a lot? If current rollover values are not an option what is the best substitute?


3. Spread
As with the rollover, the best case is to use a historical spread for backtesting. However, sometimes this data is unavailable or the spread doesn’t change much. So, we have to we assume that the spread is a constant. This constant can be the current spread but maybe it’s not the best spread representation for a several years backtest. I believe, it’s better to use an average spread (or an average spread * k, where k=1,2, etc.; average spread data can be retrieved from https://www.myfxbook.com/forex-broker-spreads, for example). Manual also suggests to set Spread to a high percentile of a one-day sample to be on the safe side.

I wonder what the best option is and pros and cons depending on the situation?

Please feel free to comment.

Re: Backtest realism and asset parameters [Re: kujo] #470696
01/30/18 21:26
01/30/18 21:26
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
Jcl, could you please comment on this statement from the manual?

Originally Posted By: kujo

1. PIPCost
Manual says that this value should normally remain constant during the simulation for not adding artifacts to the result. If desired for special purposes, it can be calculated by script to fluctuate with the exchange rate.

I wonder what artifacts are meant and in what cases it’s better to calculate PIPCost in a script?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1