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

Indicator writing to own panel and price panel

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

    Indicator writing to own panel and price panel

    Hi Guys,

    I had a search but couldn't find what I was looking for. Basically, I want to be able to program an indicator to draw on its own panel and on the price panel from time to time.

    Is this possible, please ?

    Thanks,
    Eric

    #2
    Unfortunately not. You can have the indicator plot on its own panel and use Draw() on the price panel though. But you can't have Draw() on both.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Unfortunately not. You can have the indicator plot on its own panel and use Draw() on the price panel though. But you can't have Draw() on both.
      Can I get a bit of clarification on this? I am debugging a problem where my indicator is not updating. The only way to keep it current is to set to "updatebaronclose". I am however drawing both the indicator plots AND calling DrawArrowDown, to draw on the price panel. I am confused about whether that is possible and secondly, if this could be causing the problems I am having with the plot not updating.

      Comment


        #4
        Hello,
        it's possible. In this figure, I plot an indicator and draw lines (divergences) in Price's panel & Indicator's panel, by programming (I use the DrawLine instruction combined with DrawOnPricePanel).

        Greetings.


        Attached Files

        Comment


          #5
          Hey cls71,

          I would love to see this code if possible. This is exactly what I am attempting to do but without any success. Could you post it or send it to me please?

          Thanks

          Comment


            #6
            That divergence code is likely to be more complicated than you need. The concept is simple:

            DrawOnPricePanel = false;
            DrawLine(....); // this draws a line on the indicator panel

            DrawOnPricePanel = true;
            DrawLine(....); // this draws a line on the price panel

            DrawOnPricePanel is initialized in the Initialize() method, and this controls where your indicator will plot. Once that is set, you can no longer change where the indicator will plot.

            However, you can subsequently reset DrawOnPricePanel. Doing so will only change where the drawing tools will plot, like DrawLine, DrawVerticalLine, DrawEllipse, etc. It won't change where the indicator itself will plot.

            -Alex

            Comment


              #7
              Thanks Alex, I will give that a try. Makes sense now that I see it written down!

              All the best...
              Tom

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 09:41 AM
              3 responses
              7 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by traderqz, Today, 09:44 AM
              2 responses
              4 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by stafe, 04-15-2024, 08:34 PM
              8 responses
              40 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by rocketman7, Today, 02:12 AM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by guillembm, Yesterday, 11:25 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X