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

Removing an arrow if signal not triggered

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

    Removing an arrow if signal not triggered

    Hello,

    My strategy draws an arrow above/below a candle when certain conditions are met and triggers a trade if the next candle makes a higher high (for longs) / lower low (for shorts) than the prior candle.
    Now, if the next candle DOESN'T make a higher high or a lower low than the candle with the arrow, I'd like the arrow to disappear from the chart once the candle has closed.
    Is there an easy way to do somethig like this?

    Thanks

    #2
    Hello laocoon,

    Thanks for your post.

    Drawing objects could be removed from a chart by calling RemoveDrawObject() and specifying the tag of the drawing object you want to remove.

    See this help guide for more information about RemoveDrawObject(): https://ninjatrader.com/support/help...drawobject.htm

    If your strategy is running Calculate.OnBarClose, the strategy will process information and calculate at the close of the bar. If you are running Calculate.OnPriceChange or OnEachTick, you would need to check IsFirstTickOfBar and then call RemoveDrawObject() in that condition check.

    IsFirstTickOfBar returns true if the incoming tick is the first tick of a new bar, meaning that that current bar just closed.

    See this help guide about IsFirstTickOfBar: https://ninjatrader.com/support/help...ttickofbar.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X