Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 selu72, Today, 02:01 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by WHICKED, Today, 02:02 PM
      2 responses
      10 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by f.saeidi, Today, 12:14 PM
      8 responses
      21 views
      0 likes
      Last Post f.saeidi  
      Started by Mikey_, 03-23-2024, 05:59 PM
      3 responses
      51 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by Russ Moreland, Today, 12:54 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Erick  
      Working...
      X