Incorrect MarketInfo in BackTesting

Report any bugs with the Tickstory Lite software here. Please give as much detail as possible so the issue can be identified and resolved as soon as possible.
Post Reply
Parkzo
Posts: 18
Joined: Mon Jun 29, 2015 12:16 pm

Incorrect MarketInfo in BackTesting

Post by Parkzo »

Hello,

I'm having trouble pulling MarketInfo data when using tickstory for backtesting. I'm trying to use the MarketInfo(Symbol(),MODE_TICKVALUE) to calculate risk based position sizes.

However the tick value just is always just returned as "1.0" which I think is set in the "export to MT4" options window when outputting the data. I want metatrader to pull this value from the brokers server so I can calculate position sizes correctly. The strange thing is that in the results the correct tick value is used to calculate profit and loss on each trade. It just doesn't show correctly if I try to reference and print it with MarketInfo(Symbol(),MODE_TICKVALUE).

Is this how it is supposed to work? Is there a way to get MarketInfo to pull the same data being used calculate the profit/losses?

As an example...

I am running a backtest on GBPNZD. I exported to MT4 using a tickvalue of 1.0. If I run "Print("MarketInfo(Symbol(),MODE_TICKVALUE))" in strategy tester it returns the value of "1.0".

If I run a script with the "Print("MarketInfo(Symbol(),MODE_TICKVALUE))" on a live chart in the terminal it returns "0.68955".

I run my strategy test and look at the number of pips, and the value of profit in the results window. If I back calculate the tick value used to calculate the profit it works out at 0.68982. This actually changes over time, so if I calculate on trades at different times in the history it's different as the exchange rates change.

I could set the value myself when exporting the data, but I want to ensure I am using the same value as the profit/loss calculator is, which appears to change over time.
tickstory
Posts: 5289
Joined: Sun Jan 06, 2013 12:27 am

Re: Incorrect MarketInfo in BackTesting

Post by tickstory »

Hi Parkzo,

Because Tickstory is effectively creating the back-testing database instead of MT4, you will need to ensure you put in the correct MT4 settings that are usually taken from the broker by MT4.
The most reliable way of getting the MT4 Settings from your broker is by using the method described in this thread:

viewtopic.php?f=2&t=809

You can of course use the TickstoryExpert to also get the required MT4 settings for your broker, however some information such as commissions are not available via MQL which means TickstoryExpert cannot determine them. By using the above method, you will have all required information since it is MT4 that is producing the file.

In the event any information changes, all you need to do is cross-check the information as described above before exporting (or use the FXT editor to check that the MT4 information matches).

Hope this helps.
Post Reply