Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Internal Order Handling Rules violation only logged once RC1
Collapse
X
-
Hello DaveE,
Thank you for your response.
This would be the same case as the original file even with the additional output you added. I simplified the system so that I could see it more clearly on my end and I do in fact see that the message is only reported once - however this is the same in NinjaTrader 7. So is your note to suggest that each internal order handling rule violation that is a repeat of the last order's message to repeat in the Output?
-
I attach a script that demonstrates the bug more clearly that the script in post 1.
Please forward it to your testing department.
Here is sample output running it on USDJPY 60min TF:
DataLoaded
Historical
**Flat at CurrentBar=0, 09 Oct 2016 23:00: EnterLongLimit(100000, 0.001)
09/10/2016 23:00:00 Strategy 'sTestLimitError7/-1': Entered internal SubmitOrderManaged() method at 09/10/2016 23:00:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100,000 LimitPrice=0.00'1 StopPrice=0 SignalName='' FromEntrySignal=''
OnOrderUpdate Name=Buy, OrderState=Submitted
OnOrderUpdate Name=Buy, OrderState=Accepted
OnOrderUpdate Name=Buy, OrderState=Working
**Flat at CurrentBar=1, 10 Oct 2016 00:00: EnterShortLimit(100000, 206.342)
but there is still an active Long order that is due to expire, but not yet cancelled, so 'rule 3' SHOULD log an error
10/10/2016 00:00:00 Strategy 'sTestLimitError7/-1': Entered internal SubmitOrderManaged() method at 10/10/2016 00:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=206.34'2 StopPrice=0 SignalName='' FromEntrySignal=''
10/10/2016 00:00:00 Strategy 'sTestLimitError7/-1': Ignored SubmitOrderManaged() method at 10/10/2016 00:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=206.34'2 StopPrice=0 SignalName='Sell short' FromEntrySignal='' Reason='An Enter() method to submit an entry order has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'
Strategy 'sTestLimitError7/-1': An Enter() method to submit an entry order at '10/10/2016 00:00:00' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.
10/10/2016 00:00:00 Strategy 'sTestLimitError7/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00000-2589' account='Backtest' name='Buy' orderState=Working instrument='USDJPY' orderAction=Buy orderType='Limit' limitPrice=0.001 stopPrice=0 quantity=100,000 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2016-10-09 23:00:00' gtd='2099-12-01' statementDate='2016-10-19'
OnOrderUpdate Name=Buy, OrderState=CancelPending
OnOrderUpdate Name=Buy, OrderState=CancelSubmitted
OnOrderUpdate Name=Buy, OrderState=Cancelled
But the next time exactly the same sequence occurs NT fails to log the violation
**Flat at CurrentBar=2, 10 Oct 2016 01:00: EnterLongLimit(100000, 0.001)
10/10/2016 01:00:00 Strategy 'sTestLimitError7/-1': Entered internal SubmitOrderManaged() method at 10/10/2016 01:00:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100,000 LimitPrice=0.00'1 StopPrice=0 SignalName='' FromEntrySignal=''
OnOrderUpdate Name=Buy, OrderState=Submitted
OnOrderUpdate Name=Buy, OrderState=Accepted
OnOrderUpdate Name=Buy, OrderState=Working
**Flat at CurrentBar=3, 10 Oct 2016 02:00: EnterShortLimit(100000, 206.226)
but there is still an active Long order that is due to expire, but not yet cancelled, so 'rule 3' SHOULD log an error
10/10/2016 02:00:00 Strategy 'sTestLimitError7/-1': Entered internal SubmitOrderManaged() method at 10/10/2016 02:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=206.22'6 StopPrice=0 SignalName='' FromEntrySignal=''
10/10/2016 02:00:00 Strategy 'sTestLimitError7/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00001-2589' account='Backtest' name='Buy' orderState=Working instrument='USDJPY' orderAction=Buy orderType='Limit' limitPrice=0.001 stopPrice=0 quantity=100,000 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2016-10-10 01:00:00' gtd='2099-12-01' statementDate='2016-10-19'
OnOrderUpdate Name=Buy, OrderState=CancelPending
OnOrderUpdate Name=Buy, OrderState=CancelSubmitted
OnOrderUpdate Name=Buy, OrderState=Cancelled
The same bug occurs on all further occurrences.
This bug is still in RC2Attached Files
Leave a comment:
-
Hello,
Thank you for your patience.
Your orders are expiring after one bar after the initial 'Internal Order Handling Rules' violation. Set your limit orders to isLiveUntilCancelled = true and test again. See the overloads at the following link for more information.- EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName)
- http://ninjatrader.com/support/helpG...rlonglimit.htm
Leave a comment:
-
Hello DaveE,
Thank you for the additional report.
I will forward this information to development.
Leave a comment:
-
Internal Order Handling Rules violation only logged once RC1
I'm calling the highlighted rule 'rule 3'
For the most part, you do not need to be intimately familiar with these rules as you develop your strategies. It is all taken care of for you internally within a strategy. If a rule is violated, you will be notified through an error log in the Control Center Log tab.
The following rules are true per unique signal name:
Methods that generate orders to enter a position will be ignored if:
• A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
• A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
• The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
• The entry signal name is not unique
If rule 3 is violated during the running of a strategy it only gets logged on the first occurence (subsequent occurences are 'silent'). So there is only one entry in TraceOrders output or the Log regardless of how many violations occur.
Effect of bug: Where running stategies are violating the rule, the ignored limit order reversal attempts are not being logged as an error (except the first one). Because this first violation is likely to occur during historical processing, subsequent violations during live running may not come to the attention of the user. In general problems with strategies are harder to diagnose. Some examples are in this thread.
Steps to reproduce:
Run the attached strategy (only needs a day's input in Strategy Analyzer, say 60 minute TF forex)
The Output will look something like this (truncated)
Flat at bar 0, 26 Sep 2016 06:00: EnterLongLimit(100000, 0.001)
26/09/2016 06:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 06:00:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100,000 LimitPrice=0.00'1 StopPrice=0 SignalName='' FromEntrySignal=''
Flat at bar 1, 26 Sep 2016 07:00: EnterShortLimit(100000, 202.156)
26/09/2016 07:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 07:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=202.15'6 StopPrice=0 SignalName='' FromEntrySignal=''
26/09/2016 07:00:00 Strategy 'sTestLimitError5/-1': Ignored SubmitOrderManaged() method at 26/09/2016 07:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=202.15'6 StopPrice=0 SignalName='Sell short' FromEntrySignal='' Reason='An Enter() method to submit an entry order has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'
Strategy 'sTestLimitError5/-1': An Enter() method to submit an entry order at '26/09/2016 07:00:00' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.
26/09/2016 07:00:00 Strategy 'sTestLimitError5/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00000-3263' account='Backtest' name='Buy' orderState=Working instrument='USDJPY' orderAction=Buy orderType='Limit' limitPrice=0.001 stopPrice=0 quantity=100,000 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2016-09-26 06:00:00' gtd='2099-12-01' statementDate='2016-09-30'
Flat at bar 2, 26 Sep 2016 08:00: EnterLongLimit(100000, 0.001)
26/09/2016 08:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 08:00:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100,000 LimitPrice=0.00'1 StopPrice=0 SignalName='' FromEntrySignal=''
Flat at bar 3, 26 Sep 2016 09:00: EnterShortLimit(100000, 201.728)
26/09/2016 09:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 09:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=201.72'8 StopPrice=0 SignalName='' FromEntrySignal=''
26/09/2016 09:00:00 Strategy 'sTestLimitError5/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00001-3263' account='Backtest' name='Buy' orderState=Working instrument='USDJPY' orderAction=Buy orderType='Limit' limitPrice=0.001 stopPrice=0 quantity=100,000 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2016-09-26 08:00:00' gtd='2099-12-01' statementDate='2016-09-30'
Flat at bar 4, 26 Sep 2016 10:00: EnterLongLimit(100000, 0.001)
26/09/2016 10:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 10:00:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=100,000 LimitPrice=0.00'1 StopPrice=0 SignalName='' FromEntrySignal=''
Flat at bar 5, 26 Sep 2016 11:00: EnterShortLimit(100000, 201.222)
26/09/2016 11:00:00 Strategy 'sTestLimitError5/-1': Entered internal SubmitOrderManaged() method at 26/09/2016 11:00:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=100,000 LimitPrice=201.22'2 StopPrice=0 SignalName='' FromEntrySignal=''
26/09/2016 11:00:00 Strategy 'sTestLimitError5/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00002-3263' account='Backtest' name='Buy' orderState=Working instrument='USDJPY' orderAction=Buy orderType='Limit' limitPrice=0.001 stopPrice=0 quantity=100,000 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2016-09-26 10:00:00' gtd='2099-12-01' statementDate='2016-09-30'
Im requesting this bug fix because I assume its a quick fix that should be ready for the next release, whereas my suggested improvement of the rule might take longer.Attached FilesTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kaledus, Today, 01:29 PM
|
0 responses
3 views
0 likes
|
Last Post
by Kaledus
Today, 01:29 PM
|
||
Started by PaulMohn, Today, 12:36 PM
|
1 response
15 views
0 likes
|
Last Post Today, 01:23 PM | ||
Started by yertle, Yesterday, 08:38 AM
|
8 responses
36 views
0 likes
|
Last Post
by ryjoga
Today, 01:22 PM
|
||
Started by rdtdale, Today, 01:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:13 PM | ||
Started by alifarahani, Today, 09:40 AM
|
3 responses
18 views
0 likes
|
Last Post Today, 12:47 PM |
Leave a comment: