• 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

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 MNinjaTrader 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 MNinjaTrader 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 MNinjaTrader 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 Steve L, Today, 10:04 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post Steve L
                            by Steve L
                             
                            Started by marianfed, Today, 09:47 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post marianfed  
                            Started by hir04068, Today, 09:29 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post hir04068  
                            Started by iq200, 03-11-2018, 07:49 PM
                            24 responses
                            1,008 views
                            0 likes
                            Last Post mrlucky1x  
                            Started by DavidHP, Today, 08:18 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post DavidHP
                            by DavidHP
                             
                            Working...
                            X