Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ninjatrader crashing

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

    ninjatrader crashing

    My ninjatrader kept crashing in both simulated replay and bar replay. when I looked at the log I can see the weirdest errors. what can I do to prevent it?
    I am running 8.0.0.11 64-bit (Standard) - BETA

    2016-05-28 18:49:12:216|1|2|Using IS (is-us-001.ninjatrader.com/31658)
    2016-05-28 18:49:12:285|1|4|Automated trading disabled
    2016-05-28 18:49:12:607|1|32|Order entry hot keys disabled
    2016-05-28 18:49:12:624|1|4|Auto close enabled=False
    2016-05-28 18:49:33:271|3|2|Connection lost to the NinjaTrader Information Server: is-us-001.ninjatrader.com
    2016-05-28 18:50:19:247|3|4|Indicator 'S_Trading_System': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
    2016-05-28 18:50:19:603|3|4|Indicator 'S_Trading_System': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Strategy here.";
    Name = "ATMStrategySTS";
    Calculate = Calculate.OnEachTick;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = false;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = true;
    RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
    StopTargetHandling = StopTargetHandling.ByStrategyPosition;
    BarsRequiredToTrade = 300;
    }
    else if (State == State.Configure)

    {

    // Add a 5 minute Bars object - BarsInProgress index = 1
    AddDataSeries(BarsPeriodType.Minute, 30);
    AddDataSeries(BarsPeriodType.Tick, 1);


    }
    }

    #2
    I think this has got to do with the fact that I am using the following code to check what kind of market connection that I have. how do I find out the market connection provider type
    Cbi.Connection.PlaybackConnection.Status.ToString( ) == "Connected"

    Comment


      #3
      I need to know how to fix this
      • Cbi.Connection.PlaybackConnection.Status.ToString( ) == "Connected"
      • Is there a AppDomain.CurrentDomain.UnhandledException configured so atleast I can see the stack trace of the unhandled exceptions from Ninjatrader and try to see if my code has anything to do with it?

      and NT8 still continues to crash without anything logged in the log or the trace files

      In addition, I had another crash and can see the following lines in the trace log
      2016-05-30 01:04:06:118 (ib-paper) Cbi.Account.AccountItemCallback: account='DU2780' accountItem=NetLiquidationByCurrency currency=UsDollar value=*****
      2016-05-30 01:06:14:419 Gui.Chart.ChartPanel.OnRender: System.IndexOutOfRangeException: Index was outside the bounds of the array.
      at NinjaTrader.NinjaScript.NinjaScriptBase.get_Bars()
      at NinjaTrader.Gui.NinjaScript.IndicatorRenderBase.Ca lculateMinMax()
      at NinjaTrader.Gui.Chart.ChartScale.CalculateMinMax()
      at NinjaTrader.Gui.Chart.ChartPanel.CalculateMinMax()
      at NinjaTrader.Gui.Chart.Direct2DForm.RenderInit()
      2016-05-30 06:32:10:405 Server.Client.Connect: type=IS server='is-us-001.ninjatrader.com' port=31658
      Last edited by junkone; 05-30-2016, 06:00 AM.

      Comment


        #4
        Hello junkone,

        Thank you for your post.

        Can you provide the line of code you refer to with "Cbi.Connection.PlaybackConnection.Status.ToString ( ) == "Connected""? Are you trying to force a connection?

        Are you running NinjaTrader 8 beta 11? Are you doing any custom rendering in the strategy or calling any objects that have custom rendering? Are you using a custom chart style?

        Comment


          #5
          I am running 8.0.0.11 64-bit (Standard) - BETA
          1. I call a indicator from my strategy that does a drawtext
          1. I have commented the lines out and am still getting the crashes. yet here it is
            // longtrade.account = Cbi.Connection.PlaybackConnection.Status.ToString( ) == "Connected" ? "replay" : "" + "indicatorbased";
            I have it in another spot
            private DateTime getTime()
            {
            return DateTime.Now;
            // return Cbi.Connection.PlaybackConnection.Status.ToString( ) == "Connected" ? Cbi.Connection.PlaybackConnection.Now : DateTime.Now;


            }
          Last edited by junkone; 05-30-2016, 10:36 AM.

          Comment


            #6
            Hello junkone,

            Thank you for your response.

            1. What all is performed with Draw.Text or are you using graphics.DrawString?
            2. You could use the following instead: Cbi.Connection.PlaybackConnection != null

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by hazylizard, Today, 08:38 AM
            0 responses
            4 views
            0 likes
            Last Post hazylizard  
            Started by Max238, Today, 01:28 AM
            5 responses
            42 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by habeebft, Today, 07:27 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChristopherS  
            Started by AveryFlynn, Today, 04:57 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X