Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Platform loading with error
Collapse
X
-
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? ThanksTags: None
-
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
-
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
-
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
-
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
-
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 FilesJessica P.NinjaTrader Customer Service
Comment
-
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];
What's the best way to use the TrueRange series as input for the EMA?
Comment
-
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];
Jessica P.NinjaTrader Customer Service
Comment
-
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;
Code:TrueRange = new DataSeries(this);
Code:double TrRg = EMA(TrueRange,barsInAverage)[0];
Comment
-
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 FilesJessica P.NinjaTrader Customer Service
Comment
-
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
-
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]
Code:[FONT=Courier New] AddDataSeries(BarsPeriod);[/FONT]
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 Mariawilcoxi, Today, 01:32 AM
|
0 responses
1 view
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
4 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
45 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
6 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
9 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
Comment