cBot - How to code TSL using cTraders TSL instead of Modify Position

Created at 15 Dec 2024, 12:02
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!
DA

dafyddjohndavies

Joined 06.11.2024

cBot - How to code TSL using cTraders TSL instead of Modify Position
15 Dec 2024, 12:02


Hi,

How do I get my cBot to utilise the cTraders TSL system instead of it modifying the position after every bar. When I put a trade on normaly with TSL in cTrader it dynamically follows the price up and fixes at the pips i've set it to. 

However using cBot I don't know how to make it do the same thing. Instead it puts a SL in and modifies it. During a normal trade the cTrader trailing stop loss line says TSL not SL.

Any idea how to invoke that specific mechanism?

Thanks


@dafyddjohndavies
Replies

firemyst
16 Dec 2024, 01:13

The simple way to do it is:

 position.ModifyTrailingStop(true);

or

 position.ModifyTrailingStop(false);


@firemyst

dafyddjohndavies
16 Dec 2024, 07:17

RE: cBot - How to code TSL using cTraders TSL instead of Modify Position

firemyst said: 

The simple way to do it is:

 position.ModifyTrailingStop(true);

or

 position.ModifyTrailingStop(false);

Thank you


@dafyddjohndavies