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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    626 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X