Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Global Variables

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

    Global Variables

    If I declare a variable within a strategy as global, will an indicator / other strategies be able to access it in real time? Regards and many thanks.

    #2
    Hello elliot5,

    No, strategies are created as individual instances and other scripts won't see those instances. If you wanted a strategy to share data with an indicator you would need to call that indicator from the strategy so the strategy can pass it information. That would be similar to the concept shown here: https://ninjatrader.com/support/help..._a_ninjasc.htm

    Strategies don't have a means of communicating with other strategies so sharing a value between strategies is not something I would suggest to try, you should instead combine multiple strategies logic into a single strategy if they need to share information.

    Comment


      #3
      ok thankyou - shame but I understand why NT is built that way. Regards and many thanks

      Comment

      Latest Posts

      Collapse

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