Thanks for your help.
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
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
-
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 frslvr, 04-11-2024, 07:26 AM
|
6 responses
105 views
1 like
|
Last Post Today, 07:21 AM | ||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
6 responses
26 views
0 likes
|
Last Post Today, 07:18 AM | ||
Started by arvidvanstaey, Yesterday, 02:19 PM
|
5 responses
14 views
0 likes
|
Last Post Today, 07:16 AM | ||
Started by Rapine Heihei, Yesterday, 08:25 PM
|
1 response
12 views
0 likes
|
Last Post Today, 07:16 AM | ||
Started by Mongo, Yesterday, 11:05 AM
|
6 responses
27 views
0 likes
|
Last Post
by Mongo
Today, 07:12 AM
|
Comment