And no you can't just put in a 1000ma on the 1 minute chart. It's different.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
200 MA of 5 min chart on 1 minute chart
Collapse
X
-
-
Hello stockgoblin,
Are you wanting to do this from the code or just on a chart using the system indicators?
Please see the following video which demonstrates how to overlay an indicator which is calculated from one data series onto another:
MatthewNinjaTrader Product Management
-
Hey, that's great thanks. When I try it though my computer gets bogged down pretty bad. I think an indicator would be less intrusive on processing power. IS it possible as an indicator?
Also, I'd like to upgrade my computer. What should I upgrade first so Ninjatrader runs more smoothly and doesn't lag as much from having too many rays drawn on my charts?
Comment
-
stockgoblin,
Yes, this would be possible by using a custom indicator. You would need to use the Add() method to add the secondary data series to the chart and then tell the MA indicator to calculate from this data series.
More information on working with Multi Series Indicators can be found below:
The most important factor would be your CPU. I would also suggest reviewing our Performance Tips to ensure the best performance out of NinjaTrader:
MatthewNinjaTrader Product Management
Comment
-
Okay, I put the Add(PeriodType.Minute, 5); into the SMA indicator code but I'm having problems figuring out where to put the BarsArray in the following so it references the 5 minute data.
if (CurrentBar == 0)
Value.Set(Input[0]);
else
{
double last = Value[1] * Math.Min(CurrentBar, Period);
if (CurrentBar >= Period)
Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
else
Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
}
Any idea?
Comment
-
stockgoblin,
Rather than duplicate the system SMA's logic, you can simply reference the SMA() function and add this as a plot.
Code:protected override void Initialize() { Add(PeriodType.Minute, 1); Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0")); Overlay = true; } protected override void OnBarUpdate() { // Ensures that the plot is drawn on the primary data series if (BarsInProgress == 0) { // Sets Plot0 to the SMA of the 5 minute data series Plot0.Set(SMA([B]BarsArray[1][/B], Period)[0]); }MatthewNinjaTrader Product Management
Comment
-
Hi, I'm just having trouble understanding.
Sorry to question your code but...
did you mean: Add(PeriodType.Minute, 5); instead of Add(PeriodType.Minute, 1); as I'm trying to put the SMA from the 5 minute data series onto the 1 minute chart
and I'm getting: The name 'Plot0' does not exist in the current context
for Plot0.Set(SMA(BarsArray[1], Period)[0]); - is this to be: Value.Set(SMA(BarsArray[1], Period)[0]); ???
I'm new to coding so I'm trying to reference the SMA indicator included in Ninjatrader and alter it to plot from the 5 minute data series.
Any help is appreciated. Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
577 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment