Backtesting with stoploss?

Created at 23 Oct 2016, 11:57
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!
XS

xsteel1

Joined 23.10.2016

Backtesting with stoploss?
23 Oct 2016, 11:57


Is there a way to run a backtest with a stoploss? Another thread said backtesting does not use the stoploss setting, and after hours searching and trying I haven't been able to implement it in code.

I would like to add a small snippet of code to perform this function during backtesting even if it needs to be hard coded. Any help would be appreciated.

As an example I am backtesting the Sample Trend cBot, however large losses occur that a stoploss would avoid.


@xsteel1
Replies

croucrou
23 Oct 2016, 13:46

ExecuteMarketOrder(TradeType tradeType, Symbol symbol, long volume, string label, double? stopLossPips, double? takeProfitPips)

 


@croucrou

... Deleted by UFO ...

xsteel1
23 Oct 2016, 15:13

Thankyou very much @lucian and @croucro that workes great! 


@xsteel1