Difference in cTraders's Margin Calculation between opening several trades separately vs. modyfying volume

Created at 16 Nov 2023, 10:29
heinrich.munz's avatar

heinrich.munz

Joined 21.11.2020

Difference in cTraders's Margin Calculation between opening several trades separately vs. modyfying volume
16 Nov 2023, 10:29


During back testing I invest i.e. 5 x the same lot size of 1 Lot on the GER40 symbol on a Pepperstone account in 2 different ways:
1. separately via ExecuteMarketOrder(…) == > 5 Trades are open with 5 lots in sum ==> ok
2. via ModifyVolume(…) ==> 1 Trade is open with 5 lots in sum ==> ok

However, on 1. the “Margin Used” is 5x the initial margin of 38,39 € = 191.96 (which I recognize as correct), 
while on 2. The “Margin used” is computed via the “little Gaussian” formula y = x * (x+1) /2 giving 5 * 6 /2 * initial margin = 15 * 38,39 = ca. 575.85 (which I recognize as wrong)

 

Can you please explain this behavior?

 

 


@heinrich.munz
Replies

ncel01
16 Nov 2023, 12:19 ( Updated at: 16 Nov 2023, 14:17 )

Wrong margin calculation

Hello,

3 months ago I've reported a similar issue with margin calculation during backtesting:
https://ctrader.com/forum/calgo-support/41606#post-104078

Despite this calculation being very basic and crucial for risk management, I have double-checked this and "surprisingly," the issue persists.

Conclusion: Due to the inconsistencies in cTrader's calculation, I will continue to use my own calculation.


@ncel01

PanagiotisCharalampous
17 Nov 2023, 06:51

Reply to: Difference in cTraders's Margin Calculation between opening several trades separately vs. modyfying volume

Hi all,

Which version do you use?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2023, 06:52

Reply to: Difference in cTraders's Margin Calculation between opening several trades separately vs. modyfying volume

Hi all,

Which version do you use?

Best regards,

Panagiotis


@PanagiotisCharalampous

ncel01
17 Nov 2023, 10:11

Panagiotis,

v4.8.30, which is the latest I guess.


@ncel01

ME-Pepper
17 Nov 2023, 10:50

RE: Reply to: Difference in cTraders's Margin Calculation between opening several trades separately vs. modyfying volume

PanagiotisCharalampous said: 

Hi all,

Which version do you use?

Best regards,

Panagiotis

4.8.30


@ME-Pepper