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 Stanfillirenfro, Today, 07:23 AM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      2 responses
      21 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by olisav57, Yesterday, 07:39 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by cocoescala, 10-12-2018, 11:02 PM
      7 responses
      944 views
      0 likes
      Last Post Jquiroz1975  
      Started by oviejo, Today, 12:28 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X