GithubHelp home page GithubHelp logo

Comments (4)

EarnForex avatar EarnForex commented on July 18, 2024

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.

from positionsizer.

imphocused avatar imphocused commented on July 18, 2024

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:

Forex:
The margin for the Forex instruments is calculated by the following formula:
Volume in lots * Contract size / Leverage

Forex No Leverage:
This type of calculation is also used for Forex symbols. But unlike the previous one, it does not take into account the trader's leverage:
Volume in lots * Contract size

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

ea-output

from positionsizer.

EarnForex avatar EarnForex commented on July 18, 2024

Hello!

Here is what the MQL5 help file says about SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE:
Screenshot 2022-06-30 154035

And indeed, if you open a trade of 1 lot, then you'll see that it takes 1/10 of margin, which is consistent with 0.1 Margin Rate application.

So, in reality, even though it says "Forex No Leverage", it would be 1:10 real leverage.

from positionsizer.

EarnForex avatar EarnForex commented on July 18, 2024

Doesn't look like a Position Sizer issue at this time.

from positionsizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.