Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Platform loading with error

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

    Platform loading with error

    I attached a screenshot of the error. The platform keeps starting up with an error (orange), and crashes after importing Ninjascript (red). I already tried reinstalling, but that didn't work. I'm using Ninjatrader 8.0.2.0 (Multi-Broker) on Windows 10. Maybe something isn't set up properly, as I only use this installation for Ninjatrader and a couple of other apps on a VM. How can I fix this error? Thanks
    Attached Files

    #2
    Can you clarify - NinjaTrader does not crash if you do not import NinjaScript?

    What NinjaScript are you importing? Can you attach it here?

    Comment


      #3
      It has crashed on a few occasions without importing Ninjascript, but generally it doesn't crash. When importing Ninjascript, it imports the file successfully and then immediately crashes. After a restart, it keeps working, but every time on startup, it shows the error in Orange.

      They're just indicator files in .zip format that I had exported, but I can't post them here. It also happened with sample code, and other external indicators.There's nothing wrong with the files as they've been tested on other installations.

      I think the problem started when I renamed an indicator. Since then I stopped changing the names, and just create new indicators if I want to rename them. I removed all the Ninjascript files that weren't built in to try and fix the error, but it didn't work. If it's not an easy fix, I can live with it, and later try creating new VM instead.

      Comment


        #4
        You can write in to PlatformSupport[AT]NinjaTrader[DOT]com and attach your strategies if you'd like assistance from the NinjaScript Team with your indicators.

        I would suggest a complete uninstall and reinstall as a test.
        • Close all running applications.
        • Uninstall NinjaTrader within Windows Control Panel.
        • Then manually delete the folder 'NinjaTrader 8' located under Start> My Documents.
        • Delete any NinjaTrader installation files. (This can be done by going to Start> My Computer> Search button> search for: NinjaTrader* > select Local C Disk and then press 'Search'.
        • Then you will need to clear your internet browser cache and history. You will clear this from within your internet browser (with IE, Tools-->Options, delete cookies and files, clear history).
        • Reboot your machine.
        • Once these steps are completed, download NT7 from the link below.
        • http://ninjatrader.com/PlatformDirect


        On a fresh installation of the platform, please see if the error occurs. If it does not, import indicators one at a time and make note of the changes you make to see if the issue returns.

        Comment


          #5
          Thanks, I tried to do this, but at this step it failed:
          Uninstall NinjaTrader within Windows Control Panel.

          There was no error message, but the uninstaller won't remove the program. Is there a way to remove it manually?

          Comment


            #6
            It turned out this was due to a permissions issue (somehow the built in administrator account doesn't have enough permissions to do this). I resolved it by using the Ninjatrader installer instead of Windows to remove it, and followed all the steps, and reinstalled Ninjatrader. The error didn't occur this time. I added the indicators one at a time with no error. I also have a backup of some templates and historical data. Is it ok to reload these from the backup?

            Comment


              #7
              Loading files from the backup you have should be fine. If this produces issues please let me know.

              Comment


                #8
                I'm now getting an error from one of the indicators, but this one hadn't been tested yet. I have a working version for NT7, but for NT8 adding the DataSeries is done differently. Not sure if I've done it correctly.
                Error on calling 'SetState' method: Exception has been thrown by the target of an invocation.
                Code:
                #region Variables
                		private Series<double> TrueHigh;
                		private Series<double> TrueLow; 
                		private Series<double> TrueRange; //True High - True Low
                		#endregion
                		protected override void OnStateChange()
                		{
                			if (State == State.SetDefaults)
                			{
                				Calculate									= Calculate.OnBarClose;
                				IsOverlay									= false;
                				DisplayInDataBox							= true;
                				DrawOnPricePanel							= true;
                				DrawHorizontalGridLines					= true;
                				DrawVerticalGridLines						= true;
                				PaintPriceMarkers							= true;
                				ScaleJustification							= NinjaTrader.Gui.Chart.ScaleJustification.Right;
                				//Disable this property if your indicator requires custom values that cumulate with each new market data event. 
                				//See Help Guide for additional information.
                				IsSuspendedWhileInactive					= true;
                				BarsInAverage					= 8;
                				XDays					= 1;
                				AddPlot(Brushes.MediumBlue, "Plot1");
                				AddPlot(Brushes.OrangeRed, "Plot2");
                				AddPlot(Brushes.Green, "Plot3");
                				
                			}
                			else if (State == State.Configure)
                			{
                				TrueHigh = new Series<double>(this, MaximumBarsLookBack.Infinite);
                				TrueLow = new Series<double>(this, MaximumBarsLookBack.Infinite);
                				TrueRange = new Series<double>(this, MaximumBarsLookBack.Infinite);
                			}
                		}

                Comment


                  #9
                  Thank you for your report and code sample Matts. I wasn't quite able to see the same thing you were when I added it to the attached script. Would it be possible for you to modify and return the attached script so it causes the same behavior you were seeing? This will make it easier to assist further.
                  Attached Files
                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks Jessica, your code worked, so I went through the indicator logic line by line, and there was an error generated on a line that was previously working in NT7. It uses an EMA on the TrueRange series.

                    Code:
                    double TrRg = EMA(TrueRange, BarsInAverage)[0];
                    I think the difference is that it needs ISeries<double> as input instead of Series<double>
                    What's the best way to use the TrueRange series as input for the EMA?

                    Comment


                      #11
                      TrueRange is a currently undocumented feature and, as such, is not one we can provide direct support for.

                      However, the use case you are describing is supported. NinjaTrader has an AverageTrueRange indicator, documented here.



                      You can use this as follows :

                      Code:
                      double TrRg = ATR(BarsInAverage)[0];
                      Should you require an exponential, rather than a simple, moving average, I would recommend copying and modifying the ATR's source by right-clicking the ATR's source in an editor and selecting "Save As" to give your indicator a new name.
                      Jessica P.NinjaTrader Customer Service

                      Comment


                        #12
                        I'd prefer not to do it by modifying ATR if possible. In NT7 I created this using the following code.

                        Code:
                        private DataSeries TrueRange;
                        and then in the initialize section

                        Code:
                        TrueRange = new DataSeries(this);
                        after the value was set an EMA was applied to the DataSeries

                        Code:
                        double TrRg = EMA(TrueRange,barsInAverage)[0];
                        As NT8 has broken this code, is the only way to do this by calculating the EMA within the indicator, instead of being able to apply it in this way?

                        Comment


                          #13
                          Thank you for this additional information. I had mistaken TrueRange for a NinjaTrader built-in and it was only after your comment and reviewing your code that I realized this was a user series.

                          The line of code you are referring to is not broken in NinjaTrader 8 and will work. The cause of this is your TrueRange series not being initialized.

                          While direct debugging and development services are beyond the scope of the support we may provide, as this touches many topics that are difficult to explain in words, I am attaching a copy of the code sample I posted earlier with a TrueRange series that Ninja initializes to the same BarsPeriodType and interval as the passed-in data series. This will take care of a lot of the "under the hood" maintenance of a data series for you, so you can focus on the values you would like to use in the series.

                          Please let us know if there are any other ways we can help.
                          Attached Files
                          Jessica P.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks for the code. I've been trying to work this into the indicator, but it's causing a problem with the plot values. It's plotting a horizontal line from the TrueRange data series instead of the 2nd plot value I wanted assign. I've added your code to the properties section, and I've tried using different numbers for the Values to account for the new data series, but it doesn't seem to work. How can I ensure the TrueRange series won't be assigned to the plot values?

                            Code:
                            [Browsable(false)]
                            		[XmlIgnore]
                            		public Series<double> Plot1
                            		{
                            			get { return Values[0]; }
                            		}
                            
                            		[Browsable(false)]
                            		[XmlIgnore]
                            		public Series<double> Plot2
                            		{
                            			get { return Values[1]; }
                            		}
                            
                            		[Browsable(false)]
                            		[XmlIgnore]
                            		public Series<double> Plot3
                            		{
                            			get { return Values[2]; }
                            		}

                            Comment


                              #15
                              It looks like I made a small mistake when I set up TrueRange alias, since I neglected the fact that our script had 3 other custom plots set up before our TrueRange series was added. This is a fortunate mistake, as it demonstrates how our data series indexes work. The three lines I failed to take into account toward the end of your SetDefaults section are

                              Code:
                              [FONT=Courier New]
                                              AddPlot(Brushes.MediumBlue, "Plot1");
                                              AddPlot(Brushes.OrangeRed, "Plot2");
                                              AddPlot(Brushes.Green, "Plot3");[/FONT]
                              This means that by the time we call

                              Code:
                              [FONT=Courier New]
                                              AddDataSeries(BarsPeriod);[/FONT]
                              The index for this series should be 4, not 1. We will need to change our TrueRange property to this :

                              Code:
                              [FONT=Courier New]
                                      [Browsable(false)]
                                      [XmlIgnore()]
                                      public Series<double> TrueRange
                                      {
                                          // JDP Thu Jan  5 11:32:08 MST 2017
                                          // Values[1] refers to the series we created earlier
                                          get { return Values[B][4][/B]; }[/FONT]
                                      }
                              Jessica P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              467 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,236 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Started by jclose, Yesterday, 09:37 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post jclose
                              by jclose
                               
                              Working...
                              X