• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sharing data

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

    sharing data

    as anyone shared bar data (or any structured data array) between charts?

    I realise bar objects can be added to scripts with different intervals but sometimes
    the bars numbers required are vastly different so looking for more efficient way
    to share bar/indicator data?

    looked at c# memory-mapping but can't find a suitable example.

    #2
    Hello Futurenets,

    Thank you for your note.

    You can take a data series and make it public so that you can have access to it from the other scripts
    http://www.ninjatrader.com/support/f...ead.php?t=7299
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      ok thanks

      downloaded sample and can see

      private DataSeries myDataSeries;

      but unsure how changing this to public will make data available bewteen charts?

      unless I create

      public DataSeries myUniqueName;

      and can then reference it from other scripts but only one instance could exist?

      say I wanted to create

      Daily EURUSD and make data available to 15minute EURUSD

      Daily GBPUSD and make data available to 20minute GBPUSD

      etc.

      or put something like

      namespace NinjaTrader.Indicator
      {
      partial class Indicator
      {
      Public DataSeries dailyGBPUSD;
      Public DataSeries dailyEURUSD;
      }
      }


      in UserDefinedMethods?

      but how would it know which chart interval to sync to?
      Last edited by futurenets; 03-13-2015, 11:19 AM.

      Comment


        #4
        Futurenets,

        I apologize I sent you the wrong reference sample. You set the property for public in the Properties section

        This is the one that you want -
        http://www.ninjatrader.com/support/f...ead.php?t=4991

        This will show you how to expose the data series.

        Additionally for syncing to a different time see this one -
        http://www.ninjatrader.com/support/f...ead.php?t=3572

        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          ok thanks.

          I think what's confusing me is how a chart can access a public data series of another chart?

          Comment


            #6
            Futurenets,

            After you call the class -

            MyClass().MyDataSeries[0]

            Same concept if you were getting the Diff value of MACD -

            MACD(12,25,9).Diff[0]

            http://www.ninjatrader.com/support/h...gence_macd.htm
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              ok Cal thanks but

              where did MyClass come from and what is it?

              Comment


                #8
                I was using it as an example script to use. Nothing that is real.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  ok thanks but confused

                  let say I have a 15minute chart that needs to access data in a daily chart.

                  how is this done in the script running on the 15 minute chart?

                  Comment


                    #10
                    Hello futurenets,

                    Thank you for your response.

                    You would create a script that runs on the other chart (the daily in this example) and then expose that data series - making sure it is synced to the primary series in the script and set to the desired value.

                    For example:
                    MyDataSeries.Set(Close[0]);
                    Patrick H.NinjaTrader Customer Service

                    Comment


                      #11
                      ok thanks Cal. to clarify...

                      in the Daily chart I set MyDailyDataSeries to the required values and expose with "public".

                      in my 15 minute chart I can then simply reference MyDailyDataSeries[0] and retrieve a value from this series?

                      if I have several daily charts running how do I know which one I'm using?
                      Last edited by futurenets; 03-16-2015, 03:43 AM.

                      Comment


                        #12
                        thanks Cal for your patience. got everything I need now.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Kabua, Yesterday, 11:24 PM
                        1 response
                        6 views
                        0 likes
                        Last Post koganam
                        by koganam
                         
                        Started by KandI, Today, 08:03 AM
                        2 responses
                        6 views
                        0 likes
                        Last Post KandI
                        by KandI
                         
                        Started by kujista, Yesterday, 10:33 PM
                        4 responses
                        13 views
                        0 likes
                        Last Post kujista
                        by kujista
                         
                        Started by tonynt, Today, 07:27 AM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by brownsfan019, Today, 07:23 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Working...
                        X