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
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):
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 timko, Today, 06:45 AM
|
2 responses
12 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by habeebft, Today, 07:27 AM
|
0 responses
4 views
0 likes
|
Last Post
by habeebft
Today, 07:27 AM
|
||
Started by Tim-c, Today, 03:54 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:26 AM | ||
Started by rocketman7, Today, 01:00 AM
|
1 response
10 views
0 likes
|
Last Post Today, 07:22 AM | ||
Started by wzgy0920, 04-23-2024, 09:53 PM
|
3 responses
76 views
0 likes
|
Last Post Today, 07:22 AM |
Comment