ModifyPendingOrder() Problem
ModifyPendingOrder() Problem
17 May 2018, 16:15
Hi , Thank you for reading my quesiton
At the moment i have
OnTick()
{
PendingOrders.Created += OnPendingOrdersCreated;
}
to ModifyPendingOrder() when a pending order is created which changes its stoploss , takeprofit etc.
However, a problem is this method causes 10+ modification on one pending order i believe which as a result makes the Notifications pop up 10+ times for that one order . and that takes out from top right of my screen to bottom right. 10 + pop out displaying the same message .
Is it my pcs problem .
Many Thanks
Henry
Replies
1222Ht
17 May 2018, 17:02
Panagiotis Thank you very much for your reply .
To my limited knowledge , OnStart() is only run once at the start of the cbot , would it mean that if i place another pending order e.g. 10 minutes later ,
without having to stop and start the cbot again , would this new second pending order be modified too .
Thank you very much
Henry
@1222Ht
PanagiotisCharalampous
17 May 2018, 17:09
Hi Henry,
OnPendingOrdersCreated will be executed after every order creation.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
17 May 2018, 16:42
Hi Henry,
Move this line of code in the OnStart() method. As it is, it subscribes again on every tick and that is why you are getting multiple executions.
Best Regards,
Panagiotis
@PanagiotisCharalampous