Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help on DrawRectangle, can't get code with fill or opacity to compile

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

    Help on DrawRectangle, can't get code with fill or opacity to compile

    Hi,

    Can someone take a look at this line of code and let me know what's wrong.

    I can get the rectangle to draw but when I add parameters to change fill to red and opacity to '2', the code does not compile.

    This works:
    DrawRectangle("My rectangle" + CurrentBar, 0, EMA(13)[0], -3, EMA(13)[0] + RectangleHeight * TickSize, Color.Red);

    But when I add parameters as per DrawRectangle syntax for red areaColor and 2 areaOpacity, it does not compile
    DrawRectangle("My rectangle" + CurrentBar, 0, EMA(13)[0], -3, EMA(13)[0] + RectangleHeight * TickSize, Color.Red, Color.Red, 2);

    The compile error returned is "No overload for method "DrawRectangle" takes 8 arguments."

    Thanks in advance.

    #2
    Hello VLott,

    Thanks for your post.

    If you are going to use the opacity you will also need to specify the autoscale bool.

    For example:
    DrawRectangle("My rectangle" + CurrentBar, true, 0, EMA(13)[0], -3, EMA(13)[0] + RectangleHeight * TickSize, Color.Red, Color.Red, 2);

    DrawRectangle(string tag, bool autoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color, Color areaColor, int areaOpacity)
    http://www.ninjatrader.com/support/h...wrectangle.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Excellent. Thanks for the fast response. Worked like a charm,

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X