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

Drawing line from specific time

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

    #16
    Hello tkaboris,

    Thanks for your notes.

    Since you are processing this logic in BarsInProgress 1 it is likely drawing at the low of the added series bar when it closes.

    Ultimately, you would need to thoroughly test and debug your logic and compare it to a chart set to the added series to understand and confirm how it is behaving.

    Once you understand how your logic is evaluating, you could try placing your logic in BarsInProgress 0 so it processes on the primary series to see if this suits your overall goal..
    Brandon H.NinjaTrader Customer Service

    Comment


      #17
      ok I think i figured it out.
      Can you please help with a loop code to search for this tag and remove it then when price closed above this line ? or maybe you have an example of it..
      Thank you

      Draw.Line(this, "tag1", false, LineStartTime, High830, LineEndTime, High830, Brushes.Blue, DashStyleHelper.Solid, 2);

      Comment


        #18
        Hello tkaboris,

        Thanks for your notes.

        To remove a Draw object from the chart you could use the RemoveDrawObject() method.

        Note that you will need to pass in the exact tag name of the drawing object into the RemoveDrawObject() method to remove that specific object from the chart.

        You could loop through the DrawObjects collection to find a specific draw object.

        See the help guide documentation and reference sample linked below for more information and sample code.

        DrawObjects: https://ninjatrader.com/support/help...rawobjects.htm
        RemoveDrawObject(): https://ninjatrader.com/support/help...drawobject.htm
        SampleRemoveDrawObjects: https://ninjatrader.com/support/help...movedrawobject
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        5 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X