Restarting the platform did nothing to fix this.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
NT8 glitch
Collapse
X
-
NT8 glitch
My code was working properly last night with no errors over a period of 5 days in market replay and today, when I try to debug it further with Visual Studio, is stops before the script is fully loading with the error "System.NullReferenceException: 'Object reference not set to an instance of an object.' " on DMI indicator, which is a system indicator I wont be able to modify, even if I wanted to. What is even stranger is that the error seems to be completely ... well.. erroneous, since "double low1 = Low[1];" seems to me properly declared in the first place.
Restarting the platform did nothing to fix this.Tags: None
-
Hello itrader46,
Does the script give an error when running in NinjaTrader?
What is the null object?
Is Low[1] the null object?
If you add
Code:if (CurrentBar < 1) Print("less than 1"); if (Low[1] == null) Print("Low[1] is null");
Chelsea B.NinjaTrader Customer Service
-
Hello itrader46,
This error is occurring when adding the unmodified MDI indicator to a chart?
Are you using 8.0.20.1?
Is there data appearing on the chart?Last edited by NinjaTrader_ChelseaB; 12-30-2019, 09:11 AM.Chelsea B.NinjaTrader Customer Service
Comment
-
I am using 8.0.19.1, as I was not aware of any update, data appears to be normal on the chart, this is happening indeed with the unmodified system DMI indicator, without me having made any changes between last night when it worked OK and now and the DMI is added by the script itself
Comment
-
Hello itrader46,
Are you adding this indicator directly to a chart and getting this error without calling this from another script?
If so, I would like to schedule a call with you to take a look.
Currently, NinjaTrader has released 8.0.20.1.
Updates to NinjaTrader will contain the latest security updates and bug fixes, as well as new instruments and rollover dates.
To update NinjaTrader- Shutdown all programs including NinjaTrader *important
- Download NinjaTrader from the public link below
Click here to download NinjaTrader - Double click the downloaded file to execute it
- Follow the on screen instructions
- Restart NinjaTrader
Chelsea B.NinjaTrader Customer Service
Comment
-
OK, so I updated NT8 to 20.1, started the platform and I have now the exact same error that prevents me from running the script that yesterday was just fine, because NT8 seems to think a system indicator that can't be modified to begin with, is somehow not right anymore.
The DMI works fine if I apply it on a different chart and here is the code I'm using in my script, although it won't be the code, as it compiles OK and the error refers to DMI, not to my script
At this point I would appreciate some assistance, so you can call me on Skype(sorin.pascu1) before the end of play today. Please confirm
Thank you
Code:public class Divergence : Strategy { private DMI DMI1; ...... protected override void OnStateChange() { else if (State == State.Configure) { AddDataSeries(Data.BarsPeriodType.Tick, 1); AddDataSeries(Data.BarsPeriodType.Minute, 5); ......... else if (State == State.DataLoaded) { DMI1 = DMI(Closes[2], Convert.ToInt32(DmiPeriod)); DMI1.Plots[0].Brush = Brushes.Transparent; AddChartIndicator(DMI1); DMI1.Panel = 1;
Comment
-
Hello itrader46,
If you would like a call for assistance you will need to send an email to platformsupport [at] ninjatrader [dot] com.
The error is likely in the code of your script.
What is the specific line that causing an error?
Attached is a test script that adds the DMI indicator to a chart.
Does this test script also cause an error on your end?Attached FilesLast edited by NinjaTrader_ChelseaB; 12-30-2019, 03:08 PM.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello itrader46,
I'm not able to address Visual Studio.
When you state:
"there is no line in my script that generates the error"
Does this mean that if you comment out those lines in your script that the error continues to appear?
Are you having an issue with the indicator being added to the chart?
Does the error appear on the Log tab of the NinjaTrader Control Center?
Have you tested the script I have provided you and experienced the same error?
(If not, this tells you the error is in your script, and the error is not with the DMI indicator)Chelsea B.NinjaTrader Customer Service
Comment
-
"When you state:
"there is no line in my script that generates the error" "
That means that when I debug with Visual Studio, the error in my first screenshot comes up and VS highlites the line of code in DMI indicator code, not any line in my script and that happens not while the script runs, but while the script is loading.
Basically, when a script runs while in VS debug mode and it encounters an error, it stops, the VS highlights the line with the error and prints the error message, as in my screenshot.
It's quite unusual for it to point an indicator code used in the custom script, as it is for it to do that even before the script loads.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
30 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
943 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
5 views
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
28 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
Comment