Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't DrawRectangle

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

    Can't DrawRectangle

    What am I missing? Have this code segment in a new indicator and it no filled rectangle shows is displayed:

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    Overlay = true;

    }
    protected override void OnBarUpdate()
    {
    if (CurrentBar < 10)
    return;

    DrawRectangle("tag1"+CurrentBar.ToString(), true, 10, Low[10], 0,High[0], Color.Cyan,Color.Cyan,1);
    }

    #2
    Hi Miker,

    Thank you for your post.

    I used your code exactly and it drew rectangles as shown in the screenshot.

    Make sure you compile by hitting F5 and then remove and add the indicator again.
    Attached Files
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I did the same thing using a new name for the indicator "MyRectangle" in NinjaTrader 6.5 and it works fine just as you indicated. However, I then imported into NT 7Beta9 and nothing is displayed. When I posted the original message, I had been working in NT7....

      Hi Mike,

      Are there any error messages in the log tab of the control center?
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Mike,

        Thanks. We will look into it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Mike,

          Instead of pressing the report button to respond, please use the Reply button to post directly into the thread.

          It is expected that the right click context menu does not have copy, but it will work the way you have outlined with Ctrl C.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Will do Josh! Thought I was using Post Quick Reply....

            Comment


              #7
              Hi miker !

              We removed a bug where drawing rectangles from indicator with DrawRectangle(...) was not working while there is a template of the chart rectangle definition in place.

              The fix will be available with the next update of NinjaTrader.

              Thanks for reporting,
              Christian
              ChristianSenior Software Developer

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X