Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving Data between Indicators

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

    Moving Data between Indicators

    I think I have made an error here.

    In one indicator I put this code

    Code:
            [Browsable(false)]    
            [XmlIgnore()]        
            public int binary
            {
                get { return Binary; }
            }

    And the other I put this initialize

    Code:
            protected override void Initialize()
            {    
        
    //            dbconnection =new SqlConnection(ConnectionString);
    //            dbconnection.Open();
                
                DATA1 = Absorption(2000).binary;
    Then this is onbarupdate

    So its not updating, what am I doing wrong.

    This is working on tick by tick basis, so I have a timer loop on the 2 indicator, the one that will do the collection.

    Do I have to use update.xx somewhere and if so, will mean the 2n indicator will force the 1st indicator to calc the whole script?

    Thanks

    Tinkerz

    #2
    Hello Tinkerz,

    The basic framework for this is available in the following sample:


    Yes, for any non *Series value you would like to expose, you will need to force an Update() call in the get accessor.

    We typically use convention public = uppercase, and private = lowercase, but as long as you are accessing the public value from another script, it should be fine.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I noticed by chance that declaring

      public static double Binary=0;

      in 2 or more indicators, but in only 1 indicator placing data in it, then the other 2 or more will collect it.

      Tinkerz

      Comment


        #4
        Here is how I did it


        Make sure this is nested in namespace

        namespace NinjaTrader.Indicator
        {
        public static class GlobalVar
        {
        static double _globalValue;

        public static double GlobalValue
        {
        get { return _globalValue;
        }
        set { _globalValue = value; }
        }
        }

        Then calling from another indicator

        Total[0] = GlobalVar.GlobalValue;

        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