Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 maybeimnotrader, Today, 05:46 PM
    0 responses
    6 views
    0 likes
    Last Post maybeimnotrader  
    Started by quantismo, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post quantismo  
    Started by AttiM, 02-14-2024, 05:20 PM
    8 responses
    166 views
    0 likes
    Last Post jeronymite  
    Started by cre8able, Today, 04:22 PM
    0 responses
    8 views
    0 likes
    Last Post cre8able  
    Started by RichStudent, Today, 04:21 PM
    0 responses
    5 views
    0 likes
    Last Post RichStudent  
    Working...
    X