Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawOnPricePanel is Not working

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

    DrawOnPricePanel is Not working

    Using NT 7...20
    What could cause DrawOnPricePanel to not work in this ind., but work in others. Below is a portion of the ind. code. Attached is the complete ind. code. The image shows that the Line & Arrow, highlighted in the code below, are not drawing on the price panel. What might the issue be? Thanks.

    if ( IndSwHi1 > IndSwHi0
    && IndSwHi1*deltaIndicator >= Ind1 && PriceSwHi1 <= C1-deltaPrice) //Checks Divergence 2nd Sw Hi back
    {
    int BarAgo1 = CurrentBar-BarNumSwHi1;
    DrawOnPricePanel = true;
    DrawLine("PHline2"+CurrentBar.ToString(), true, BarAgo1, PriceSwHi1+(TickSize*MDF), 1, C1+(TickSize*MDF), divergenceColor, DSD, DLW);
    DrawArrowDown("ArrowDn"+CurrentBar.ToString(),true ,0,High[0]+TickSize+(TickSize*MDF),Color.Red);

    DrawOnPricePanel = false;
    DrawLine("IHline2"+CurrentBar.ToString(), true, BarAgo1, IndSwHi1, 1, Ind1, divergenceColor, DSD, DLW);
    }
    Attached Files

    #2
    zacharydw00, thanks for reporting in - we'll look into the issue shortly and get back to you.

    Thanks
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Would you mind creating an export which includes the swing Gap method, so I can give it a run here?

      Also: please set DrawOnPricePanel from the Initialize() and recheck please.

      Thanks
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Bertrand View Post
        ...
        Also: please set DrawOnPricePanel from the Initialize() and recheck please.
        Thanks
        I did have DrawOnPricePanel=True in the Initialize() section(as I read in another post), but it did not solve the problem. However, I did add DrawOnPricePanel as the first line in OnBarUpdate() as shown below, and that solved the problem.

        protected override void OnBarUpdate()
        {
        DrawOnPricePanel = true;

        BUT, this morning as the chart was running, the problem occurred again. So I added DrawOnPricePanel=True back into the Initialize() section and now it's working again. This seams to be an intermittent problem.

        If the problem occurs again, I will post a screen shot. In the mean time, I've uploaded the code and maybe you can recreate the problem. Thanks.
        Attached Files

        Comment


          #5
          The problem occurred again while the chart was running, but opening the indicator list window and clicking OK to refresh the ind. corrected the problem.

          Comment


            #6
            zacharydw00,

            DrawOnPricePanel is not a dynamic setting. You should only set it once in Initialize() and not call it at all in OnBarUpdate(). Trying to switch it true/false multiple times will not work. You have the option to either have all draw objects on the price panel or all draw objects on the indicator panel.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Could you add DrawOnPricePanel as a dynamic setting? Using it as a dynamic setting worked fine in NT 6.5. Thanks.

              Comment


                #8
                zacharydw00,

                Thanks for your suggestions here. I will forward to our development team.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  zacharydw00,

                  DrawOnPricePanel is not a dynamic setting. You should only set it once in Initialize() and not call it at all in OnBarUpdate(). Trying to switch it true/false multiple times will not work. You have the option to either have all draw objects on the price panel or all draw objects on the indicator panel.
                  That is a strange answer. We used it dynamically all the time on NT6.5, so that we could draw arrows on the price chart to align with signals on the indicator.

                  In my experience, when this was behaving flaky on NT7.0.0.20, I found that the setting is dynamic if it is set to true in Initialize(), and seems to not be dynamic if set to false in Initialize().

                  To say the least this is inconsistent behavior. In any case, not being able to draw on which panel one wishes just seems to be a bad idea all around.

                  Comment


                    #10
                    Setting it dynamic could work out in 6.5, but was never really officially supported unfortunately - it should be set in Initialize() and then not changed 'on the fly' in OnBarUpdate(). If you need different settings, we would advise using a separate indicator for this purpose then.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by wzgy0920, 04-20-2024, 06:09 PM
                    2 responses
                    26 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, 02-22-2024, 01:11 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, Yesterday, 09:53 PM
                    2 responses
                    49 views
                    0 likes
                    Last Post wzgy0920  
                    Started by Kensonprib, 04-28-2021, 10:11 AM
                    5 responses
                    192 views
                    0 likes
                    Last Post Hasadafa  
                    Started by GussJ, 03-04-2020, 03:11 PM
                    11 responses
                    3,234 views
                    0 likes
                    Last Post xiinteractive  
                    Working...
                    X