Account.MarginLevel , why is it nullable?

Created at 13 Dec 2020, 23:45
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!
JE

JeanPaul

Joined 17.10.2020

Account.MarginLevel , why is it nullable?
13 Dec 2020, 23:45


I want my bot not to take any position if Margin Level is below a certain limit, say 150%.

But when I look at  Account.MarginLevel I notice that it is nullable double, so why is it nullable? I have also checked it in backtesting and it is null.

How can I practically calculate my Margin Level if this is not available?


@JeanPaul
Replies

PanagiotisCharalampous
14 Dec 2020, 08:50

Hi JeanPaul,

The Margin Used is 0 (probably no positions are open), consequently the margin level will be N/A. There is no margin level if there are no positions open.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous