• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to draw on indicator's pannel (DrawOnPricePanel = false not working)

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

    How to draw on indicator's pannel (DrawOnPricePanel = false not working)

    hi, some help please - I'd like to draw (from a strategy) on both price and indicator's panels. When I add a plot with AddPlot() from State.SetDefaults it adds it to the Price Panel, and setting DrawOnPricePanel = false from State.Configure does not seem to help? How do I set DrawOnPricePanel = true/false properly? (from which state?)

    #2
    Hello momchi,

    Thank you for the post.

    I believe in this case you would actually want to use the strategy plotting example we have in the following link: https://ninjatrader.com/support/help..._a_ninjasc.htm

    In this sample we use two dummy indicators to retrieve values from a strategy and plot them in two panels. This would be the only way to split plotting from a strategy to a second panel in addition to the primary.

    DrawOnPricePanel only controls drawing objects so that will not help in this case, the IsOverlay setting changes the panel from the primary. IsOverlay is used in the above sample to control the indicators.

    I look forward to being of further assistance.



    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse, thank you for responding so quickly - appreciate it very, very much!
      Will review the example and comment/ask if needed.
      But, before I let you go , is my understanding of "a panel" correct? Are the Price and Indicator plot areas on a window considered "separate panels"?

      Comment


        #4
        Hello momchi,

        In a chart you have the main panel where your bars are at and that would be the Price Panel, any panel below that such as an indicator would be a separate panel. You can also apply indicators to the price panel so to correctly answer your question, yes if the indicator is below your main panel that is a separate panel.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse, thank you again -
          I am actually quite amazed of the level of service you guys provide and the knowledge that could be found under this forum!

          Looked at the code, and think that I understand it --
          except for these two statements:
          double dummyValueOne = samplePanelPlot[0]; // used to call indicators OBU historically
          double dummyValueTwo = sampleOverlayPlot[0]; // used to call indicators OBU historically

          could you please elaborate a bit more? Is accessing the values of the object will trigger re-evaluation? I commented out these, and still worked...

          Thanks!
          Last edited by momchi; 11-08-2019, 06:49 PM. Reason: added more detail

          Comment


            #6
            Originally posted by momchi View Post
            Jesse, thank you again -
            double dummyValueOne = samplePanelPlot[0]; // used to call indicators OBU historically
            double dummyValueTwo = sampleOverlayPlot[0]; // used to call indicators OBU historically
            Thanks!
            self note: these two lines are important! indicator was displayed without them, but the values/plot was wrong (did not correspond to data series in the plot) - more clarification of what it does expected from NT8 support team

            Comment


              #7
              Hello momchi,

              Thank you for the reply.

              The lines you have highlighted are used to call the indicator historically, without these lines the indicator would only be evaluated going forward in realtime. This is part of how the hosting system works for indicators and can be used logically. A small note about this can be found in the documentation for AddChartIndicator as that is normally where you would see this come up.

              https://ninjatrader.com/support/help...htsub=addchart

              Tip: If you are adding an indicator which is dependent on the correct State of the indicator, you will need to ensure that you are also calling the indicator from the strategy in OnBarUpdate(), otherwise your indicator will only process in State.RealTime for performance optimizations.
              This is a special case for indicators, if you are unsure when to call an indicator from OnBarUpdate I suggest using the following question: Does the indicator expose data, is that data being accessed from somewhere else (strategy), or needs to be calculated historically? If yes you should call the indicator or its Update() method from the host's OnBarUpdate similar to the example.


              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rontronimous, Today, 05:55 PM
              0 responses
              7 views
              0 likes
              Last Post rontronimous  
              Started by bcgeek, Today, 03:43 PM
              2 responses
              6 views
              0 likes
              Last Post bcgeek
              by bcgeek
               
              Started by Mberg, Today, 04:05 PM
              0 responses
              8 views
              0 likes
              Last Post Mberg
              by Mberg
               
              Started by dkbyond, Today, 03:52 PM
              0 responses
              4 views
              0 likes
              Last Post dkbyond
              by dkbyond
               
              Started by Newtrader101, Today, 03:09 PM
              2 responses
              6 views
              0 likes
              Last Post Newtrader101  
              Working...
              X