Positions Modified - Is it possible to get a response on what's been modified?
Created at 28 Apr 2025, 15:00
Positions Modified - Is it possible to get a response on what's been modified?
28 Apr 2025, 15:00
Hi All,
If i use the Positions.Modified function, i can write a prompt to the console that says a positions been modified. This occurs if i amend/add/remove a stop loss or take profit, or increase/decrease a positions volume. However, i'd like to code some further functionality in the event volume has changed specifically.
Is it possible using Positions.Modified to see what has been specifically modified? And if so, what would the code be for the changing of volume?
Thanks,
firemyst
29 Apr 2025, 00:09
The code to change the volume is:
<your position>.ModifyVolume(newVolume);
To see what's been modified, you'll have to created your event handler method, and then check out the parameter to see what's available to you so you can determine what's been modified:
help . ctrader . com /ctrader-algo/references/EventArgs/PositionModifiedEventArgs/
@firemyst