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!
See more
See less

Partner 728x90

Collapse

Using enum to change trade entry type

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using enum to change trade entry type

    I am trying to figure out how to use enum to vary how I enter a trade in a strategy. The two examples I have seen, use enum to vary a complete code line, For example,

    UniversalMovingAverage.SMA in SampleUniversalMovingAverage

    and

    Code:
    						case DrawSelection.ArrowDown:
    						{
    							DrawArrowDown("My down arrow" + CurrentBar, true, 0, High[0] + TickSize * DrawOffsetTicks, DrawColor);
    							break;
    						}
    in MACrossBuilder.

    Is it only possible to use enum in an indicator method?

    Here's what I am trying to do:
    Code:
    			myEntryOrder_L = EnterLongLimit(DefaultQuantity, Open[0], "EE_L");
    I want to be able to substitute Median[0], Open[0], Close[0], or the value of an averaging indicator, (SMA, EMA, HMA, etc.) for the Open[0] in the entry order above.
    Is this possible? If so, do you have an example I could emulate?

    I built a strategy using enum and a variable as above in SampleUniversalMovingAverage but I could never get it to compile successfully.

    Thanks for your help.

    DaveN

    #2
    As a follow on to my first question, I would like to pick the entry method to use in the strategy when I place it on a chart, so just like changing a period value only in this case the choices of entry method would be a discrete list, that the user chooses when placing the strategy on a chart and activating it. Is this what you get when using enum?
    Thanks againd
    DaveN

    Comment


      #3
      Is there a problem with how I have asked this question. No reply since 8:56 AM PDT, yet several questions after this have already been responded to?

      Comment


        #4
        Hi Daven,

        Apologies for the delayed response.

        Would you be willing to share your script so I may test the compile you are receiving.

        You are on the right track but we could just be missing a step somewhere.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          I'll have to recreate what I did, since after working on it for a few hours I gave up and deleted it so other indicators and strategies would compile. I will take another crack at it, and post what I have.
          Thanks

          Comment


            #6
            Next time just move the indicator out of the Indicators folder so you will get a successful compile. Move it back to continue your work.


            Dan
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              enum Problems

              Here's the code I have so far, and I am attaching the compile errors I get when I try to compile.
              Code:
              /* REVISION NOTES
              
              
              
              
              */
              #region Using declarations
              using System;
              using System.ComponentModel;
              using System.Diagnostics;
              using System.Drawing;
              using System.Drawing.Drawing2D;
              using System.Xml.Serialization;
              using NinjaTrader.Cbi;
              using NinjaTrader.Data;
              using NinjaTrader.Indicator;
              using NinjaTrader.Gui.Chart;
              using NinjaTrader.Strategy;
              #endregion
              
              // This namespace holds all strategies and is required. Do not change it.
              namespace NinjaTrader.Strategy
              {
                  /// <summary>
                  /// Enter the description of your strategy here
                  /// </summary>
                  [Description("Enter the description of your strategy here")]
                  public class VariableEntryTest : Strategy
                  {
                      #region Variables
              		private int stop = 6;
              		private int profit = 4; // Default setting for variable profit target.
              		private int p_Short = 3; //Period setting for the long/short EMA filter.
              //		private int period_S = 6; //Period setting for the long/short EMA filter.
              		private int p_Long = 3; // Value in ticks for limit order offset from EMA line.
              		
              		// Create a variable that stores the user's selection for trade entry value.
              		private UniversalEntry	entertype	= UniversalEntry.Open;
              		
              		// Timed Trading Variables
              		private int tt1_Start = 060000 ; // Start Time for first trading period
              		private int tt1_End = 130000 ; // End Time for first trading period
              		private int tt2_Start = 103000 ; // Start Time for second trading period
              		private int tt2_End = 103000 ; // end Time for second trading period
              
                      #endregion
              
                      /// <summary>
                      /// This method is used to configure the strategy and is called once before any strategy method is called.
                      /// </summary>
                      protected override void Initialize()
                      {
                          CalculateOnBarClose = true;
              //			Add (EMAEnvelope(P_Short, P_Long));
              			TimeInForce = Cbi.TimeInForce.Day;			
              			SetProfitTarget("", CalculationMode.Ticks, Profit);
              			
              
                      }
              		
              			private IOrder myEntryOrder_L = null;
              			private IOrder myEntryOrder_S = null;		
              		
              		protected override void OnStartUp()
              		{	
              
              		}
              
                      /// <summary>
                      /// Called on each bar update event (incoming tick)
                      /// </summary>
                      protected override void OnBarUpdate()
              		{
              			// use a switch to determine which entry value to use.
              			switch (entertype)
              			{
              				// If the order entry type is defined as Open then...
              				case UniversalEntry.Open:
              				{
              				// sets the entry value to the bar open
              					Value.Set(Open[0]);
              					break;
              				}
              				
              				// If the order entry type is defined as Close then...
              				case UniversalEntry.Close:
              				{
              				// sets the entry value to the bar close
              					Value.Set(Close[0]);
              					break;
              				}
              				
              				// If the order entry type is defined as High then...
              				case UniversalEntry.High:
              				{
              				// sets the entry value to the bar high
              					Value.Set(High[0]);
              					break;
              				}
              				
              				// If the order entry type is defined as Low then...
              				case UniversalEntry.Low:
              				{
              				// sets the entry value to the bar low
              					Value.Set(Low[0]);
              					break;
              				}
              			}
              			if (BarsInProgress != 0)
              				return;
              
              			if(Position.MarketPosition == MarketPosition.Flat)
              					{
              					SetStopLoss("", CalculationMode.Ticks, Stop, false);
              					SetProfitTarget("", CalculationMode.Ticks, Profit);
              					}
              					
              				
              			// Long Entry
              			if (Position.MarketPosition == MarketPosition.Flat
              				&& EMA(P_Short)[0] > EMA(P_Long)[0]
              				&& ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
              				{
              				myEntryOrder_L = EnterLongLimit(DefaultQuantity, UniversalEntry.Open, "EE_L");
              				}
              				
              			// Short entry
              			if (Position.MarketPosition == MarketPosition.Flat
              				&& EMA(P_Short)[0] < EMA(P_Long)[0]
              				&& ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
              				{
              				myEntryOrder_S = EnterShortLimit(DefaultQuantity, UniversalEntry.Open, "EE_S");
              				}
              			
              				
              
              
                      }
              
              
                      #region Properties
              		// Creates the user definable parameter for the trade entry type.
              		[Description("Choose a trade entry type.")]
              		[Category("Parameters")]
              		public UniversalEntry EnterType
              		{
              			get { return entertype; }
              			set { entertype = value; }
              		}
              		
              		
                      [Description("")]
                      [GridCategory("Parameters")]
                      public int Stop
                      {
                          get { return stop; }
                          set { stop = Math.Max(1, value); }
                      }
              		
                      [Description("")]
                      [GridCategory("Parameters")]
                      public int Profit
                      {
                          get { return profit; }
                          set { profit = Math.Max(1, value); }
                      }
              		
                      [Description("")]
                      [GridCategory("Parameters")]
                      public int P_Short
                      {
                          get { return p_Short; }
                          set { p_Short = Math.Max(1, value); }
                      }
              		
                      [Description("")]
                      [GridCategory("Parameters")]
                      public int P_Long
                      {
                          get { return p_Long; }
                          set { p_Long = Math.Max(1, value); }
                      }
              		
              		
                      [Description("")]
                      [Category("Parameters")]
                      public int TT1_Start
                      {
                          get { return tt1_Start; }
                          set { tt1_Start = Math.Max(000001, value); }
                      }
              		
                      [Description("")]
                      [Category("Parameters")]
                      public int TT1_End
                      {
                          get { return tt1_End; }
                          set { tt1_End = Math.Max(000001, value); }
                      }
              		
                      [Description("")]
                      [Category("Parameters")]
                      public int TT2_Start
                      {
                          get { return tt2_Start; }
                          set { tt2_Start = Math.Max(000001, value); }
                      }
              		
                      [Description("")]
                      [Category("Parameters")]
                      public int TT2_End
                      {
                          get { return tt2_End; }
                          set { tt2_End = Math.Max(000001, value); }
              		}
                      #endregion
                  }
              }
              /* Creates an enum that is assigned to UniversalMovingAverage.
              Basically it assigns a numerical value to each item in the list and the items can be referenced without the use
              of their numerical value.
              For more information on enums you can read up on it here: http://www.csharp-station.com/Tutorials/Lesson17.aspx */
              public enum UniversalEntry
              {
              	Open,
              	Close,
              	High,
              	Low,
              }
              Attached Files

              Comment


                #8
                Daven,

                You will need to set the Data Prices in a variable rather than Value.Set as this will refer to a plot series.

                Create a variable that will reference the Data Series that you can use later to use in the switch for the Close, Open, High, Low prices.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Ok,
                  I created a new double variable,

                  private double te_Price = 0; // variable to use for switching price to open trade at.

                  Then I substituted it into the switch value statement as below,

                  switch (entertype)
                  {
                  // If the order entry type is defined as Open then...
                  case UniversalEntry.Open:
                  {
                  // sets the entry value to the bar open
                  te_Price = Open;
                  break;
                  }

                  and I substituted the variable into the order entry statement:

                  myEntryOrder_L = EnterLongLimit(DefaultQuantity, te_Price[0], "EE_L");

                  but I am still getting compiler errors.

                  Strategy\VariableEntryTest.cs Cannot implicitly convert type NinjaTrader.Data.IDataSeries' to 'double' NT0029 - click for info 82 17

                  Cannot apply indexing with [] to an expression of type double.

                  Do I have to create a dataseries for this to work? If so, how do I set the value of the data series so it can be used in the order entry statement?

                  Thanks

                  DaveN
                  Last edited by daven; 08-26-2013, 03:55 PM. Reason: Wasn't done writing.

                  Comment


                    #10
                    Originally posted by daven View Post
                    Here's the code I have so far, and I am attaching the compile errors I get when I try to compile.
                    Code:
                    /* REVISION NOTES
                    
                    
                    
                    
                    */
                    #region Using declarations
                    using System;
                    using System.ComponentModel;
                    using System.Diagnostics;
                    using System.Drawing;
                    using System.Drawing.Drawing2D;
                    using System.Xml.Serialization;
                    using NinjaTrader.Cbi;
                    using NinjaTrader.Data;
                    using NinjaTrader.Indicator;
                    using NinjaTrader.Gui.Chart;
                    using NinjaTrader.Strategy;
                    #endregion
                    
                    // This namespace holds all strategies and is required. Do not change it.
                    namespace NinjaTrader.Strategy
                    {
                        /// <summary>
                        /// Enter the description of your strategy here
                        /// </summary>
                        [Description("Enter the description of your strategy here")]
                        public class VariableEntryTest : Strategy
                        {
                            #region Variables
                            private int stop = 6;
                            private int profit = 4; // Default setting for variable profit target.
                            private int p_Short = 3; //Period setting for the long/short EMA filter.
                    //        private int period_S = 6; //Period setting for the long/short EMA filter.
                            private int p_Long = 3; // Value in ticks for limit order offset from EMA line.
                            
                            // Create a variable that stores the user's selection for trade entry value.
                            private UniversalEntry    entertype    = UniversalEntry.Open;
                            
                            // Timed Trading Variables
                            private int tt1_Start = 060000 ; // Start Time for first trading period
                            private int tt1_End = 130000 ; // End Time for first trading period
                            private int tt2_Start = 103000 ; // Start Time for second trading period
                            private int tt2_End = 103000 ; // end Time for second trading period
                    
                            #endregion
                    
                            /// <summary>
                            /// This method is used to configure the strategy and is called once before any strategy method is called.
                            /// </summary>
                            protected override void Initialize()
                            {
                                CalculateOnBarClose = true;
                    //            Add (EMAEnvelope(P_Short, P_Long));
                                TimeInForce = Cbi.TimeInForce.Day;            
                                SetProfitTarget("", CalculationMode.Ticks, Profit);
                                
                    
                            }
                            
                                private IOrder myEntryOrder_L = null;
                                private IOrder myEntryOrder_S = null;        
                            
                            protected override void OnStartUp()
                            {    
                    
                            }
                    
                            /// <summary>
                            /// Called on each bar update event (incoming tick)
                            /// </summary>
                            protected override void OnBarUpdate()
                            {
                                // use a switch to determine which entry value to use.
                                switch (entertype)
                                {
                                    // If the order entry type is defined as Open then...
                                    case UniversalEntry.Open:
                                    {
                                    // sets the entry value to the bar open
                                        Value.Set(Open[0]);
                                        break;
                                    }
                                    
                                    // If the order entry type is defined as Close then...
                                    case UniversalEntry.Close:
                                    {
                                    // sets the entry value to the bar close
                                        Value.Set(Close[0]);
                                        break;
                                    }
                                    
                                    // If the order entry type is defined as High then...
                                    case UniversalEntry.High:
                                    {
                                    // sets the entry value to the bar high
                                        Value.Set(High[0]);
                                        break;
                                    }
                                    
                                    // If the order entry type is defined as Low then...
                                    case UniversalEntry.Low:
                                    {
                                    // sets the entry value to the bar low
                                        Value.Set(Low[0]);
                                        break;
                                    }
                                }
                                if (BarsInProgress != 0)
                                    return;
                    
                                if(Position.MarketPosition == MarketPosition.Flat)
                                        {
                                        SetStopLoss("", CalculationMode.Ticks, Stop, false);
                                        SetProfitTarget("", CalculationMode.Ticks, Profit);
                                        }
                                        
                                    
                                // Long Entry
                                if (Position.MarketPosition == MarketPosition.Flat
                                    && EMA(P_Short)[0] > EMA(P_Long)[0]
                                    && ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
                                    {
                                    myEntryOrder_L = EnterLongLimit(DefaultQuantity, UniversalEntry.Open, "EE_L");
                                    }
                                    
                                // Short entry
                                if (Position.MarketPosition == MarketPosition.Flat
                                    && EMA(P_Short)[0] < EMA(P_Long)[0]
                                    && ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
                                    {
                                    myEntryOrder_S = EnterShortLimit(DefaultQuantity, UniversalEntry.Open, "EE_S");
                                    }
                                
                                    
                    
                    
                            }
                    
                    
                            #region Properties
                            // Creates the user definable parameter for the trade entry type.
                            [Description("Choose a trade entry type.")]
                            [Category("Parameters")]
                            public UniversalEntry EnterType
                            {
                                get { return entertype; }
                                set { entertype = value; }
                            }
                            
                            
                            [Description("")]
                            [GridCategory("Parameters")]
                            public int Stop
                            {
                                get { return stop; }
                                set { stop = Math.Max(1, value); }
                            }
                            
                            [Description("")]
                            [GridCategory("Parameters")]
                            public int Profit
                            {
                                get { return profit; }
                                set { profit = Math.Max(1, value); }
                            }
                            
                            [Description("")]
                            [GridCategory("Parameters")]
                            public int P_Short
                            {
                                get { return p_Short; }
                                set { p_Short = Math.Max(1, value); }
                            }
                            
                            [Description("")]
                            [GridCategory("Parameters")]
                            public int P_Long
                            {
                                get { return p_Long; }
                                set { p_Long = Math.Max(1, value); }
                            }
                            
                            
                            [Description("")]
                            [Category("Parameters")]
                            public int TT1_Start
                            {
                                get { return tt1_Start; }
                                set { tt1_Start = Math.Max(000001, value); }
                            }
                            
                            [Description("")]
                            [Category("Parameters")]
                            public int TT1_End
                            {
                                get { return tt1_End; }
                                set { tt1_End = Math.Max(000001, value); }
                            }
                            
                            [Description("")]
                            [Category("Parameters")]
                            public int TT2_Start
                            {
                                get { return tt2_Start; }
                                set { tt2_Start = Math.Max(000001, value); }
                            }
                            
                            [Description("")]
                            [Category("Parameters")]
                            public int TT2_End
                            {
                                get { return tt2_End; }
                                set { tt2_End = Math.Max(000001, value); }
                            }
                            #endregion
                        }
                    }
                    /* Creates an enum that is assigned to UniversalMovingAverage.
                    Basically it assigns a numerical value to each item in the list and the items can be referenced without the use
                    of their numerical value.
                    For more information on enums you can read up on it here: http://www.csharp-station.com/Tutorials/Lesson17.aspx */
                    public enum UniversalEntry
                    {
                        Open,
                        Close,
                        High,
                        Low,
                    }
                    Strategy\VariableEntryTest.cs The name 'Value' does not exist in the current context CS0103 - click for info 81 6
                    Strategy\VariableEntryTest.cs The name 'Value' does not exist in the current context CS0103 - click for info 89 6
                    Strategy\VariableEntryTest.cs The name 'Value' does not exist in the current context CS0103 - click for info 97 6
                    Strategy\VariableEntryTest.cs The name 'Value' does not exist in the current context CS0103 - click for info 105 6
                    You are assigning values to a DataSeries that you did not create. Create a DataSeries to hold your values if that is what you want to do. You may want to call the DataSeries something other than "Value" as it will provide better clarity when you come to read the code later on. ("Value" is a reserved word for Plots in NinjaTrader indicators).
                    Strategy\VariableEntryTest.cs The best overloaded method match for 'NinjaTrader.Strategy.StrategyBase.EnterLongLimit( int double string)' has some invalid arguments CS1502 - click for info 124 22
                    Strategy\VariableEntryTest.cs Argument '2': cannot convert from 'UniversalEntry' to 'double' CS1503 - click for info 124 54
                    You have tried to pass to the IOrder, an enum where a double is expected. Where you have used the enum, instead use the double that you assigned to the DataSeries, in the switch block that processed entertype.
                    Last edited by koganam; 08-26-2013, 04:00 PM.

                    Comment


                      #11
                      Using enum to vary trade entry price choices.

                      Got it now, thanks for your help. I incorporated the indexing [0] into the variable value, then placed the variable into the order entry statement, Here's what it looks like now:

                      It compiles and runs as expected. Thanks again for your help.
                      this is going to open up a whole world of choices for setting up my strategies now.
                      DaveN

                      Code:
                      /* REVISION NOTES
                      
                      
                      
                      
                      */
                      #region Using declarations
                      using System;
                      using System.ComponentModel;
                      using System.Diagnostics;
                      using System.Drawing;
                      using System.Drawing.Drawing2D;
                      using System.Xml.Serialization;
                      using NinjaTrader.Cbi;
                      using NinjaTrader.Data;
                      using NinjaTrader.Indicator;
                      using NinjaTrader.Gui.Chart;
                      using NinjaTrader.Strategy;
                      #endregion
                      
                      // This namespace holds all strategies and is required. Do not change it.
                      namespace NinjaTrader.Strategy
                      {
                          /// <summary>
                          /// Enter the description of your strategy here
                          /// </summary>
                          [Description("Enter the description of your strategy here")]
                          public class VariableEntryTest : Strategy
                          {
                              #region Variables
                      		private int stop = 6;
                      		private int profit = 4; // Default setting for variable profit target.
                      		private int p_Short = 3; //Period setting for the long/short EMA filter.
                      //		private int period_S = 6; //Period setting for the long/short EMA filter.
                      		private int p_Long = 3; // Value in ticks for limit order offset from EMA line.
                      		private double te_Price = 0;  // variable to use for switching price to open trade at.
                      		
                      		// Create a variable that stores the user's selection for trade entry value.
                      		private UniversalEntry	entertype	= UniversalEntry.Open;
                      		
                      		// Timed Trading Variables
                      		private int tt1_Start = 060000 ; // Start Time for first trading period
                      		private int tt1_End = 130000 ; // End Time for first trading period
                      		private int tt2_Start = 103000 ; // Start Time for second trading period
                      		private int tt2_End = 103000 ; // end Time for second trading period
                      
                              #endregion
                      
                              /// <summary>
                              /// This method is used to configure the strategy and is called once before any strategy method is called.
                              /// </summary>
                              protected override void Initialize()
                              {
                                  CalculateOnBarClose = true;
                      //			Add (EMAEnvelope(P_Short, P_Long));
                      			TimeInForce = Cbi.TimeInForce.Day;			
                      			SetProfitTarget("", CalculationMode.Ticks, Profit);
                      			
                      
                              }
                      		
                      			private IOrder myEntryOrder_L = null;
                      			private IOrder myEntryOrder_S = null;		
                      		
                      		protected override void OnStartUp()
                      		{	
                      
                      		}
                      
                              /// <summary>
                              /// Called on each bar update event (incoming tick)
                              /// </summary>
                              protected override void OnBarUpdate()
                      		{
                      			// use a switch to determine which entry value to use.
                      			switch (entertype)
                      			{
                      				// If the order entry type is defined as Open then...
                      				case UniversalEntry.Open:
                      				{
                      				// sets the entry value to the bar open
                      					te_Price = Open[0];
                      					break;
                      				}
                      				
                      				// If the order entry type is defined as Close then...
                      				case UniversalEntry.Close:
                      				{
                      				// sets the entry value to the bar close
                      					te_Price = Close[0];
                      					break;
                      				}
                      				
                      				// If the order entry type is defined as High then...
                      				case UniversalEntry.High:
                      				{
                      				// sets the entry value to the bar high
                      					te_Price = High[0];
                      					break;
                      				}
                      				
                      				// If the order entry type is defined as Low then...
                      				case UniversalEntry.Low:
                      				{
                      				// sets the entry value to the bar low
                      					te_Price = Low[0];
                      					break;
                      				}
                      			}
                      			if (BarsInProgress != 0)
                      				return;
                      
                      			if(Position.MarketPosition == MarketPosition.Flat)
                      					{
                      					SetStopLoss("", CalculationMode.Ticks, Stop, false);
                      					SetProfitTarget("", CalculationMode.Ticks, Profit);
                      					}
                      					
                      				
                      			// Long Entry
                      			if (Position.MarketPosition == MarketPosition.Flat
                      				&& EMA(P_Short)[0] > EMA(P_Long)[0]
                      				&& ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
                      				{
                      				myEntryOrder_L = EnterLongLimit(DefaultQuantity, te_Price, "EE_L");
                      				}
                      				
                      			// Short entry
                      			if (Position.MarketPosition == MarketPosition.Flat
                      				&& EMA(P_Short)[0] < EMA(P_Long)[0]
                      				&& ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End )))
                      				{
                      				myEntryOrder_S = EnterShortLimit(DefaultQuantity, te_Price, "EE_S");
                      				}
                      			
                      				
                      
                      
                              }
                      
                      
                              #region Properties
                      		// Creates the user definable parameter for the trade entry type.
                      		[Description("Choose a trade entry type.")]
                      		[Category("Parameters")]
                      		public UniversalEntry EnterType
                      		{
                      			get { return entertype; }
                      			set { entertype = value; }
                      		}
                      		
                      		
                              [Description("")]
                              [GridCategory("Parameters")]
                              public int Stop
                              {
                                  get { return stop; }
                                  set { stop = Math.Max(1, value); }
                              }
                      		
                              [Description("")]
                              [GridCategory("Parameters")]
                              public int Profit
                              {
                                  get { return profit; }
                                  set { profit = Math.Max(1, value); }
                              }
                      		
                              [Description("")]
                              [GridCategory("Parameters")]
                              public int P_Short
                              {
                                  get { return p_Short; }
                                  set { p_Short = Math.Max(1, value); }
                              }
                      		
                              [Description("")]
                              [GridCategory("Parameters")]
                              public int P_Long
                              {
                                  get { return p_Long; }
                                  set { p_Long = Math.Max(1, value); }
                              }
                      		
                      		
                              [Description("")]
                              [Category("Parameters")]
                              public int TT1_Start
                              {
                                  get { return tt1_Start; }
                                  set { tt1_Start = Math.Max(000001, value); }
                              }
                      		
                              [Description("")]
                              [Category("Parameters")]
                              public int TT1_End
                              {
                                  get { return tt1_End; }
                                  set { tt1_End = Math.Max(000001, value); }
                              }
                      		
                              [Description("")]
                              [Category("Parameters")]
                              public int TT2_Start
                              {
                                  get { return tt2_Start; }
                                  set { tt2_Start = Math.Max(000001, value); }
                              }
                      		
                              [Description("")]
                              [Category("Parameters")]
                              public int TT2_End
                              {
                                  get { return tt2_End; }
                                  set { tt2_End = Math.Max(000001, value); }
                      		}
                              #endregion
                          }
                      }
                      /* Creates an enum that is assigned to UniversalMovingAverage.
                      Basically it assigns a numerical value to each item in the list and the items can be referenced without the use
                      of their numerical value.
                      For more information on enums you can read up on it here: http://www.csharp-station.com/Tutorials/Lesson17.aspx */
                      public enum UniversalEntry
                      {
                      	Open,
                      	Close,
                      	High,
                      	Low,
                      }

                      Comment


                        #12
                        Glad to hear and thanks for sharing the updated script Daven.
                        BertrandNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by nandhumca, Yesterday, 03:41 PM
                        1 response
                        12 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by The_Sec, Yesterday, 03:37 PM
                        1 response
                        11 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by vecnopus, Today, 06:15 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post vecnopus  
                        Started by Aviram Y, Today, 05:29 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post Aviram Y  
                        Started by quantismo, 04-17-2024, 05:13 PM
                        3 responses
                        27 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Working...
                        X