thanks
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 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=3420BertrandNinjaTrader Customer Service
-
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 ageeholdings, Today, 07:43 AM
|
0 responses
10 views
0 likes
|
Last Post
by ageeholdings
Today, 07:43 AM
|
||
Started by pibrew, Today, 06:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
14 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
9 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
12 views
0 likes
|
Last Post Today, 12:38 AM |
Comment