Account.Margin vs. Calculated Margin - Mismatch

Created at 03 Dec 2021, 14:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
NC

ncel01

Joined 19.03.2020

Account.Margin vs. Calculated Margin - Mismatch
03 Dec 2021, 14:26


Hello,

I've noticed that Account.Margin value does not exactly match the calculated margin provided by: obj.Position.VolumeInUnits * obj.Position.EntryPrice / Account.PreciseLeverage;

What can be a reason for this?

Remark: no currency conversion is applicable in the example below since account and symbol currency is the same.

 

Thank you once again!

 


@ncel01
Replies

PanagiotisCharalampous
03 Dec 2021, 14:40

Hi ncel01,

If there is no conversion applicable then the equation should be

margin = Volume / leverage

However you are applying conversions here.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 


@PanagiotisCharalampous

ncel01
03 Dec 2021, 16:02

RE:

Hi Panagiotis,

I didn't understand.

Isn't the margin used calculated as VolumeInUnits * EntryPrice / AccountLeverage ?

 

PanagiotisCharalampous said:

Hi ncel01,

If there is no conversion applicable then the equation should be

margin = Volume / leverage

However you are applying conversions here.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 

 


@ncel01

PanagiotisCharalampous
03 Dec 2021, 16:08

Hi ncel01,

No, the equation is the one I provided above, assuming that the unit of measurement of the margin i.e. the currency, is the same to the one used for the account. Else you will need to make the relevant conversions.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 


@PanagiotisCharalampous

ncel01
03 Dec 2021, 16:53

RE:

 

Hi Panagiotis,

 

I forgot to mention but both my question and the example I provided was about indexes and not FX pairs.

 

PanagiotisCharalampous said:

Hi ncel01,

No, the equation is the one I provided above, assuming that the unit of measurement of the margin i.e. the currency, is the same to the one used for the account. Else you will need to make the relevant conversions.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 

 


@ncel01

amusleh
06 Dec 2021, 08:51

RE: RE:

ncel01 said:

 

Hi Panagiotis,

 

I forgot to mention but both my question and the example I provided was about indexes and not FX pairs.

 

PanagiotisCharalampous said:

Hi ncel01,

No, the equation is the one I provided above, assuming that the unit of measurement of the margin i.e. the currency, is the same to the one used for the account. Else you will need to make the relevant conversions.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 

 

Hi,

Without conversion you will not be able to calculate the used or required margin for all symbols.

And for conversion you need a symbol base asset and quote asset, also you need the symbol conversion chain which are not available right now in automate API.

You can open a thread on suggestions section for adding the symbol conversion feature if you want to.


@amusleh

ncel01
06 Dec 2021, 12:10

RE: RE: RE:

amusleh said:

ncel01 said:

 

Hi Panagiotis,

 

I forgot to mention but both my question and the example I provided was about indexes and not FX pairs.

 

PanagiotisCharalampous said:

Hi ncel01,

No, the equation is the one I provided above, assuming that the unit of measurement of the margin i.e. the currency, is the same to the one used for the account. Else you will need to make the relevant conversions.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook 

 

Hi,

Without conversion you will not be able to calculate the used or required margin for all symbols.

And for conversion you need a symbol base asset and quote asset, also you need the symbol conversion chain which are not available right now in automate API.

You can open a thread on suggestions section for adding the symbol conversion feature if you want to.

Hi amusleh,

The example provided is a particular example for an indice (US500), where symbol and account currency is the same (USD).

In such a case, I think that conversion is not applicable and I was expecting both values (Account.Margin and calculated margin) as shown, to match.

Maybe I am still missing something here..

 

Thank you!


@ncel01