I am using OrderSend
like this
OrderSend(Symbol(),OP_BUYLIMIT,Lots,100, 50,200,"",Magic,0,Red);
in this case, buy will be executed when price comes 100.
But I want to check one more layer when the price comes 100.
like this.
// when price comes to 100.
if (MacD > 0){buy cancel;}
Is this possible ? or OrderSend
can not be canceled?
OrderSend()
has created a BUY-LIMIT
pending order:your Broker has created a pending XTO-instruction on their books and indeed, once the Market-price ( Ask
) hits the set XTO-OrderOpenPrice() == 100.0
, such Pending-Order turns executed at set price == 100.0
without any other intervention, automatically.
This is a common procedure.
100.0
:well,
in this case, one should rather not use Pending Orders, as there is zero-chance to modify it as the price moves close to the Pending Order set OrderOpenPrice()
.
There is a detailed specification about so called StopLevel
and FreezeLevel
distances from a set price, that prevents any such wished modification, cancellation or even remnoval from taking place, once the Market price wanders into these proximity zones.
So,
either
do not place the Pending Order ( and keep all the XTO operations based on XTO-s using the plain Market-Orders { OP_BUY | OP_SELL }
)
or
modify your Pending-Orders { OP_BUYLIMIT | OP_BUYSTOP | OP_SELLLIMIT | OP_SELLSTOP }
order-management policies, to take decisions during a price still being outside of the MarketInfo()
-inspected StopLevel-zone and FreezeLevel-zones.