Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help Needed: Draw.Polygon Overload & Stroke Property

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

    Help Needed: Draw.Polygon Overload & Stroke Property

    Hi everyone,

    I'm running into a couple of persistent compilation issues in my NinjaTrader 8 indicator (an Enhanced Volume Profile) and I'm hoping to get some insights from experienced NT8 coders.

    The issues I'm facing are:

    No overload for method 'Polygon' takes 5 arguments

    I'm attempting to call the Draw.Polygon method like this:​
    Code:
    profileCurve = Draw.Polygon(this, "profile", true, points.Select(p => p.X).ToArray(), points.Select(p => p.Y).ToArray());
    ​
    but I get the error indicating no overload exists that accepts 5 arguments.

    Polygon' does not contain a definition for 'Stroke'
    I then tried to set the stroke (outline) of the polygon with:

    Code:
    profileCurve.Stroke = new Stroke(new SolidColorBrush(profileLineColor), DashStyleHelper.Solid, 1);
    ​


    however, the compiler complains that the Polygon type does not have a Stroke property (or extension method).

    I understand that NT8’s API for drawing tools is a bit rigid regarding the available overloads and properties. I'm wondering:
    • What is the proper way to construct a polygon dynamically from an array or list of points in NT8?
    • Is there a supported overload of Draw.Polygon that would let me supply my coordinates without triggering the "5 arguments" error?
    • How can I set the stroke (outline) for the polygon? Is there an alternative method or recommended approach (like using templates or another property) to define the polygon's outline?
    ​Any insights, workarounds, or sample code from anyone who’s encountered and solved these issues would be extremely helpful.

    Thanks in advance for your help!

    #2
    Hello,

    Thank you for your inquiry.

    I recommend taking a look at the Help Guide page for Draw.Polygon() as it contains all the overloads you can use. Note that none of the overloads take only 5 arguments.



    At the bottom of the page, there is sample code.

    Comment


      #3
      Hi Gaby,

      Thank you for the help. I checked the documentation again and was able to figure it out. It is working fine now

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      553 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      100 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      543 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      546 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X