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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      43 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      25 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      158 views
      2 likes
      Last Post CaptainJack  
      Working...
      X