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
How to Access Close[5] for a TimeSeries added manually to chart, not via Add()?
Collapse
X
-
Hello EquityTrader,
Thanks for your note.
Unfortunately there are no supported way of doing it. You can however use the unsupported ChartControl class to access the manually added Bar array on the chart. A sample code will be like
Code:if (ChartControl.BarsArray >=2) ChartControl.BarsArray[1].GetClose(idx);
Leave a comment:
-
How to Access Close[5] for a TimeSeries added manually to chart, not via Add()?
Hello,
I have a single-TimeSeries indicator that I've applied to a chart with one data series (SPY), and I can access my indicator's Closes[0][5] with no problem.
However, when I manually add a second TimeSeries to the chart (GLD) by right clicking on the NinjaTrader Chart and choosing a second TimeSeries, this second time series is not also added to the indicator on the chart, so when I call Closes[1][5] from within my indicator, an exception is thrown because my indocator still only has 1 TimeSeries.
How can I access TimeSeries data for the second series added manually to the chart, for instance how can I get the value for the GLD Close 5 bars ago, like Closes[1][5]?
I noticed that the ChartControl property of my indicator has meta-data about both time series in its Bars and BarsArray properties, such as the COUNT of the GLD and SPY bars, but I can't find a collection of actual TimeSeries data, like Closes or Highs, in either the Indicator properties or the indicator's CharetControl properties.
Any ideas?
Thanks in advance!
EquityTraderTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by funk10101, Today, 09:43 PM
|
0 responses
4 views
0 likes
|
Last Post
by funk10101
Today, 09:43 PM
|
||
Started by pkefal, 04-11-2024, 07:39 AM
|
11 responses
36 views
0 likes
|
Last Post
by jeronymite
Today, 09:37 PM
|
||
Started by bill2023, Yesterday, 08:51 AM
|
8 responses
44 views
0 likes
|
Last Post
by bill2023
Today, 09:27 PM
|
||
Started by yertle, Today, 08:38 AM
|
6 responses
26 views
0 likes
|
Last Post
by ryjoga
Today, 09:17 PM
|
||
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
24 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
Leave a comment: