Did it crash NinjaTrader or did the indicator not work and throw an exception in the Control Center Log?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Ratio Chart
Collapse
X
-
Ratio indicator not working
Ray
I have tried again with ES 03-10 and NQ 03-10. With calculate on bar close = true the indicator works.
However with calculate on bar close = false causes Ninja to completely crash as soon as Apply is clicked on the indicator dialog. There is no log message.
As I have Visual Studio on the PC I am getting an error message System.StackOverFlow exception in Ninja Trader exe 6068
I notice also that the scale markings on the ratio indicator are wrong in that there are three exactly repeated scale markings on the y axis.
Hope it helpsLast edited by MicroAl; 03-02-2010, 01:25 PM.
Comment
-
Hi MicroAl,
It would seem the indicator you are trying to use is running into .NET exceptions from the advanced programming kdoren is doing with his own attempt at synchronizing bars. This would need to be debugged at the indicator level as that is where the issue is stemming from.Josh P.NinjaTrader Customer Service
Comment
-
Yes, it crashes with no error log or trace almost immediately in your scenario (^DJIA and YM 03-10 during market hours). I didn't crash for me after the close with ES 03-10 and YM 03-10, but the tick rate was much lower. For now you'll have to keep CalculateOnBarClose set to true.
Good catch on the stack overflow. I have a pretty fast computer so I would have thought it could keep up. Right now I can't tell if it's a problem with my indicator (I don't think so) or with NT7B10 (maybe something related to tick rate). I'll investigate more tomorrow.
Comment
-
The problem appears to be a bug in NT7 related to handling of Index data series when CalculateOnBarClose==false. Sometimes, a reference to Closes[1][0] will trigger an exception (Object reference not set to an instance of an object.) even though Closes[1][0] should exist, and Closes[1][1] is OK to reference.
This seems to happen whether the index data series is primary [0] or secondary[1]. The problem is triggered by referencing Closes[1][0].
How to reproduce:
1) During market hours, open a chart with 2 data series, one of them an index. I used ^DJIA and DIA, 5 minute, 5 days.
2) Open the Output window.
3) Apply the indicator KDTestCOBCFalse (attached). Repeatedly apply the indicator, wait a few seconds, reapply, etc.
You should get a error within a dozen tries or so:
Error on calling 'OnBarUpdate' method for indicator 'KDTestCOBCFalse' on bar xxxx: Object reference not set to an instance of an object.
4) The error does not appear to occur if both data series are stocks. One must be an index.Attached Files
Comment
-
kdoren,
Your indicator yields this for me on every single load attempt:
Error on calling 'OnBarUpdate' method for indicator 'KDTestCOBCFalse' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
You can't just start up the indicator and instantly start testing Closes[0] and Closes[1]. Only one of these bar contexts exist on the very first OnBarUpdate. You need to ensure the bar context you are trying to access exists before trying to access it.
Will look into Object reference though.Code:if (CurrentBarArray[0] < 0 || CurrentBarArray[1] < 0) return;Josh P.NinjaTrader Customer Service
Comment
-
I was trying to strip down the indicator as much as possible but I guess I overdid it. The problem may not be specific to an index after all, I was able to trigger an error with 2 stocks. It seems easier to trigger if the 2 bar series are set to different session times, so there are some bars in one series that are missing in the other.
Please use the attached updated version.Attached FilesLast edited by kdoren; 03-03-2010, 01:16 PM.
Comment
-
Hi... made a few intraday data charts (1 minute data) using KDoren's ratio
indicator... did this during evening when markets were closed and worked
fine - charts were looking great. Then when I opened up NT7 during next trading day, got the attached error (ninja7-bigredX.jpg).
I had even turned "calculate on bar close" to TRUE as recommended by KDoren in his posts.
Also, when I exited NT7 and went to run it again a couple minutes later, this error appeared (stillrunning-error.jpg).
Thanks
Shawn
P.S: I'm using NT7 Beta 10
Comment
-
yes, also occurs when Calculate on bar close = False.
Attached is the trace file for the most recent session when I just signed in, the workspace opened, the error occurred (big red 'X'), and then I signed right back out.
I have older tracefiles from when I was creating the workspaces/charts and the errors first occurred. let me know if you want them.
Thanks
ShawnAttached Files
Comment
-
Shawnh,
I'm inclined to wait until the next beta release before worrying about whether there is a problem with the indicator. There is already a fix being implemented which addresses crashes when CalculateOnBarClose==false; it might also affect behavior when CalculateOnBarClose==true. In other words, similar problems might exist in both cases, but be less frequent when set to true.
-Kevin
Comment
-
Further to my error I encountered (big red "X", see above). I notice that if I first fire up NT7 WITHOUT being connected to the IB datafeed, then open my workspace containing my charts, and THEN connect to the datafeed, that this problem occurs MUCH less frequently. It happened still once or twice, but at least it DOES work most of the time now.
One other question please, for either Ninja support or KDoren, when using KDoren's Ratio Indicator, sometimes it displays the ration with only one or two decimal places of precision (both on the chart and in the data box values). Is it possible somehow to increase this to 4 decimal places of precision or so?
Thanks
Shawn
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
612 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
355 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
561 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
564 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment