Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Non-user defined variables

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

    Non-user defined variables

    Morning everybody!

    How would I create a non-user defined variable in beginning of code to assign a variable an initial bool = true. I don't want it in the OnBarUpdate() section, can it go into Initialize or the Variables region?

    Up until now I've only used the following in variable region and body of code:

    private int xxxxx = xxxxx;



    Now I want to have:

    bool button = true; // Initial value

    And then will switch it using 'while' statements in later code.

    #2
    Hello Stevescott05,

    You will want to declare this in the variables region.

    private bool button = true;

    The distinction between this and a user defined input is the extra code in the properties region for a user-defined input.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    19 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    182 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    335 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    260 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X