ModifyPosition() not working

Created at 16 Apr 2014, 05:32
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!
FX

FXRZ

Joined 16.04.2014

ModifyPosition() not working
16 Apr 2014, 05:32


I used ModifyPosition() in a cBot to modify the take profit this morning, but the cAlgo log showed:

"→ Modifying position PID4456132 (SL: 0, TP: 101.719) FAILED with error "TechnicalError", Position PID4456132"

Now, when I do the backtesting, I get no error as below:

"Modifying position PID8 (SL: 0, TP: 101.468) SUCCEEDED, Position PID8"

However, the take profit wasn't actually modified. This can be verified from the closed position's "Closed At".

Can Spotware take a look at this issue?

 


@FXRZ
Replies

Spotware
16 Apr 2014, 10:42

If you don't want to set SL you need to specify null instead of 0:

ModifyPosition(position, null, 101.719);

 


@Spotware