![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2010
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks for the forum post. When you say iDataSeries do you mean you want to change the Close[0] price for example. Or is this your own data series you created? I look forward to assisting you further.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Jan 2010
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
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! |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
This would be unfortunately unsupported if it was possible. Let me know if I can be of further assistance.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Jan 2010
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#6 | |
|
Senior Member
|
Quote:
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.
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#7 |
|
Member
Join Date: Jan 2010
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
|
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:
http://www.ninjatrader.com/support/f...200#post250200 With that ability, the secondary Close values can be adjusted and used in any NT indicator, as required. Thanks again for your comments! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using other values instead of iDataSeries in an indicator | mariomaltezi | General Programming | 2 | 04-02-2011 04:31 PM |
| changing periodicity values | Eklavya | Charting | 1 | 06-17-2010 11:25 AM |
| changing values for Fib, extensions | tomek001 | Charting | 2 | 08-29-2009 11:41 AM |
| Changing historical bar values, Median? | heech | General Programming | 3 | 12-08-2008 01:43 PM |
| Changing Values of running strategy | mjuviler | Strategy Development | 2 | 09-13-2008 04:09 AM |