Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use global namespace?

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

    How to use global namespace?

    I have seen in some threads the term "Global namespace." If this is what it sounds like I would like to use it to make values available between indicators. Is this an ugly but workable solution? Is there an example or tutorial somewhere for this?

    Thanks.

    #2
    bjmoose, if you would like expose non plotted values for access from other scripts, please see this dedicated sample for a how to - http://www.ninjatrader.com/support/f...ead.php?t=4991

    Comment


      #3
      Bertrand,

      I see that Josh uses Update() from the getter.

      Is Update()) restricted to that context, or can I use it elsewhere. I tried using it from Plot(), to avoid making a manual call to OnBarUpdate(), but OnBarUpdate() never got called.

      It would be lovely if you could tell me what it takes for Update() to be used from Plot(). Perhaps worst case I could somehow call a getter that exists only for this purpose?

      Thanks,
      EV

      Comment


        #4
        bjmoose,

        Please do not pollute the global namespace. If you do decide to go that route, then put the data you want to share in a namespace that you have named in a way likely to be unique, and that both of your indicators know about.

        IMPORTANT NOTE: this comment is not intended to suggest that it would not be better to follow Bertrand's advice. Please do follow his advice. But if you, for some reason, do not want to, then please do not pollute the global namespace -- it is not necessary and it is bad practice.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X