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
Hi,
Stuck into a problem. Using the standard MoneyManagement modules results in OrderCalcMargin always returns true and margin 0.
in AccountInfo it's that call
which with further execution leads to the usage maxvolume of the symbol. 10000000 lots
As OrderCalcMargin is not debugable i really can't figure out what's going wrong.
I typed in some output just to check:
According to the documentation SYMBOL_CALC_MODE_FUTURES requires for calculations
Lots is 1.0, Init Margin is 15000, Margin Rate is 1. How it results in margin 0.0?
Tried on different symbols - current or previous futures - same results.
@bred_bred1: I am having the same problem. I discovered it last night (Jan 15 2024). It only happens when the order is ORDER_TYPE_SELL. If I use ORDER_TYPE_BUY OrderCalcMargin works fine.
Additional Information: the problem shows in Demo Version build 4131 (Jan/15), but not in Demo Version Build 4127 (Jan/12).
What values are printed to the log when using a live chart instead of the Strategy Tester?
Absolutely same results.
Well, it looks like it's a problem with a terminal distrib provided by Metaquotes to my broker. I'm as a last resort installed default distrib on a virtual machine and OrderCalcMargin works as intended, the broker's one does not. Later found out - at least one colleuge experience the same thing with broker distrib and what's especially interesting the bug is absent in one of the middle builds. So it's a drifting issue. Try to inverstigate further.
I remember reading one of your posts where you write about your setup with a portable build and somehow you add the brokers stuff over it - just to be sure the cases like that do not happen. Any links on the detailed "what-where" explanation? Forum thread/Docs?
Thank you for your time Fernando! Appreciate it!
Which server is providing these symbols ?
Looks like a broker distrib drifting issue. Some middle builds are ok, some have issue.
@bred_bred1: I am having the same problem. I discovered it last night (Jan 15 2024). It only happens when the order is ORDER_TYPE_SELL. If I use ORDER_TYPE_BUY OrderCalcMargin works fine.
Additional Information: the problem shows in Demo Version build 4131 (Jan/15), but not in Demo Version Build 4127 (Jan/12).
Well, in my case the issue is with both Buy and Sell. And in the very latest from January 16th it persists and in 4040 too .
But I was told that in 4073 there're no issues. Btw what country is your broker distrib or it's a default one?
Well, in my case the issue is with both Buy and Sell. And in the very latest from January 16th it persists and in 4040 too .
But I was told that in 4073 there're no issues. Btw what country is your broker distrib or it's a default one?
the default in the demo account of metaquotes gives me the error. The FTMO broker does not.
the default in the demo account of metaquotes gives me the error. The FTMO broker does not.
Update: I just downloaded the version build 4137 (jam 18)... still having the same problem. My SELL orders give me zero margin required when calling OrderCalcMargin. The BUY orders don't have that problem.
Can you make short sell orders manually through GUI? I suspect that short-selling may be disabled for that symbol.
Please check the symbol specifications dialog:
If you were a little less arrogant little more logically developed you'd understand that all requested variables are outputed for the sake of conviniecy of provided information related to the question and not for my personal testing purposes. But thanks for the tip. Anything useful to say on the actual question?