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

DrawOnPricePanel not working

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

    DrawOnPricePanel not working

    DrawOnPricePanel appears not to be working. I was trying to use DrawArrowUp & DrawArrowDown on the price panel from my indicator's code (indicator has to be on its own panel) to no avail. I did set DrawOnPricePanel to true, but it didn't work. I think this is a major annoyance and limitation and it should be fixed.

    I don't want to clone my indicator as the 2nd one to be put on the price panel just to show those arrows for there's no reason why DrawOnPricePanel should not do this.

    Version: NT 7.0.1000.4 on Win 7 Home Premium 64 bit

    #2
    Hello zlpele,

    You can draw in either the indicator panel or the price panel using this property, but not both.

    Can you please provide a code snippet we can use to see this? It's working as expected here.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I cannot post the whole thing for you'd not be able to run it - it calls some external assembly (dll) of mine which does some math computations.

      Esentially, I do the following:
      1) I set DrawOnPricePanel to false in Initialize()
      2) In the OnBarUpdate() I do:
      DrawOnPricePanel = true;
      DrawArrowDown("signal-" + CurrentBar.ToString(),0,High[0],Color.Red);
      DrawOnPricePanel = false;

      Comment


        #4
        I see - Thanks for the clarification. The issue is not with DrawOnPricePanel. This property is designed to be set one time in the Initialize() method. This allows you to draw in either price or indicator panel, but not both.

        We have this suggestion (draw in both panels) noted in our tracking system with ID # 845. Thank you for the feedback.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by zlpele View Post
          I cannot post the whole thing for you'd not be able to run it - it calls some external assembly (dll) of mine which does some math computations.

          Esentially, I do the following:
          1) I set DrawOnPricePanel to false in Initialize()
          2) In the OnBarUpdate() I do:
          DrawOnPricePanel = true;
          DrawArrowDown("signal-" + CurrentBar.ToString(),0,High[0],Color.Red);
          DrawOnPricePanel = false;
          That does not work correctly in NT7x.

          Funnily enough, whether by design or happenstance, if you set DOPP true in Initialize(), you CAN dynamically reassign it to true or false. I discovered this one quite by accident when I was trying to debug an NT6.5x indicator that would not behave right when I used it in NT7. I am reasonably certain that that was NOT the design intent: it is happenstance.

          I have kept this a secret for a while. Now that I have told them, I can but hope that they will not disable the ability in the next update.
          Last edited by koganam; 04-07-2011, 05:01 PM.

          Comment


            #6
            NT 64-bit 7.0.1000.4
            Sometimes work, sometimes no. I don't know why

            this does not.
            protected override void Initialize()

            DrawOnPricePanel = true;
            . . . . . .
            protected override void OnBarUpdate()
            {
            if (CurrentBar > 100 )
            DrawOnPricePanel = true;
            else
            DrawOnPricePanel = false;

            DrawArrowDown("signal-" + CurrentBar.ToString(),0,High[0],Color.Red);
            this draw on both panels simultaneously
            protected override void Initialize()
            DrawOnPricePanel = true;
            . . . . . .
            protected override void OnBarUpdate()

            DrawOnPricePanel = false;
            DrawText("bnum" + CurrentBar, Convert.ToString(Bars.BarsSinceSession+1-barStart0 ), 0, 1.0 , Color.Black);

            DrawOnPricePanel = true;
            DrawArrowDown("signal-" + CurrentBar.ToString(),0,High[0],Color.Red);
            some wisdom light out there?
            Last edited by Ramon; 05-24-2011, 11:57 AM.

            Comment


              #7
              Ramon, this is not a supported usage for DrawOnPricePanel. We support setting once in Initialize() only and not dynamically although some users report success with that.

              Drawing on both price panel and indicator panels remains on our feedback list with ID # 845.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                I know it Ryan , i've read almost all posts about multipanel and overriding plot, thanks for your excelent support
                Last edited by Ramon; 05-24-2011, 02:36 PM.

                Comment


                  #9
                  Not sure what you are looking for. I expect your second snippet to draw on both panels. Is that not what you were seeking to do?

                  Comment


                    #10
                    Hi, Koganam. Thank you for sharing this trick, I think is a great contribution.

                    I'm building an indicator that paint text rather than candlestick , also draw statistics at the bottom of each column. These numbers would like me were in a separate panel, because of scrolling.

                    The second snippet certainly works, but it seems that only when objects to draw are different. You can not draw arrows or text on both panels. Or maybe yes, I have not done all combinations.
                    I'm working at it..
                    Last edited by Ramon; 05-25-2011, 12:30 AM.

                    Comment


                      #11
                      Originally posted by Ramon View Post
                      Hi, Koganam. Thank you for sharing this trick, I think is a great contribution.

                      I'm building an indicator that paint text rather than candlestick , also draw statistics at the bottom of each column. These numbers would like me were in a separate panel, because of scrolling.

                      The second snippet certainly works, but it seems that only when objects to draw are different. You can not draw arrows or text on both panels. Or maybe yes, I have not done all combinations.
                      I'm working at it..
                      Yes, you can. You just have to make sure that your drawings have unique tags.

                      Comment


                        #12
                        Originally posted by Ramon View Post
                        NT 64-bit 7.0.1000.4
                        Sometimes work, sometimes no. I don't know why

                        this does not.
                        this draw on both panels simultaneously
                        some wisdom light out there?

                        Hi Ramon,

                        I ran into the exact same problem a couple weeks ago.

                        after banging my head against the wall for a couple of days, I found a solution.

                        you need to execute the draw in the price panel and the draw in the indicator panel separately.

                        try this:

                        protected override void OnBarUpdate()

                        if(FirstTickOfBar)
                        {
                        DrawOnPricePanel = false;
                        DrawText("bnum" + CurrentBar, Convert.ToString(Bars.BarsSinceSession+1-barStart0 ), 0, 1.0 , Color.Black);
                        }

                        if(FirstTickOfBar)
                        {
                        DrawOnPricePanel = true;
                        DrawArrowDown("signal-" + CurrentBar.ToString(),0,High[0],Color.Red);
                        }

                        Attached is an image drawing in both panels flawlessly.

                        RJay
                        Attached Files
                        RJay
                        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                        Comment


                          #13
                          if(FirstTickOfBar)
                          {
                          .....
                          etcetera
                          Amazing. hahahahahaha. WORKS. Otherwise don't
                          The correct sequence is to first secondary Panel and then Price Panel
                          Thanks

                          by the way- What about your head? I'm glad to know that you easily beat to the wall
                          Last edited by Ramon; 05-27-2011, 04:15 AM.

                          Comment


                            #14
                            Dopp

                            Also, make sure that when you leave OnBarUpdate, that you set DOPP back to true.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by mjairg, 07-20-2023, 11:57 PM
                            3 responses
                            213 views
                            1 like
                            Last Post PaulMohn  
                            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                            4 responses
                            544 views
                            0 likes
                            Last Post PaulMohn  
                            Started by GLFX005, Today, 03:23 AM
                            0 responses
                            3 views
                            0 likes
                            Last Post GLFX005
                            by GLFX005
                             
                            Started by XXtrader, Yesterday, 11:30 PM
                            2 responses
                            12 views
                            0 likes
                            Last Post XXtrader  
                            Started by Waxavi, Today, 02:10 AM
                            0 responses
                            7 views
                            0 likes
                            Last Post Waxavi
                            by Waxavi
                             
                            Working...
                            X