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

plotting an indicator from higher range frame

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

    plotting an indicator from higher range frame

    I have developed a few indicators and I have problems finding a suitable example/code to draw the secondary's timeframe my own indicator(not the system's indicator). I have 5 and 8 range types charts and want to draw both indicators on the first chart(5 range). I understand I have to add both time frames, then sync them(do I need to?) and .. I need to plot them on the price panel.
    How do I call the the second indicator to apply to the second time frame?
    Any directions, examples? Very much appreciated.
    Thanks

    #2
    Hello,

    You can tell an indicator or drawing object to plot from the higher time frame by using BarsArray[1].

    Please see our Help Guide on this for more information:



    I'm also including a recent thread where we gave an example of how plot a 200 SMA of 5 min chart on 1 minute chart

    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you for the response.
      My indicator has a number of public DataSeries plots, so when I use, your suggested syntax, Plot0.Set(DG4.DOT(BarsArray[1], 1)[0]); complains that DG$)
      Yet when I apply it to the DG4 only, it plots in the color of the Plot0, not sure which value of the DG4. I should be able to get to the value of individual plots within my original DG4 indicator as they are publicly exposed
      Thanks
      Attached Files

      Comment


        #4
        Hello,

        Thanks for the note.

        Please insure that you are following this guide for exposing indicator values that are not plots.



        Let me know if I can be of further assistance.

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          Hello,

          Thanks for the note.

          Please insure that you are following this guide for exposing indicator values that are not plots.



          Let me know if I can be of further assistance.
          Thanks Brett
          They are standard plots with public access though

          Comment


            #6
            Thanks for clarification.

            Most likely not declared public correctly then.

            Can you please check in the properties section of the indicator is it setup here as a Plot? Can you past in the properties section for DOT from the indicator file?

            I look forward to assisting you further.

            Comment


              #7
              Originally posted by NinjaTrader_Brett View Post
              Thanks for clarification.

              Most likely not declared public correctly then.

              Can you please check in the properties section of the indicator is it setup here as a Plot? Can you past in the properties section for DOT from the indicator file?

              I look forward to assisting you further.
              Thanks. In the DG4 indicator the DOT definitions are as follows:
              #region Properties
              [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
              [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
              public DataSeries DOT
              {
              get { return Values[0]; }
              }
              and in

              protected override void Initialize()
              {


              Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "DOT"));


              But I cannot change the access to the Initinialize()? So what is my solution?
              Thanks
              Last edited by DLatNT; 10-18-2011, 02:20 PM.

              Comment


                #8
                Hello,

                In this case I would need to test the indicator on my side unfortunately. As I do not see any issue with what you have here other then the property does not have a set method but it should be fine.

                Please send this indicator to support at ninjatrader dot com ATTN: Brett in the subject line and I will take a look into it.

                I look forward to assisting you further.

                Comment


                  #9
                  Thanks Brett BUT..
                  In the indicator other than the calculation in OnBarUpdate() I do not do anything fancy
                  if (CurrentBar >3)
                  {
                  DOT.Set((HLC[1]+HLC[2]+HLC[3])/3);
                  }

                  Comment


                    #10
                    Sounds good. Still would need to test it on my side since I'm not sure whats going on.

                    All it takes is one wrong digit.

                    -Brett

                    Comment


                      #11
                      Originally posted by NinjaTrader_Brett View Post
                      Sounds good. Still would need to test it on my side since I'm not sure whats going on.

                      All it takes is one wrong digit.

                      -Brett
                      Brett,
                      Thanks again. I did send you the files but I got it - in the call for an original indicator I was asking for its public members after the class name instead of after the brackets ending the call == the same as below
                      KeltnerChannel.Upper(Close,2,20) = this was my original call
                      KeltnerChannel(Close,2,20).Upper == is the correct call
                      So I was doing that with my indicator DG41.DOT(BarsArray[1],1) instaead of DG31(BarsArray[1],1).DOT
                      let you know when I need further assistance
                      Thanks

                      Comment


                        #12
                        Excellent.

                        Yea should got that on your example call but overlooked it it seems. Would have found it with running the script though and checking it myself.

                        Thanks for letting me know h ave a great rest of the day!

                        Comment


                          #13
                          Now, that I go my multirange indicators - I see issues with syncing the time(range) frames. How does it work? I have read the instructions about Multi-Time Frame and Instruments, however, the display does not always reflect what is showing on the individual time(range)- frames bars' charts. Is there anything, from other people's experience, I should be doing without any further explanations?
                          Thanks in advance

                          Comment


                            #14
                            Can you please specify exactly what is not showing on the individual time frames?

                            Do you mean the indicators not showing up? Do you receive any errors on the Log tab of the Control Center when this occurs?
                            MatthewNinjaTrader Product Management

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by chbruno, Today, 04:10 PM
                            0 responses
                            3 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
                            6 views
                            0 likes
                            Last Post FAQtrader  
                            Started by rocketman7, Today, 09:41 AM
                            5 responses
                            19 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by frslvr, 04-11-2024, 07:26 AM
                            9 responses
                            127 views
                            1 like
                            Last Post caryc123  
                            Working...
                            X