Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Polygon

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

    Draw Polygon

    Is there anyway to write:

    Draw.Polygon(NinjaScriptBase owner, string tag, bool isAutoScale, int anchor1BarsAgo, double anchor1Y, int anchor2BarsAgo, double anchor2Y, int anchor3BarsAgo, double anchor3Y, int anchor4BarsAgo, double anchor4Y)

    and also use templateName?

    I want to be able to use the open and closes of bars for price and Time[0].AddSeconds(150), Time[1].AddSeconds(150) for the times.

    Thank you ahead of time!

    #2
    Hello davydhnz,

    In order to use a template you need to use the following overload set:

    Draw.Polygon(NinjaScriptBase owner, string tag, bool isAutoScale, List<ChartAnchor> chartAnchors, bool isGlobal, string templateName)

    That would still let you use DateTime's for the anchors, you just have to supply the list of anchors instead of specifying the anchors individually in the overload. There is a sample that shows how to create a list of anchors in the following page. You would add the 4 anchors that you wanted along with the DateTime and Price that you wanted for each anchor.

    https://ninjatrader.com/support/help...ghtsub=Polygon

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    57 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    78 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    39 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    101 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    61 views
    0 likes
    Last Post PaulMohn  
    Working...
    X