-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid leverage/margin calculation #44
Comments
Hello imphocused! The problem here is that the symbol's calculation mode is reported as SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE, while in reality it looks more like SYMBOL_CALC_MODE_CFD is used. In SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE, margin is calculated as Lots * Contract_Size * Margin_Rate. The price of the symbol isn't taken into account or is taken care of by the Margin_Rate (reported by the broker's server). In SYMBOL_CALC_MODE_CFD, margin is calculated as Lots * ContractSize * MarketPrice * Margin_Rate. This would yield a correct result here. So, the broker should either fix the reported SYMBOL_TRADE_CALC_MODE or Margin_Rate on its server. |
Hello, Thank you for taking a look. I appreciate the feedback. I've relayed this to the broker support team, and even with screenshots there is some confusion on what I was talking about, so they may not be able/willing to resolve. In any case, to help me better understand, I may be confused about the specification calculation. You mentioned: "In SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE, margin is calculated as Lots * Contract_Size * Margin_Rate. The price of the symbol isn't taken into account or is taken care of by the Margin_Rate (reported by the broker's server)." On the MT5 page:
If the script is detecting the symbol as 'No Leverage', then by default shouldn't the leverage be displayed as (1:1), instead of (1:<current ask price>)? In the original screenshot, the ask price of BTC at the time was 21362.300 |
Doesn't look like a Position Sizer issue at this time. |
Is it possible to adjust how the leverage is calculated? On this broker (Dominion Markets, MT5) the calculations for crypto are off.
The text was updated successfully, but these errors were encountered: