Positions_Modified(): How to disregard TSL ?

Created at 10 Aug 2023, 08:25
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!
NC

ncel01

Joined 19.03.2020

Positions_Modified(): How to disregard TSL ?
10 Aug 2023, 08:25


Hello,

Is there any straightforward way to check if Positions_Modified() has been triggered by the trailing stop?

I'd like to ignore this and return from the method in such a case.

Thanks.


@ncel01
Replies

firemyst
11 Aug 2023, 00:31

I don't think you can check for that directly, however, what you can try is:

  1. compare the new SL price with the previous SL price
  2. if they're not equal, return from the method
  3. if they're still equal, then you know the SL hasn't changed.

@firemyst

ncel01
11 Aug 2023, 08:08

Hi firemyst,

Yes, it would be pretty straightforward, like that, if not considering any manual modifications.

The problem is that I want to implement a protection against manual modifications. Unfortunately, in that case, just comparing the SL with the previous value won't be enough to conclude anything.

I really think there should be a way to simply identity this. The TLS is placed on server and will trigger Positions_Modified() all the time, however, the most likely is that no acton is to be taken in such cases.

As an automated action, I even think there should be a dedicated/separated event for this.


@ncel01

ncel01
11 Oct 2023, 11:05

cTrader Team,

Can you please inform if this is possible?

Thank you.


@ncel01

PanagiotisChar
11 Oct 2023, 12:22

RE: Positions_Modified(): How to disregard TSL ?

ncel01 said: 

cTrader Team,

Can you please inform if this is possible?

Thank you.

It's not


@PanagiotisChar

ncel01
11 Oct 2023, 12:59

RE: RE: Positions_Modified(): How to disregard TSL ?

PanagiotisChar said: 

ncel01 said: 

cTrader Team,

Can you please inform if this is possible?

Thank you.

It's not

Hi Panagiotis,

Noted. Thanks for confirming this!


@ncel01