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

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]);

                    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 GwFutures1988, Today, 02:48 PM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Started by ScottWalsh, 04-16-2024, 04:29 PM
                        6 responses
                        27 views
                        0 likes
                        Last Post ScottWalsh  
                        Started by frankthearm, Today, 09:08 AM
                        10 responses
                        36 views
                        0 likes
                        Last Post frankthearm  
                        Started by mmenigma, Today, 02:22 PM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by NRITV, Today, 01:15 PM
                        2 responses
                        9 views
                        0 likes
                        Last Post NRITV
                        by NRITV
                         
                        Working...
                        X