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

NT7 - How does Global Variable functionality work between charts

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

    NT7 - How does Global Variable functionality work between charts

    Hi,

    I have an indicator applied to a 5min chart and another 15min chart (different chart window). How do I access data from the 5min chart on the 15min chart (or vice versa). I was led to believe that would be a new feature for NT7?

    I have found the following post with regards to using GV.dll similar to what is used on Tradestation but have not used this yet (also this is probably not fully supported by Ninja)?

    What technology with regards to this topic is supported by NT7? Can you send me on the appropiate documentation on how to use it?

    Regards

    #2
    mefTrader, NinjaTrader 6.5 already offered to access multiple bars objects (timeframes and instruments) in a so called MultiSeries strategy, the same concept has now been made available to indicators as well with our NinjaTrader 7 -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Great will study that ....

      Is there a general section for NT7 with respect to DLLs?

      Comment


        #4
        When you add additional Bars for say 15min and 60min to your primary bars (say 5min) and Bars Back is set to 200 bars on the indicator is the 15min additional Bars in effect 200bars/3 or 200?

        Comment


          #5
          Unfortunately there's no DLL section - you could add DLL's as references in the NinjaScript editor (right click in the source code) and then use them programmatically.

          The bars / days loading would be based on your primary chart series.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            In the section "Accessing the Price Data in a Multi-Bars NinjaScript" if I have a user-defined data series say "Trend" can I access it as follows

            Trend [0] - as per normal
            Trend[1][0] - ??
            Trend[2][0] - ??

            Comment


              #7
              mefTrader, this would be the added price data arrays only, if you want to access calcs done on added series either expose them or just access the plot that would be automatically exposed.

              BertrandNinjaTrader Customer Service

              Comment


                #8
                if Trend is a Plot as follows;

                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Trend"));

                Then does the above work?

                Comment


                  #9
                  Yes, this plot is then exposed per default and you could access it with MyIndicator(Parameters).Trend[0].
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Okay so that I completely understand this

                    if my indicator has the following and is applied to say a 5min chart

                    protected override void Initialize()
                    {
                    Add(PeriodType.Minute, 15);
                    Add(PeriodType.Minute, 60);
                    }



                    protected override void OnBarUpdate()
                    {
                    if (BarsInProgress == 0)
                    {
                    Ov_Trend.Set(Trend[0]+Trend[1][0]+Trend[2][0]); // Overall Trend is the sum of 5min,15min, 60min
                    //Ov_Trend and Trend are defined as plots
                    }
                    }

                    Comment


                      #11
                      mefTrader, more likely this since you need to point then to the BarsArray used -

                      Ov_Trend.Set(Trend[0]+Trend(BarsArray[1][0]+Trend[BarsArray2][0]);
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Ok great - I will test it out!

                        Comment


                          #13
                          This multi timeframes on the same chart - for multi times between different charts refer to

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by TraderG23, 12-08-2023, 07:56 AM
                          9 responses
                          382 views
                          0 likes
                          Last Post Gavini
                          by Gavini
                           
                          Started by oviejo, Today, 12:28 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post oviejo
                          by oviejo
                           
                          Started by pechtri, 06-22-2023, 02:31 AM
                          10 responses
                          125 views
                          0 likes
                          Last Post Leeroy_Jenkins  
                          Started by judysamnt7, 03-13-2023, 09:11 AM
                          4 responses
                          59 views
                          0 likes
                          Last Post DynamicTest  
                          Started by ScottWalsh, Yesterday, 06:52 PM
                          4 responses
                          36 views
                          0 likes
                          Last Post ScottWalsh  
                          Working...
                          X