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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      318 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      246 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X