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 llanqui, Today, 11:10 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by reynoldsn, 05-10-2024, 07:04 PM
        2 responses
        21 views
        0 likes
        Last Post reynoldsn  
        Started by llanqui, Today, 10:29 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Trader146, 05-10-2024, 09:17 PM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bourasrafik, Today, 03:26 PM
        0 responses
        5 views
        0 likes
        Last Post bourasrafik  
        Working...
        X