Thanks for your help.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Changing IDataSeries values
Collapse
X
-
Changing IDataSeries values
Guys, I'd like to change the values of an IDataSeries object so I can pass amended bar Close values into NT indicators as I choose. The idea is to create an IDataSeries based on a secondary set of bars, something like IDataSeries MySeries = Closes[1]; then alter the most recent value of MySeries, and then use MySeries in an indicator to make calculations based on the amended Close. Is this possible? That is, is there a way to reset a single IDataSeries value (something like "MySeries.Set(0,MyValue)")?
Thanks for your help.Tags: None
-
Change Closes[1][0]
Thanks Brett. Yes -- basically, I'd like to change Closes[1][0] to a new value, then change it back to its original value (on historical bars). I was speculating that that could be done via a new IDataSeries object -- copy historical bar close values to the new IDataSeries but include my choice for the last bar (Closes[1][0]). But the actual goal is to change Closes[1][0], recalculate indicators using the new value, then change it back. Is there a way to do that?
Thanks again for your help!
Comment
-
Amend IDataSeries?
Thanks Brett. So is there a supported way to create an IDataSeries and give it values of my choice? Or to change any of it's values individually?
If not, then there is no (supported) way to input an amended series into NT indicators for calculation. Is that correct?
Thanks again for your help.
Comment
-
Your first post already shows the correct syntax to set values in a DataSeries:Originally posted by Light View PostThanks Brett. So is there a supported way to create an IDataSeries and give it values of my choice? Or to change any of it's values individually?
If not, then there is no (supported) way to input an amended series into NT indicators for calculation. Is that correct?
Thanks again for your help.
MySeries.Set(0, MyValue);
You just need to expose the DataSeries itself as public, and then you can call it from any other indicator and use its values for calculations.
The idea of changing values of the primary price series itself is probably questionable at best, and fortunately, there really is no need to do so. Just copy the values into another DataSeries that you declare, and manipulate and massage the data any which way you please.
Comment
-
Requires assigning DataSeries to Secondary Bars
Thanks koganam. The problem can indeed be solved using a dataseries, but it requires assigning the dataseries to a secondary bar series, as opposed to the primary bar array. The technique for doing that is discussed here:
With that ability, the secondary Close values can be adjusted and used in any NT indicator, as required.
Thanks again for your comments!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
580 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
335 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
102 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment