Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how do I change strategy variable 'myInput0' from integer to double?

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

    how do I change strategy variable 'myInput0' from integer to double?

    how do I change strategy variable 'myInput0' from integer to double?

    'myInput0' was created by the strategy wizard. it's not that I didn't try make the change.. when I tried to do the variable type change i got into code where wizard generated comments told me I should not be. I was scared off after trying to modity that off limits code and getting deeper and deeper into error messages. .

    #2
    Hello joemiller,

    Is your strategy still setup to use the Strategy Wizard or did you unlock your strategy?
    JCNinjaTrader Customer Service

    Comment


      #3
      strategy is unlocked

      Comment


        #4
        Hello joemiller,

        Thanks for the information.

        So there are going to be two places that you will need to change the variable type in.

        The first is in the Variables region like you mentioned.

        Code:
        #region Variables
                // Wizard generated variables
                private double myInput0 = 1; // Default setting for MyInput0
                // User defined variables (add any user defined variables below)
        #endregion
        The second is the Properties section of the code after OnBarUpdate()

        Code:
        protected override void OnBarUpdate()
        {
                // Condition set 1
        }
        
        #region Properties
        [Description("")]
        [GridCategory("Parameters")]
        public double MyInput0
        {
             get { return myInput0; }
             set { myInput0 = Math.Max(1, value); }
        }
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X