• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exception on unmanaged strategy

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    exception on unmanaged strategy

    following errors occur on unmanaged NT8 strategy

    Strategy 'MinorTopBottom/132605399' has been disabled because it attempted to modify a historical order that has transitioned to a live order. Please see the help guide for more information on transitioning order references from historical to live.

    2018-03-25 22:59:54:388 (My NinjaTrader Continuum) Cbi.Account.CreateOrder: orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Initialized instrument='ES 06-18' orderAction=BuyToCover orderType='Market' limitPrice=0 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=773 time='2018-03-25 23:00:02' gtd='2099-12-01' statementDate='2018-03-25' id=-1
    2018-03-25 22:59:54:393 (My NinjaTrader Continuum) Cbi.Account.Submit0: realOrderState=Initialized isPendingSubmit=False orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Submitted instrument='ES 06-18' orderAction=BuyToCover orderType='Market' limitPrice=0 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=773 time='2018-03-25 23:00:02' gtd='2099-12-01' statementDate='2018-03-25'
    2018-03-25 22:59:54:393 (My NinjaTrader Continuum) Cbi.Account.Submit1: realOrderState=Initialized orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Submitted instrument='ES 06-18' orderAction=BuyToCover orderType='Market' limitPrice=0 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=773 time='2018-03-25 23:00:02' gtd='2099-12-01' statementDate='2018-03-25'
    2018-03-25 22:59:54:393 (My NinjaTrader Continuum) Cbi.Simulator.Submit: realOrderState=Initialized orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Submitted instrument='ES 06-18' orderAction=BuyToCover orderType='Market' limitPrice=0 stopPrice=0 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=773 time='2018-03-25 23:00:02' gtd='2099-12-01' statementDate='2018-03-25' delay=100
    2018-03-25 22:59:54:393 (My NinjaTrader Continuum) Cbi.Account.OrderUpdateCallback: realOrderState=Submitted orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Submitted instrument='ES 06-18' orderAction=BuyToCover limitPrice=0 stopPrice=0 quantity=2 orderType='Market' filled=0 averageFillPrice=0 time='2018-03-25 23:00:02' statementDate='2018-03-25' error=NoError comment='' nr=-1
    2018-03-25 22:59:54:505 (My NinjaTrader Continuum) Cbi.Account.OrderUpdateCallback: realOrderState=Accepted orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Accepted instrument='ES 06-18' orderAction=BuyToCover limitPrice=0 stopPrice=0 quantity=2 orderType='Market' filled=0 averageFillPrice=0 time='2018-03-25 23:00:02' statementDate='2018-03-25' error=NoError comment='' nr=-1
    2018-03-25 22:59:54:505 (My NinjaTrader Continuum) Cbi.Account.OrderUpdateCallback: realOrderState=Working orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Working instrument='ES 06-18' orderAction=BuyToCover limitPrice=0 stopPrice=0 quantity=2 orderType='Market' filled=0 averageFillPrice=0 time='2018-03-25 23:00:02' statementDate='2018-03-25' error=NoError comment='' nr=-1
    2018-03-25 22:59:54:505 (My NinjaTrader Continuum) Cbi.Simulator.Fill1: realOrderState=Working orderId='b9295e1551aa43c7ad22e622445d4f0b' maxFillQuantity=2 price=2612.25 thread=37
    2018-03-25 22:59:54:505 (My NinjaTrader Continuum) Cbi.Simulator.Fill2: realOrderState=Working orderId='b9295e1551aa43c7ad22e622445d4f0b' fillQuantity=2 price=2612.25
    2018-03-25 22:59:54:505 (My NinjaTrader Continuum) Cbi.Account.OrderUpdateCallback: realOrderState=Filled orderId='b9295e1551aa43c7ad22e622445d4f0b' account='Sim101' name='SOMB_exit' orderState=Filled instrument='ES 06-18' orderAction=BuyToCover limitPrice=0 stopPrice=0 quantity=2 orderType='Market' filled=2 averageFillPrice=2612.25 time='2018-03-25 23:00:02' statementDate='2018-03-25' error=NoError comment='' nr=-1
    2018-03-25 22:59:54:506 (My NinjaTrader Continuum) Cbi.Account.ExecutionUpdateCallback: executionId='dcae14ca6a304f9588d43a187e271d97' account='Sim101' instrument='ES 06-18' exchange=Globex price=2612.25 quantity=2 marketPosition=Long operation=Add orderID='b9295e1551aa43c7ad22e622445d4f0b' isSod=False time='2018-03-25 23:00:02' statementDate='2018-03-25'
    2018-03-25 22:59:54:572 *************** unhandled exception trapped ***************
    2018-03-25 22:59:54:572 Exception has been thrown by the target of an invocation.
    2018-03-25 22:59:54:621 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.NinjaScript.StrategyBase.Process(Objec t sender, ExecutionEventArgs executionUpdate)
    at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
    at NinjaTrader.Cbi.Account.RaiseExecutionUpdate(Execu tionEventArgs e)
    at NinjaTrader.Cbi.Account.ExecutionUpdateCallback(In strument instrument, String executionId, Exchange exchange, DateTime time, MarketPosition marketPosition, String orderId, Int32 quantity, Double price, Double commission, Double fee, Boolean isSod, DateTime statementDate, Operation operation)
    at NinjaTrader.Cbi.Simulator.Fill(Int32 maxFillQuantity, Double price)
    at NinjaTrader.Cbi.Simulator.OnMarketData(Object sender, MarketDataEventArgs e)
    at NinjaTrader.Cbi.Simulator.<>c__DisplayClass21_0.<O nTimerSubmitNow>b__0(MarketDataEventArgs e)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeIn ternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Windows.Threading.ExceptionWrapper.Internal RealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatch When(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    2018-03-25 23:45:45:707 Server.HdsClient.Connect: type=IS server='is-us-001.ninjatrader.com' port=31658 system='NT'

    any idea how to fix this

    #2
    Hello Klaus Hengher,

    Thanks for opening the thread.

    Strategy 'MinorTopBottom/132605399' has been disabled because it attempted to modify a historical order that has transitioned to a live order. Please see the help guide for more information on transitioning order references from historical to live.
    This error is received when an Order object is assigned historically and then gets modified with Realtime data when that live order has different ID's. In NinjaTrader 8, we will have to transition Order objects when the state reaches State.Realtime so their order ID's can be updated from backtest generated ID's to account generated ID's. The SampleOnOrderUpdate strategy demonstrates how this can be done.

    Transitioning order references from historical to live - https://ninjatrader.com/support/help...storicaltolive

    SampleOnOrderUpdate - https://ninjatrader.com/support/foru...ead.php?t=7499

    As for unhandled exception that is seen with the ExecutionUpdate, I could not give further input without taking debugging steps and seeing what line of code is throwing that exception.

    Please let me know if I may be of further assistance.
    Last edited by NinjaTrader_Jim; 03-27-2018, 09:27 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      thank you for your help with transition from historical to real-time order.
      Do you need trace file to check exception ?

      Regards Klaus

      Comment


        #4
        Hello Klaus,

        The trace file would have similar information about the error and would likely not provide additional hints.

        We know that it is a null reference error, so there would be some object that was null when it was being referenced. Since the exception notes ExecutionUpdate events, I would first start debugging OnExecutionUpdate() and checking there for any potential null references. I'll also include an example unmanaged strategy that can be used to test along side your strategy while debugging and throughout development.

        The Playback Connection can be used to test the strategy as if it were applied to a live data feed with realtime data. While debugging, I would suggest to run the strategy against the same set of data using the Playback Connection so the issue can be reproduced.

        Information on using the Playback Connection can be found here - https://ninjatrader.com/support/help...connection.htm

        Please let us know if we can be of further help.
        Attached Files
        Last edited by NinjaTrader_Jim; 03-27-2018, 01:20 PM.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by tcfcigvo, Yesterday, 11:39 PM
        0 responses
        5 views
        0 likes
        Last Post tcfcigvo  
        Started by BobbyWan, Yesterday, 09:15 PM
        0 responses
        9 views
        0 likes
        Last Post BobbyWan  
        Started by trader14, Yesterday, 08:23 PM
        0 responses
        3 views
        0 likes
        Last Post trader14  
        Started by ares5918, Yesterday, 02:37 PM
        2 responses
        17 views
        0 likes
        Last Post ares5918  
        Started by RTR1701, 11-15-2016, 11:38 AM
        22 responses
        1,269 views
        0 likes
        Last Post afcmaff
        by afcmaff
         
        Working...
        X