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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
152 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
305 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
244 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
345 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
176 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment