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

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
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by reynoldsn, Today, 04:40 PM
    0 responses
    4 views
    0 likes
    Last Post reynoldsn  
    Started by Philippe56140, 04-27-2024, 02:35 PM
    6 responses
    54 views
    0 likes
    Last Post bltdavid  
    Started by ETFVoyageur, Yesterday, 06:05 PM
    7 responses
    45 views
    0 likes
    Last Post ETFVoyageur  
    Started by betsuni_123, Today, 04:20 PM
    0 responses
    11 views
    0 likes
    Last Post betsuni_123  
    Started by Aquila_Welokk, 04-29-2024, 01:14 PM
    2 responses
    22 views
    0 likes
    Last Post Aquila_Welokk  
    Working...
    X