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

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, 07: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 GussJ, 03-04-2020, 03:11 PM
              11 responses
              3,229 views
              0 likes
              Last Post xiinteractive  
              Started by andrewtrades, Today, 04:57 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              7 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              441 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              12 views
              0 likes
              Last Post FAQtrader  
              Working...
              X