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.
Issue with leverage
Re: Issue with leverage
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.
Re: Issue with leverage
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.
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.
Re: Issue with leverage
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 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.
Re: Issue with leverage
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.
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.
Re: Issue with leverage
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 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.
Re: Issue with leverage
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.
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.
Re: Issue with leverage
No, I am not, as the EUR price constantly changes throughout the backtest period.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.
Re: Issue with leverage
Please see http://tickstory.com/forum/viewtopic.php?f=2&t=641 for a possible solution to this.