Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript Editor Bool Flags Features request

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

    Ninjascript Editor Bool Flags Features request

    Can this be implemented to the Ninjascript Editor?

    Adding this function to the F2 (Insert Snippet) Menu:​

    Code:
        #region BOOL FLAGS:
    
            #region SCOPE: CLASS | doOnce Bool Flag Class Scope Variables
    
                private bool doOnce = false;
    
            #endregion
    
            #region SCOPE: OnBarUpdate() ACTION BLOCK — SUB-SCOPE: IF STATEMENT CONDITION BLOCK |  SET  doOnce Bool Flag
                if (<YOUR CONDITIONS HERE>
                    && (doOnce == false) )
                {
                    doOnce = true;
                }
            #endregion
    
    
            #region SCOPE: OnBarUpdate() ACTION BLOCK — SUB-SCOPE: IF STATEMENT ACTION BLOCK |  RESET doOnce Bool Flag
    
                if (IsFirstTickOfBar)
                {
                    doOnce = false;
                }
    
            #endregion
    
        #endregion​

    #2
    Hello PaulMohn,

    Thank you for your post.

    I see you have made several suggestions to be added to the F2 code snippet menu. This suggestion is more specific than the types of snippets that are added and listed in the help guide, so it likely wouldn't be implemented because it is more of a combination of some existing snippets. The snippets listed are commonly used bar values, plots/lines, arithmetic, event handler methods, control statements (such as if, for, switch), and draw methods as listed in the help guide on this page:


    I did submit a request to add region and #endregion to the code snippet shortcuts, though for something as specific as this I suggest pinning it to your Windows clipboard so you have it handy to paste it into your scripts as needed. I mentioned this on your other thread here:


    Thank you for using NinjaTrader.

    Comment


      #3
      The idea is to use templates for the repetitive structures to be readily editable, so we don't have to look for it outside of the Ninjascript editor.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      587 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      341 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X