Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Global Variables

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

    Global Variables

    Hi,

    I have data that I need accessable throughout many charts and columns. It is calculated with an indicator using many AddSeries calls. So I dont want to create a seperate instance for 50 rows and 10 columns - as that would be 500 instances of the same indicator. Is there a way to create just one global instance of the indicator and access that data, if needed?

    One idea would be to run a chart that runs an indicator, and store the results in a global variable.. Then I can create a custom column that can read those variables.. is that possible? how would i go about doing that please?


    Also, I am just curious, if I have an indicator that is called by many different columns and rows on the market analyzer, and the settings for the indicator are exactly the same, and the indicator uses multiple addseries calls, is the indicator going to load that data and process it many times? or will the results be cached?


    Thanks in advance.

    #2
    Hello KhaosTrader,

    You could see the following example demonstrating the use of using a static class. The limitation of this approach would be you could access values such as a double or int, however wouldn’t be able to access values as part of a series, for example the value of series of type double 5 bars ago.



    Please let us know if you need further assistance.
    Last edited by NinjaTrader_AlanP; 06-16-2017, 01:36 PM.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 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
    553 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