Roman Starinskij:
Who knows how to fix it? Here is a screenshot of the error and part of the code
The check is simply not done. The function is called and that’s it. Everything is described in the documentation and there is an example of using it.
AccountFreeMarginCheck
Returns the amount of free funds
that will remain after opening the specified order at the current price on the current
account.
double AccountFreeMarginCheck( string symbol, / / symbol int cmd, // trading operation double volume / / number of lots ); |
nume
It’s not just those who can’t pass the test because of inattention who complain. Also complain about those who made the code 2 weeks ago, it passed the test, since then really little has changed, but the new version can no longer pass the test. And all changes in the new version concern 2 lines and do not concern the definition of the volume!! Since yesterday I see the error no trading operations, maybe holidays, and the check is still disabled?!
vitales
AccountFreeMarginCheck returns a double instead of a Boolean value. You use the result of the function in the if statement. For any value of the AccountFreeMarginCheck function other than zero, the result of implicit type conversion will be true.
It is more correct to write:
if ((AccountFreeMarginCheck(Symbol(), OP_BUY, lot)>0) && GetLastError() != 134)
….
Now it is clear why many people complain about the service market.
evillive
The code has not become better, still the function is only called, and nothing is done with the result of the call. At least compare the return value with some amount, chtoli…