Modifying Pending Order - page 2

 

Whilst I am printing the values - could someone tell me if I can modify the lot value on a pending order? Or can it only be done by looping the ordersend function to cancel and re-open an order to find the correct lot value relative to the stop loss constantly moving on the pending order?

My lot size is just calculated based upon the stop distance of entry in pips... Simple.

 
DomGilberto: could someone tell me if I can modify the lot value on a pending order?
Since it's a pending order, I don't see why not - as long as the open price to market price is larger than max(freeze level, stop level)
 

Hmm - I'm not sure if I've read an old thread with rules that were based upon an old MT4 build, but I have read that you cannot change the lot size on a pending order? You would need to cancel it and place another pending order with the new lot value you wanted... because the lot value is directly correlated to the distance (in pips) of the entry to my stop, my stops (with pending orders) are most of the time getting tighter before the initial trigger of the pending order... Because this is the case, the less points from entry to stop = the more lots I would need to entertain my risk profile. Else the initial lots allocated when the OrderSend function is first called, would most of the time not be sufficient in size relative to the stop distance from entry...

Would it be CPU intensive to cancel the order and place another one over and over again on every trade opportunity? Looking at OrderModify, you cannot specify any value to change the lots...?

 
DomGilberto:

Hmm - I'm not sure if I've read an old thread with rules that were based upon an old MT4 build, but I have read that you cannot change the lot size on a pending order? You would need to cancel it and place another pending order with the new lot value you wanted... because the lot value is directly correlated to the distance (in pips) of the entry to my stop, my stops (with pending orders) are most of the time getting tighter before the initial trigger of the pending order... Because this is the case, the less points from entry to stop = the more lots I would need to entertain my risk profile. Else the initial lots allocated when the OrderSend function is first called, would most of the time not be sufficient in size relative to the stop distance from entry...

Would it be CPU intensive to cancel the order and place another one over and over again on every trade opportunity? Looking at OrderModify, you cannot specify any value to change the lots...?

Not CPU intensive at all, CPU won't even break a sweat, will just take a little time talking to the Brokers server . . .
 
WHRoeder:
Since it's a pending order, I don't see why not - as long as the open price to market price is larger than max(freeze level, stop level)


Unless something has changed, you cannot change the lot size on a pending order.
 
Right - So i'd need to cancel every pending order and issue a new OrderSend function with newly calculated lot sizing, relative to the stop distance... Thanks guys.
Reason: