. Thanks,
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to make Indicator Values accessible by another indicator
Collapse
X
-
How to make Indicator Values accessible by another indicator
Hi, I have an indicator that plots each bars sum of bid and ask values. I want to make this indicators bar values store in history. This way I can access the bar history with other indicators. Is this possible? The indicator is attached. Anybody's help would be appreciated
. Thanks,
Tags: None
-
Hello woodyfox,
You would not be able to access historical bid/ask values within OnMarketData. See the 2nd note at the following link for more information.
You may use TickReplay to accomplish this, or you may consider using a secondary series of tick data, and calculate buys as those that traded above the previous trade and sells as those that traded below the last trade. This would give you a historical plot.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Here's what I got:
I pointed out in the strategy
in the indicatorCode:else if(state == state.dataloaded) { gomdeltavol = gomdeltavolume(multipler, true); addchartindicator(gomdeltavol); }
when executing it produces an errorCode:protected override void OnMarketData(MarketDataEventArgs e) { if(backtest) { if (e.MarketDataType == MarketDataType.Last) { if (e.Price >= e.Ask) { Ask[0] += e.Volume; Print(e.Volume + " contracts traded at asking price " + e.Ask); } else if (e.Price <= e.Bid) { Bid[0] += e.Volume; Print(e.Volume + " Contracts Traded at bidding price " + e.Bid); } } }
How will I correctly access the DataSeries [] and store the value of the volume in it?Indicator 'GomDeltaVolume': Error on calling 'OnMarketData' method on bar -1: 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.
Comment
-
Hello woodyfox,
Does your strategy have a current bar check? See the following for more information,
What data series are you trying to access?
Here is a link that demonstrates how to access indicator values that are not plots,
I look forward to your reply.Alan P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment