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

Question about RemoveDrawObject()

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

    Question about RemoveDrawObject()

    Hello,

    Is there any way to determine if RemoveDrawObject() actually removed an object in the code?

    This code removes an object, if and only if, a draw object exists at <CurrentBar - 1>.

    prevCB = CurrentBar - 1;
    tagID = prevCB.ToString() + "Buy";
    RemoveDrawObject(tagID)

    After the RemoveDrawObject() code is executed, does it end with a return code of 0 if an object was actually removed and 1 if it wasn't?

    I want to be able to do something like this ..

    if( RemoveDrawObject(tagID) = 0 ) then <do something>

    Is that supported?

    #2
    For NT7 you could check the DrawObjects collection for the specific tag id you created it with - http://www.ninjatrader.com/support/h...rawobjects.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      That worked!

      hi Bertrand,

      Thanks for the suggestion, it worked gr8.

      prevCB = CurrentBar - 1;
      tagID = prevCB.ToString() + "Sell";

      if( DrawObjects[tagID] != null)
      {
      RemoveDrawObject(CurrentBar.ToString() + "Buy");
      }
      RemoveDrawObject(tagID);

      R. C.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PeakTry, Today, 10:49 AM
      0 responses
      2 views
      0 likes
      Last Post PeakTry
      by PeakTry
       
      Started by llanqui, Today, 10:32 AM
      0 responses
      4 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by StockTrader88, 03-06-2021, 08:58 AM
      45 responses
      3,992 views
      3 likes
      Last Post johntraderuser2  
      Started by TAJTrades, Today, 09:46 AM
      0 responses
      8 views
      0 likes
      Last Post TAJTrades  
      Started by rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Working...
      X