And no you can't just put in a 1000ma on the 1 minute chart. It's different.
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
200 MA of 5 min chart on 1 minute chart
Collapse
X
-
-
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 Mestor, 03-10-2023, 01:50 AM
|
13 responses
313 views
0 likes
|
Last Post Today, 07:29 AM | ||
Started by Lele2k24, Yesterday, 11:24 AM
|
7 responses
25 views
0 likes
|
Last Post Today, 07:25 AM | ||
Started by martini, Yesterday, 04:45 PM
|
2 responses
13 views
0 likes
|
Last Post
by martini
Today, 07:23 AM
|
||
Started by cre8able, 03-24-2024, 09:30 AM
|
2 responses
18 views
0 likes
|
Last Post
by cre8able
Today, 07:23 AM
|
||
Started by Adam Klaus, Yesterday, 08:21 PM
|
1 response
8 views
0 likes
|
Last Post Today, 07:18 AM |
Comment