Backtesting - Margin calls - Stop outs

Created at 08 Jun 2016, 10:48
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!
ER

Ermisl

Joined 05.06.2014

Backtesting - Margin calls - Stop outs
08 Jun 2016, 10:48


cAlgo team,

Does backtesting take into account free margins, margin calls, stop outs etc? 

Thank you for your hard work.


@Ermisl
Replies

Spotware
08 Jun 2016, 17:07

Dear Trader,

Free margin is accessible in backtesting.

Currently, there is no margin call or stop out in backtesting. We will consider implementing it in the future. Stay tuned.


@Spotware

Ermisl
08 Jun 2016, 23:07

Thank you for your prompt answer.

I hope those are implemented as soon as possible so as to provide an undistorted view of the efficiency of trader's strategies.

Keep up the good work.


@Ermisl

1007601
10 Jun 2016, 14:54

RE:

Ermisl said:

Thank you for your prompt answer.

I hope those are implemented as soon as possible so as to provide an undistorted view of the efficiency of trader's strategies.

Keep up the good work.

Good to know, I guess it's up to us to include this...

 

Just read about: /api/reference/internals/iaccount

ie.  account.freemargin etc

 


@1007601

whis.gg
10 Jun 2016, 15:08

using System.Linq;

protected override void OnTick()
{
    while (Account.MarginLevel <= StopOutPercent)
    {
        ClosePosition(Positions.OrderByDescending(x => x.GrossProfit).Last());
    }
}

This one simulates stop out.


@whis.gg