Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add a variable in a strategy

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

    Add a variable in a strategy

    Good morning,
    I created a strategy and all is okay, but at the beginning, I forget a variable and I would want to add a new variable.
    I tried to write in the code and change the part "variable" and the part"properties" but don't work.
    How do I do for this without create again a strategy please?

    Thank's a lot for your help and scuse for my poor english, because I'm french.

    #2
    Hello,

    To make changes to your code, go to Tools -> Edit NinjaScript -> Strategy... -> Select the strategy you were working on and click OK.

    If it was made with the Wizard, the Wizard will pop back up and allow you to make changes and add variables.

    If the Code pops up you can add variables to the #region Variables section
    It may look something like this
    All the Variables go between the #region and #endregion
    any lines with // are comments that are not read by the system
    Code:
            #region Variables
            // Wizard generated variables
            private int myCustomIntVariable = 1; // Default setting for MyInput0
            // User defined variables (add any user defined variables below)
            private double myCustomDouble = 10.5;
            #endregion
    Please let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X