thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using Multiple MA Types in a Strategy
Collapse
X
-
Using Multiple MA Types in a Strategy
Can you please point me to a Sample strategy that uses multiple MA types. I have a strategy that I would like to backtest with all different types. I would like them to be available in the strategy's properties dialog box.
thanksTags: None
-
Ken, I would suggest you review this sample for working with enums - http://www.ninjatrader.com/support/f...ead.php?t=3420
-
I've added this to my strategy variables, which is the same as in the Indicator and it compiles OK
private NinjaTrader.Indicator.MAV.MAType dMAFastType = NinjaTrader.Indicator.MAV.MAType.HMA;
private NinjaTrader.Indicator.MAV.MAType dMASlowType = NinjaTrader.Indicator.MAV.MAType.SMA;
I've added this to my strategy properties, which is the same as in the indicator and it compiles OK
[Description("DMAFastType")]
[Category("Parameters")]
public NinjaTrader.Indicator.MAV.MAType DMAFastType
{
get { return dMAFastType; }
set { dMAFastType = value; }
}
[Description("DMASlowType")]
[Category("Parameters")]
public NinjaTrader.Indicator.MAV.MAType DMASlowType
{
get { return dMASlowType; }
set { dMASlowType = value; }
}
But when I add this to Initialize, I get an error, "NinjaTrader Indicator.MAV.MAType' does not contain a definition fo 'DMAFastType' ...Code - CS0117" Didn't I establish the definition with the variables and properties? What am I missing? thanks
Add(DoubleMA(DMAFastPeriod, NinjaTrader.Indicator.MAV.MAType.DMAFastType, DMASlowPeriod, NinjaTrader.Indicator.MAV.MAType.DMASlowType));
Comment
-
In thread 8# the "public " is added to Properties, it's the "Add" line that is causing the propblem (see last line thread #8). Somehow I am defining the Indicator and it's property "MAType" wrong. Can you see the problem and solution? The whole issue is that I am trying to define 2 types, a fast and a slow from the Indicator DoubleMA. I want to be able to say FROM the strategy's property dialog box, use an EMA type for the DMAFastType, as "defined" in the Indicator DoubleMA and an SMA for the DMASlowType without having to hardcode it.
Somehow I think the real issue is that I am trying to define DMAFastType, which is defined in the Indicator DoubleMA but not in MAV which is the Indicator that DoubleMA gets it's MAType from. The problem seems to be defining the property of an Indicator of an Indicator, if that makes any sense. Any help?
Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
630 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
564 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment