Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using a formula or variable as an input to an Indicator
Collapse
X
-
I see. You would need to code your own indicator to achieve that. This indicator would stuff <variable> *(O+H+L+C) into a DataSeries which you then could stuff into EMA. Something like (in pseudo code):
Please check out e.g. ADX implementation for details (e.g. dmPlus series).Code:Intilialize() { bufferSeries = new DataSeries(this); } OnBarUpdate() { bufferSeries.Set(variable* (Open[0]+High[0]...)); Value.Set(EMA(bufferSeries, 14)); // 14 period EMA on your series }
Comment
-
protected override void Initialize()
{
Add(new Plot(Color.Orange, PlotStyle.Line, "Plot0"));
TInput = new DataSeries(this);
}
protected override void OnBarUpdate()
{
TInput.Set((Open[0]+High[0]+Low[0]+Close[0]) *.25) ;
Plot0.Set(EMA(TInput,3));
}
The above is still giving the Errors:
The best overloaded method match for 'NinjaTrader.Data.DataSeries.Set(double)' has some invalid arguments
Argument '1': cannot convert from 'NinjaTrader.Indicator.EMA' to 'double'
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 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
554 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