I am trying to create a drop down box in the parameters. I have referenced http://www.ninjatrader.com/support/f...ad.php?t=44719 but don't know that I am acquiring all of the necessary information
In the box, I want to have the options for "No Trend" "Up" & "Down". This user defined variable will then be used int the strategy in order to tell the strategy in which direction to trade.
Here is the code in question:
Variables:
#region Variables private string trendDirection = noTrend; // holds direction of trend to determine direction of trade private string noTrend; // user defined stating no trend private string up; // user defined stating Up Trend private string down; // user defied stating Down Trend #endregion
protected override void OnBarUpdate() { switch (trendDirection) { case trendDirection = noTrend: {} case trendDirection = up: {} case trendDirection = down: {} } }
#region Properties [Description("Direction")] [GridCategory("Parameters")] public string Direction { get { return trendDirection; } set { trendDirection = value; } }
"Field initializer cannot reference the non-static field, method, or property..."
"A Constant Value is Expected" (3x)
Would you be able to help me fix these errors in order to get a proper drop down menu in the properties with those 3 parameters?
Thank you for your help
Comment