Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Removing drawing objects

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

    Removing drawing objects

    Hello everybody !

    I have a set of conditions :

    Code:
    if (				
    conditionOne== true
    && conditionTwo==false
    && conditionThree==false
    && Low[1] < Low[0])	
    
                {
     
    DrawArrowLine("My arrow line" + CurrentBar, 1, Low[0] + rangePriceLong * TickSize, 0, Low[0] + rangePriceLong * TickSize, Color.Blue);
    DrawDot("My dot" + CurrentBar, false, 0, Low[0] + -3 * TickSize, Color.Blue);
    	
                }
    everything is calculated for each incoming ticks, not at bar close.

    I want "My arrow Line" and "My dot" to disappear from the chart, if intrabar one of the condition, is not respected anymore and re-appear if during the development of the candle, the conditions are again all there.

    How to do that ?

    Thank you very much for your help !
    P.

    #2
    Hello advs108,

    Welcome to the NinjaTrader forums!

    You can add an else statement and then remove the drawing object with RemoveDrawObject().

    Code:
     
    else
    {
    RemoveDrawObject("My arrow line" + CurrentBar);
    RemoveDrawObject("My dot" + CurrentBar);
    }
    Reference sample on drawing objects.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I'll try that, thank you very much !!!!
      Very quick answer, NT team is so helpful.

      Comment


        #4
        No problem, I hope it's what you're looking for. One additional note is that intrabar calculations will require CalculateOnBarClose set to false.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pilotfo, Today, 12:50 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DTSSTS, Today, 11:35 AM
        2 responses
        11 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Started by sinpeople, Today, 07:20 AM
        2 responses
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Frank1000, Today, 03:05 AM
        5 responses
        16 views
        0 likes
        Last Post Frank1000  
        Started by fscabrera03, Yesterday, 01:18 PM
        2 responses
        26 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X