ModifyPendingOrderAsync & ModifyPositionAsync parameters
Created at 01 Dec 2021, 21:51
ModifyPendingOrderAsync & ModifyPositionAsync parameters
01 Dec 2021, 21:51
Hello,
How to code ModifyPendingOrderAsync & ModifyPositionAsync if I only want to modify a single parameter?
For instance, in case I only want to modify the stop loss distance, what would be the equivalent to position.ModifyStopLossPrice in Async mode?
Thanks!
Replies
ncel01
02 Dec 2021, 13:29
RE:
Hi amusleh,
Thank you for your reply.
That's clear!
Regards
amusleh said:
Hi,
You can just pass the Position current parameters and provide new value only for those parameters that you want to change.
For ex:
protected override void OnTick() { var position = Positions.First(); var newStopLossValue = 1.23423; // Here I just modify the stop loss ModifyPositionAsync(position, newStopLossValue, position.TakeProfit); }
@ncel01
amusleh
02 Dec 2021, 08:52
Hi,
You can just pass the Position current parameters and provide new value only for those parameters that you want to change.
For ex:
@amusleh