
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I read the "Azbuka..." article and your explanations on the russian forum ('AccountStopout.. : опубликуйте пожалуста более подробную документацию'), thank you - these were actually quite useful and now I understand some thinsg which were not completely clear.
However.
I still say that THERE IS A BUG in these functions:
AccountFreeMargin, AccountFreeMarginCheck and MarketInfo(Symbol(), MODE_MARGINREQUIRED)
They don't work properly in the Tester - they use current prices (i.e. variables Ask and Bid) in the Tester instead of using historical prices!
Please look at this screen shot:
The same expert was run in the Tester and on a Demo account. The expert uses your MarginCalculate function, Rosh, from the Azbuka article ('Азбука торговли валютами'). In theory MarginCalculate should return the same value as MarketInfo(Symbol(), MODE_MARGINREQUIRED).
However it DOES NOT! In the Tester the values are different and you can easily see that MarketInfo used the current Ask price when running in the Tester. When dragging the expert onto a real-time chart the expert displays the same results for both methods which is correct.
If you still insist there is no bug, then please explain these differences.
This is the expert: