How can I keep all orders active until a new bar of the BarsArray[0] timeframe?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BarsInProgress[1] causing expiration of BarsInProgress[0] orders
Collapse
X
-
BarsInProgress[1] causing expiration of BarsInProgress[0] orders
With TraceOrders on, I can see that with 3 active orders, a new bar on the higher timeframe of the same instrument (BarsArray[1]) will cause the first of the three orders to expire but leave the other two.
How can I keep all orders active until a new bar of the BarsArray[0] timeframe?Tags: None
-
I have attached a simple strategy which I placed on an ES 233t chart that adds the ES 5000v.
If an order is working on the primary timeframe while a new bar is completed on the secondary (5000v), the order is cancelled.Attached Files
Comment
-
When Entries per Direction is set to 3 and Entry handling is set to UniqueEntries, all 3 orders are placed and the 1st order is canceled on the completion of the higher timeframe bar.
When Entries per Direction is set to 3 and Entry handling is set to AllEntries, the third order is rejected with the following log entry:
Ignored PlaceOrder() method at 12/2/2008 8:32:19 AM: Action=SellShort OrderType=Limit Quantity=1 LimitPrice=829.00 StopPrice=0 SignalName='S3' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
Either way, the 1st order is canceled with the higher timeframe (BarsArray[1]) bar completes, as follows:
Cancelled expired order: BarsInProgress=1: Order='72a3fc58697d412293f5c76385728f45/Replay101' Name='S1' State=Working Instrument='ES 12-08' Action=SellShort Limit price=828.75 Stop price=0 Quantity=1 Strategy='Multi_Test' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='72a3fc58697d412293f5c76385728f45' Gtd='12/1/2099 12:00:00 AM'
The logic cannot, basic as it is, should not place any orders while BarsInProgress = 1.
Please advise, there must be something I'm overlooking.
Comment
-
nolantx,
I used your strategy and do not experience the behavior you are stating. Please ensure you are on NT6.5.1000.7.
This is what I get:
Code:12/3/2008 7:18:27 AM BarsInProgress 1 12/3/2008 7:18:27 AM BarsInProgress 0 12/3/2008 7:18:28 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:28 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S1' FromEntrySignal='' 12/3/2008 7:18:28 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:28 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S2' FromEntrySignal='' 12/3/2008 7:18:28 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:28 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S3' FromEntrySignal='' 12/3/2008 7:18:30 AM BarsInProgress 1 12/3/2008 7:18:30 AM BarsInProgress 0 12/3/2008 7:18:31 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S1' FromEntrySignal='' 12/3/2008 7:18:31 AM Ignored PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S1' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' 12/3/2008 7:18:31 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S2' FromEntrySignal='' 12/3/2008 7:18:31 AM Ignored PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S2' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' 12/3/2008 7:18:31 AM Entered internal PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S3' FromEntrySignal='' 12/3/2008 7:18:31 AM Ignored PlaceOrder() method at 12/3/2008 7:18:31 AM: Action=SellShort OrderType=Limit Quantity=100 LimitPrice=50.00 StopPrice=0 SignalName='S3' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' 12/3/2008 7:18:33 AM BarsInProgress 1
Josh P.NinjaTrader Customer Service
Comment
-
Josh,
You are not testing this strategy on the ES. If I put this strategy on another contract as you have done, it works fine.
Please try this on the same contract as the higher timeframe (ES 12-08) with Entries per direction of 3 and try both 'UniqueEntries" and 'Allentries'. I think you'll see different results.
Comment
-
Resubmitting orders on both bar series for same instrument
Originally posted by NinjaTrader_Josh View PostThat is expected behavior. If you are using the same instruments you need to resubmit on all bar series of that instrument, not just the one you submitted to.
Code:Initialize: //Add tick by tick bars to strategy Add(PeriodType.Tick, 1); OnBarUpdate: // 1 min bars if (BarsInProgress == 0) return; //Enter on tick updates but use primary bars for entry signal //Current tick > Closing price of previous 1 min bar if (BarsInProgress == 1 && Close[0] > Closes[0][1]) EnterLongLimit(PositionSize, Close[0], "Buy");
I thought that would happen automatically since I have not referenced a specific BarsInProgress reference in my EnterLongLimit statement.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by gleichnerany, Today, 01:17 AM
|
0 responses
1 view
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
43 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
3 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
6 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
6 responses
27 views
0 likes
|
Last Post Today, 12:02 AM |
Comment