Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Not Plotting
Collapse
X
-
Jesse thanks for the response! This is what it says on the Output window...
Indicator 'FibRange': Error on calling 'OnStateChange' method: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
I do not have any script that says 5 bars ago...there is not a [5]...and there are 1825 bars on the chart....its a weekly chart and this is the default setting. Any thoughts on this error?
Comment
-
I now get no errors in the ninja output window but also no plots. Hmmm...I am attaching the .cs file...Maybe if you have time you can check it out. I thought it would be pretty straightforward but maybe i'm batting way out of my league with it.Attached Files
Comment
-
Hello Shiner452,
From the file it looks like you have incorrectly set up the plots. From this point I would suggest to do the following to make the fix easier:- In the NinjaScript editor right click on Indicators -> New.
- In the indicator wizard add the plots and configure them using the plots page
- Generate the indicator.
After doing that you will end up with a new file with the correct format for the plots. You can copy the AddPlot statements into your existing script along with the associated public properties.
You did add plots to your script but you did not add public properties for the plots which is going to make setting values difficult with this many plots.
The problem is how you defined the plot names:
These are just double numbers, your actual plots that did get created are at the bottom of the file in the properties:Code:Double Fib1; Double Fib2; Double Fib3; Double Fib4; Double Fib5; Double Fib6; Double Fib7; Double Fib8; Double Fib9; Double Fib10; Double Fib11; Double Fib12; Double Fib13; Double Fib14; Double Fib15; Double Fib16; Double Fib17; Double Fib18; Double Fib19;
Code:[Browsable(false)] [XmlIgnore] public Series<double> Fib1 { get { return Values[0]; } }
When you create plots using the wizard it generates these public properties which makes is so in OnBarUpdate you set the plots like this:
Code:Fib1[0] = Close[0]; //or whatever double number you wanted to set here
Comment
-
Jesse thanks so much its working! woot woot!
i have another question. In the attached image you can see the horizontal lines display for only the period in which they are called. currently my lines are HLines and they extend right and left depnding on the candle that is at the right side of the screen. Is there a way to make this to where they diaplay he same as in the image?
Comment
-
Hello Shiner452,
To do what you have displayed in the image would require using a Plot. You would have to plot a value for each bar, once the value changes it would end up looking like what you displayed in the image. The only problem with using a plot is that it will make an angled line between the two different values. To make a better version of that you could do something like the Pivots indicator does and use a plot to store data and custom render it using OnRender.
Comment
-
Is there a way to make it to only display the calculation for RTH? Here is how I have it set up...I have a second data series on the chart set for the weekly time frame. That data series is set for RTH only. I link that data series with the indicator but it still calculates using the full period high and low. I'd like it to only calculate using the high and low from the RTH session.
Comment
-
Hello Shiner452,
To display calculations only for RTH hours would require making a time condition which plots during those hours and then does not plot outside those hours. Adding a secondary series won't necessarily help because the plotting still has to be done on the primary series so it would be easiest to just add a time condition for the plotting and select the ETH hours when running the script.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
639 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 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
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
572 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment