Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

emulate global vars or global arrays/collections

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

    emulate global vars or global arrays/collections

    I need the usage of something like global variables, that are visible for alle ninjascripts in the same charts. is there any solution to achive this?

    #2
    Custom static objects? (I've tested)
    Attached properties? (I haven't tested yet)
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    Comment


      #3
      Hello ReneRose,

      There is not really a concept like that in supported NinjaScript, can you provide specific details on what scenario you are trying to complete? There is likely a better approach or specific way to do the task in NinjaScript already that does not involve global variables.






      Comment


        #4
        I would like to switch from another trading app. In that app, I have a small ecosystem of tools for testing trading signals. It is designed like a modular system, allowing individual scripts to communicate with each other. This makes it possible to test various indicators or other constructs as filters for a trading system with very little effort, without needing to rebuild the charts. For example, it is necessary for an indicator activated as a filter to pass on its status for each period. The cumulative statuses are then evaluated by the trading system.

        Comment


          #5
          Hello ReneRose,

          When using NinjaScript, there's no concept of script communication because there's already a framework in place to use those scripts without adding them to a chart. For example, if you wanted to use the SMA in your C# code, you'd simply call the SMA in the code; it doesn't need to be added to a chart or have any special communication added. The general process for NinjaScript is to create indicators that produce a plot, which is the result of its calculation. In your other scripts, you can then call that indicator to get that calculation.







          Comment


            #6
            thank you for the answer

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            89 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            143 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            83 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            257 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            334 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X