I am aware that the Order object has the "instantaneous" status; and that OnOrderUpdate
callbacks may "lag" behind the "real" status. But just some questions you could help me with:
(NinjaTrader.NinjaScript.StrategyBase...)
public void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice,
int quantity, int filled, double averageFillPrice,
Cbi.OrderState newOrderState, DateTime time, Cbi.ErrorCode error, string comment);
ODDLY, I want to represent Buy or so-called "Long" quantities as negative numbers;
and Sell or "Short" fill quantities as positive numbers (maybe opposite of most people).
I'll know whether a given Order is intended for a Long or Short position, so I can
assign my own minus or plus sign to the Order Fill Quantity.
#1 is the "quantity" argument the Total Order quantity as originally submitted and requested?
#2 is the "filled" argument the cumulative fill, with behavior as follows:
So, if the order quantity is 3, and 3 separate executions (each 1 contract) occurred,
then I could expect 3 callbacks: quantity=3,filled=1; quantity=3,filled=2; quantity=3, filled=3
on the last of which I'd probably get OrderState.Filled ? This is in the case of a normal execution,
and not some error condition scenario.
I AM KEEPING IN MIND that the Order object's states may "race ahead" of those OnOrderUpdate
callbacks in time.
OR SHOULD I SIMPLY HANDLE OnExecutionUpdate, and not bother with OnOrderUpdate ?
hyperscalper
Comment