@saratradeco, contact your broker-dealer to find out whether margin specifications are fully supported in their demo accounts.
@saratradeco Could you share the code that reads the margin rates and calls OrderCalcMargin(), plus your terminal and tester agent build numbers?
Since you’ve already checked the result before formatting, the next useful comparison would be 0.01, 0.10 and 1.00 lots, where those volumes are valid for the symbol. Keep the symbol, order type and price unchanged. For each calculation, log the return value, margin and initial margin rate at full precision, and check that SymbolInfoMarginRate() succeeds. No orders need to be sent.
This would show whether only small volumes return zero. It wouldn’t prove rounding, and the documentation doesn’t specify an internal rounding rule, so the cause is still open.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am investigating a recorded margin-calculation observation in the MetaTrader 5 Strategy Tester.
The native OrderCalcMargin() function returned TRUE, but the required margin was exactly 0.0, with an immediate GetLastError() value of 0.
Recorded environment and inputs
Using the published CFD margin formula, these recorded inputs produce an arithmetic estimate of approximately 0.00408169 USD. This is not being substituted for the native result.
The diagnostic records the margin result before formatting. No trading order was submitted. The risk engine rejected the non-positive native required margin.
Technical questions
Does OrderCalcMargin() internally round small margin amounts to zero based on currency precision in the Strategy Tester?
If so, what documented precision or rounding rule applies?
If not, could this result be caused by symbol margin configuration or a Strategy Tester calculation issue?
What additional diagnostic evidence would be required to distinguish these possibilities?
Available evidence
File: SEQ027_CLEAN_MARGIN_READER_20261008_000000_40.csv
SHA256:
9AEB99D44FEACA4B82DCF69DC811DBFC7B16D7E394E8E39969969A69443CE73D
CSV line 41 corresponds to Journal line 71.
Thank you.