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

Accessing Multi Timeframe Indicator Values

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

    Accessing Multi Timeframe Indicator Values

    I think my brain took the day off!

    Scenario Using NT 6.5.10 with ZenFire:
    I trade off Volume Charts but need to access the (PeriodType.Minute,1440) chart to retrieve the ATR(14) from yesterdays daily bar. I only need to access that value once per day so I am trying to set it within the Initialize() Method for performance reasons. No matter what I do its not working. I have tried duplicating the Strategy Examples and have used my favorite key (F1).

    How can I do this?

    Thanks

    #2
    - you would need to set up a multi series strategy (please check out th esample strategy)
    - you can't use the indicators methods in Initialize() but would need to call them in OnBarUpdate and probably have some flag variable to only trigger your logic once (per day)

    Comment


      #3
      I don't think I was clear on what I am trying to accomplish so I included an image to help explain.

      First off, I am trying to build an indicator and not a strategy. I trade off of multiple time frame charts so instead of having 3 or 4 NQ charts open I am trying to place everything on one chart. I am using an SMA(20) as an example to keep it simple.

      I am looking for a way to capture the value of SMA(20) from the 2000 Volume chart and place it on a 1000 Volume chart using a Plot. So at the completion of a 1000 Volume Bar the indicator would reference the current value of the SMA(20) on the 2000 Volume Chart and Set it in a plot. The 2000 Volume Bar does NOT need to be completed.

      So the Plots of the indicator on the 1000 Volume chart would be:

      Plot1 = SMA(20) from the 1000 Volume chart
      Plot2 = SMA(20) from the 2000 Volume Chart
      Plot3 = SMA(20) from the 4000 Volume Chart

      What is the most efficient way to make the above references?
      Attached Files

      Comment


        #4
        Forgot to ask this in the previous post.

        Is there a way to reference a different time frame from the "IDataSeries inputData" in the command " SMA(IDataSeries inputData, int period) "?

        Thanks

        Comment


          #5
          Unfortunately what you wish to do (multi-time frame indicators) are not supported at this time. Multi-time are supported in strategies though. What you wish to do will be supported later this year.
          RayNinjaTrader Customer Service

          Comment


            #6
            Well... I guess that explains why I could not find a solution after spending days trying to figure it out.

            Thanks anyway. Your response times are incredible. Keep up the good work!

            Comment


              #7
              Ray,

              Thank you for this product.

              Isn't there a way we can take the values and plot them in a strategy so we could see a different timeframe in each panel? Perhaps it would not be in native format, but could be displayed symbolically?

              Example:
              MACD 5m
              MACD 10m

              Get the values of the 5m, and plot them in panel 1 and then do same for 10m and plot them in panel 2?

              Just curious. Any direction or reading you could direct me to would be great.

              Thank you,


              r2kTrader

              Originally posted by NinjaTrader_Ray View Post
              Unfortunately what you wish to do (multi-time frame indicators) are not supported at this time. Multi-time are supported in strategies though. What you wish to do will be supported later this year.

              Comment


                #8
                r2kTrader,

                Multi-time frame indicators are not supported. If you want to try plotting in a strategy please take a look at this reference sample. It is provided as an as-is solution and does come with its limitations. http://www.ninjatrader-support2.com/...ead.php?t=6651
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh,

                  Yep, got that part. I was asking Ray how to plot to a panel from within a strategy, values from different timeframes for same indicator.

                  I will look into this thread.

                  What took you so long to reply?

                  Originally posted by NinjaTrader_Josh View Post
                  r2kTrader,

                  Multi-time frame indicators are not supported. If you want to try plotting in a strategy please take a look at this reference sample. It is provided as an as-is solution and does come with its limitations. http://www.ninjatrader-support2.com/...ead.php?t=6651

                  Comment


                    #10
                    r2kTrader,

                    You add the StrategyPlot() to different panels. Then you try using the .Set to set the values of the indicator on different BarsInProgress from your strategy.

                    Untested code
                    Code:
                    StrategyPlot(0).Value.Set(SMA(BarsArray[0], 20)[0]);
                    StrategyPlot(1).Value.Set(SMA(BarsArray[1], 20)[0]);
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Plot Multiple Indicators in/on Strategy

                      Hi,

                      This is what I want to do.

                      [UPDATE]
                      SampleStrategyPlot.cs as per the 6651 thread below does indeed answer this question below. I re-read it more carefully. I hope this helps someone else.

                      [UPDATE II]
                      Just wanted to report back and say that I had success after reading the 6651 thread referenced below. Very nice. I can now see my indicator, under 1 chart, but for 3 different times. So I can see 3,5,10m results for the same indicator on one chart. This is VERY helpful in seeing how the signal looks under different time frames on top of the current timeframe.



                      1. I want to add 3 different bar series for the instrument I am running. I know how to do this.

                      2. I want to track indicator for 3 different time frames. Example: I want to plot the macd for 1,5,10 minute time frames.

                      3. I want to plot the values in sub panels below main chart.

                      can this be done?

                      If so, how?

                      I read about


                      and
                      When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability


                      But how do I (if it's possible), plot indicator value for x number of time frames (bar series?)?


                      Thank you,


                      r2kTrader
                      Last edited by r2kTrader; 02-28-2009, 10:33 AM.

                      Comment


                        #12
                        r2kTrader,

                        You do it just like in my previous example. Just call the appropriate BarsArray[].
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Waxavi, Today, 02:10 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Waxavi
                        by Waxavi
                         
                        Started by TradeForge, Today, 02:09 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post TradeForge  
                        Started by Waxavi, Today, 02:00 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post Waxavi
                        by Waxavi
                         
                        Started by elirion, Today, 01:36 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post elirion
                        by elirion
                         
                        Started by gentlebenthebear, Today, 01:30 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post gentlebenthebear  
                        Working...
                        X