Hello Ninjatrader,
My strategy uses the SubmitOrderUnmanaged() (and runs at OnEachTick) to open a stop limit sell order on a 5 min chart (tick replay enabled)
When this order gets filled the strategy submits a new (unmanaged) stoploss order.. (buytocover stoplimit)
However in some cases this stoploss order gets ignored as you can see in the logs below :
I have logged the current ask & bid prices and enabled order tracing. The ask & bid are at 3320.5 at the moment i create my stop limit order for price 3322.25
The ninjatrader log window shows this SL order gets ignored since the stop price is greater or equal then the close price of the current bar.
Why is this ? The current bar is still open and still developing at the moment i place my order (My strategy uses OnEachTick).
I dont see why this preliminary close price of the current bar should be of any relevance to the order(s) i'm submitting ?
I mean it should not matter whether i submit the order from a 10-tick or 1 day chart ?
All that should matter is the current bid/ask prices imo ?
How can i fix this ?
regards
Erwin
Ninjatrader log:
Strategy 'TestStrategy/183135895': A Sell stop order placed at '1/2/2020 9:40:00 AM' has been ignored [B]since the stop price is greater than or equal to the close price of the current bar[/B]. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
1/17/2020 9:40:00 AM open short open limit order price:3320.5 1/17/2020 9:40:00 AM Strategy 'TestStrategy/183135895': Entered internal SubmitOrderUnmanaged() method at 1/17/2020 9:40:00 AM: BarsInProgress=0 Action=Sell OrderType=StopLimit Quantity=1 LimitPrice=3320.50 StopPrice=3320.50 SignalName='short1' 1/17/2020 9:40:00 AM onorder update called ->order short1 got filled 1/17/2020 9:40:00 AM create new stoploss order for price 3322.25 [B]current ask:3320.5 current bid:3320.5[/B] 1/17/2020 9:40:00 AM Strategy 'TestStrategy/183135895': Entered internal SubmitOrderUnmanaged() method at 1/17/2020 9:40:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=StopLimit Quantity=1 LimitPrice=0 [B]StopPrice=3322.25[/B] SignalName='shortsl1' 1/17/2020 9:40:00 AM Strategy 'TestStrategy/183135895': Ignored SubmitOrderUnmanaged() method at 1/17/2020 9:40:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=StopLimit Quantity=1 LimitPrice=0 StopPrice=3322.25 SignalName='shortsl1' FromEntrySignal=''[B] Reason='Invalid order price, please see log tab'[/B]
Comment