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

referencing data on a different chart

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

    referencing data on a different chart

    Is it possible to reference the results of an indicator on a different chart? If so, how?

    How do I access the time frame for a given chart from NinjaScript?
    Last edited by saroj; 08-30-2009, 06:19 PM. Reason: incorrect observation... both the CL 4R and CL 12R are displayed

    #2
    saroj,

    Unfortunately an indicator only knows what is happening on the current chart it resides in.

    To access timeframe of the chart it is currently on you can use this: http://www.ninjatrader-support.com/H...V6/Period.html
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      How to store data in a way that it can be shared across charts like a global variable

      Originally posted by NinjaTrader_Josh View Post
      saroj,

      Unfortunately an indicator only knows what is happening on the current chart it resides in.

      To access timeframe of the chart it is currently on you can use this: http://www.ninjatrader-support.com/H...V6/Period.html
      Thanks, Josh...

      ... so in NT 6.5 there is no way to create a global variable? I want to use the 12R chart to set direction/trend, but use a 4R chart to trigger entries in that direction. Any way to accomplish this?

      If no, will this change in NT7?

      Comment


        #4
        Global variables are not supported by us. You can do whatever you want in C#, but we will not be able to provide you with any guidance in this regard.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          and in NT7?

          Originally posted by NinjaTrader_Josh View Post
          Global variables are not supported by us. You can do whatever you want in C#, but we will not be able to provide you with any guidance in this regard.
          leftover question from previous post...

          Comment


            #6
            Originally posted by saroj View Post
            ... so in NT 6.5 there is no way to create a global variable?
            Not exactly a "global variable", but this thread describes how to share values between indicators/strategies.

            That thread adds detail to Exposing indicator values that are not plots, which is the most applicable sample for your situation.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Will Global Variables be available in NT7

              Originally posted by NinjaTrader_Austin View Post
              Not exactly a "global variable", but this thread describes how to share values between indicators/strategies.

              That thread adds detail to Exposing indicator values that are not plots, which is the most applicable sample for your situation.
              Thanks Austin... I could be missing something, but I read through that thread and also the one about "Exposing... values...not plots..." however I don't see how that would solve my problem. I want to know what is happening on a 12R chart (giving trend and direction) from an indicator / strategy in a 4R chart (fine tuning entries). Thus, I want to share values between different charts, not different indicators or strategies.

              I'm new to both NinjaScript and C# and OOP so excuse me if it is there in that thread and I simply don't see it or understand it.

              still wondering about NT7 in this regard.
              Last edited by saroj; 09-03-2009, 10:40 PM. Reason: more..

              Comment


                #8
                Only way you can share this information is to build it directly into a multi-time frame strategy to begin with. http://www.ninjatrader-support.com/H...ameInstruments
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  What capability will exist in NT7 for cross-chart reference?

                  Originally posted by NinjaTrader_Josh View Post
                  Only way you can share this information is to build it directly into a multi-time frame strategy to begin with. http://www.ninjatrader-support.com/H...ameInstruments
                  Josh? Anyone? (4th time I've asked)

                  Comment


                    #10
                    Originally posted by saroj View Post
                    I want to know what is happening on a 12R chart (giving trend and direction) from an indicator / strategy in a 4R chart (fine tuning entries).
                    The only way to share information between charts is to create two different indicators for each chart. It isn't possible without an indicator/strategy on each chart.

                    One indicator is applied to the 12R chart and this indicator could expose any variable inside the indicator.

                    The second indicator/strategy on the second chart (4R) would read the exposed variables from the first indicator and could then use those exposed values in it's own calculations.

                    The links I gave you earlier contain code that demonstrates this idea.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Austin View Post
                      The only way to share information between charts is to create two different indicators for each chart. It isn't possible without an indicator/strategy on each chart. OK... I'M WITH YOU SO FAR

                      One indicator is applied to the 12R chart and this indicator could expose any variable inside the indicator.

                      The second indicator/strategy on the second chart (4R) would read the exposed variables from the first indicator and could then use those exposed values in it's own calculations.

                      OK... MAKES SENSE... SO AS LONG AS THEY ARE NAMED DIFFERENTLY, THEY COULD PERFORM THE SAME FUNCTION AND THE 4R CHART COULD READ THE "EXPOSED" VALUE GENERATED FROM THE 12R CHART...

                      The links I gave you earlier contain code that demonstrates this idea.
                      YES, BUT i GOT TOTALLY THROWN OFF BY JOSH'S ORIGINAL REPLAY TO MY ORIGINAL QUESTION WHEN HE SAID "Unfortunately an indicator only knows what is happening on the current chart it resides in."

                      NOW I'M LEFT WITH TRYING TO PUT THESE TWO OPPOSITE RESPONSES TOGETHER

                      Comment


                        #12
                        The default behavior is for an indicator to not know what is going on with another chart, but that functionality is certainly possible with some programming. Please look at my post #6 in this thread.
                        AustinNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by andrewtrades, Today, 04:57 PM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by chbruno, Today, 04:10 PM
                        0 responses
                        6 views
                        0 likes
                        Last Post chbruno
                        by chbruno
                         
                        Started by josh18955, 03-25-2023, 11:16 AM
                        6 responses
                        436 views
                        0 likes
                        Last Post Delerium  
                        Started by FAQtrader, Today, 03:35 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post FAQtrader  
                        Started by rocketman7, Today, 09:41 AM
                        5 responses
                        19 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Working...
                        X