Maybe I've been operating under the wrong assumption... but I thought this would work:
OnBarUpdate() {
..
if (xxx)
EnterLongLimit();
else
EnterLong();
}
The idea is that it would be (sort of) a bracketed order. I wanted to try to fill a limit order if possible, but if not, I would enter a market order... and I thought the market order would automatically cancel the limit order.
But in operation, it doesn't work that way...
The previous bar:
9/18/2008 12:50:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Percent Value=0.01 Currency=0 Simulated=False
9/18/2008 12:50:00 PM Entered internal PlaceOrder() method at 9/18/2008 12:50:00 PM: Action=Buy OrderType=Limit Quantity=100 LimitPrice=11.55 StopPrice=0 SignalName='' FromEntrySignal=''
9/18/2008 12:50:00 PM Ignore order amendment: Action=Buy OrderType=Limit Quantity=100 LimitPrice=11.55 StopPrice=0 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
The next bar:
9/18/2008 12:55:00 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=0.1 Currency=0 Simulated=False
9/18/2008 12:55:00 PM Entered internal PlaceOrder() method at 9/18/2008 12:55:00 PM: Action=Buy OrderType=Market Quantity=100 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
9/18/2008 12:55:00 PM Ignored PlaceOrder() method at 9/18/2008 12:55:00 PM: Action=Buy OrderType=Market Quantity=100 LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
9/18/2008 12:55:00 PM Cancelled expired order: BarsInProgress=1: Order='NT-00003/Back101' Name='Buy' State=Working Instrument='MBI' Action=Buy Limit price=11.55 Stop price=0 Quantity=100 Strategy='ProtectDown' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='fe75bf7d47f64533b8fd5549649e0e20' Gtd='12/1/2099 12:00:00 AM'
moving stop..

Comment