Issue with leverage

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
render86
Posts: 52
Joined: Wed Jun 19, 2013 4:51 pm

Issue with leverage

Post by render86 »

When I export the data to MT4, I specify 200 for the leverage. Yet when I then run a backtest on this data, I always get the leverage of 1:100 instead of the specified 1:200. Why?

P.S. My broker's default leverage is 1:500.

render86
Posts: 52
Joined: Wed Jun 19, 2013 4:51 pm

Re: Issue with leverage

Post by render86 »

Here's more info on the problem: with Tickstory, MetaTrader4 gives incorrect margin. E.g. instead of 128000 in April 2013 for EURUSD (when the EURUSD price was around 1.28), the margin is 100000. This distorts the lot size of the EAs tested.

tickstory
Posts: 4900
Joined: Sun Jan 06, 2013 12:27 am

Re: Issue with leverage

Post by tickstory »

Hi render86,

We were unable to reproduce any issue with leverage using the following steps:

1) Select 'Export to MT4' on EURUSD.
2) In the Mt4 Export window, select Metatrader Info tab and specify the Account Leverage to be 200.
3) Press OK and wait for it to complete.
4) Launch Metatrader by pressing F8 in Tickstory.
5) Run MACD Sample with the following line of code inserted into the start() function:

Print("Acc lev: " + DoubleToStr(AccountLeverage(), 5));

6) Account leverage correctly reports that leverage is 200.

Hope this helps.

render86
Posts: 52
Joined: Wed Jun 19, 2013 4:51 pm

Re: Issue with leverage

Post by render86 »

tickstory wrote:Hi render86,

We were unable to reproduce any issue with leverage using the following steps:

1) Select 'Export to MT4' on EURUSD.
2) In the Mt4 Export window, select Metatrader Info tab and specify the Account Leverage to be 200.
3) Press OK and wait for it to complete.
4) Launch Metatrader by pressing F8 in Tickstory.
5) Run MACD Sample with the following line of code inserted into the start() function:

Print("Acc lev: " + DoubleToStr(AccountLeverage(), 5));

6) Account leverage correctly reports that leverage is 200.

Hope this helps.
Kindly refer to the clarification in my second post. I don't mean the Leverage but MarginRequired which is given incorrectly in USD as base currency.

tickstory
Posts: 4900
Joined: Sun Jan 06, 2013 12:27 am

Re: Issue with leverage

Post by tickstory »

Hi Render86,

Could you provide the parameters/code that demonstrates which exported values do not match up with what you expect? The only control the export has is the specific values embedded in the FXT file as shown int he 'MT4 Info' tab - after that, you will need to consult the MQL manual for how to perform your lot calculation.

Thanks.

render86
Posts: 52
Joined: Wed Jun 19, 2013 4:51 pm

Re: Issue with leverage

Post by render86 »

tickstory wrote:Hi Render86,

Could you provide the parameters/code that demonstrates which exported values do not match up with what you expect? The only control the export has is the specific values embedded in the FXT file as shown int he 'MT4 Info' tab - after that, you will need to consult the MQL manual for how to perform your lot calculation.

Thanks.
The MT4 tester, following the hack by your program, issues a wrong number in response to the query MarketInfo(EURUSD, MODE_MARGINREQUIRED)). For EURUSD, the lot price (100000 EUR) should depend on the Euro's current price (136000 as of now) while with Tickstory, MT4 issues 100000.

tickstory
Posts: 4900
Joined: Sun Jan 06, 2013 12:27 am

Re: Issue with leverage

Post by tickstory »

Hi Render,

Are you able to manually edit this value? We will add an item to automatically calculate this in the future, however for the moment it is user-specified.

Thanks.

render86
Posts: 52
Joined: Wed Jun 19, 2013 4:51 pm

Re: Issue with leverage

Post by render86 »

tickstory wrote:Hi Render,

Are you able to manually edit this value? We will add an item to automatically calculate this in the future, however for the moment it is user-specified.

Thanks.
No, I am not, as the EUR price constantly changes throughout the backtest period.

tickstory
Posts: 4900
Joined: Sun Jan 06, 2013 12:27 am

Re: Issue with leverage

Post by tickstory »

Please see http://tickstory.com/forum/viewtopic.php?f=2&t=641 for a possible solution to this.

Post Reply