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

Indicator based on Candle Timing

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

    Indicator based on Candle Timing

    Has anyone tried creating an indicator that marks on the candle bar the price after a certain time? IE... I want the an arrow drawn on the candlestick indicating the price that printed at exactly 10seconds after the candle open. Ideally something similar to the arrows drawn indicating where you take an entry or sell.

    #2
    Hello lazdubrocq,

    Thank you for your post.

    You can add a 10 second series and trigger actions on that series using a BarsInProgress check.

    AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm
    BarsInProgress - https://ninjatrader.com/support/help...inprogress.htm


    Or, you could use a C# timer by using TriggerCustomEvent() to trigger a price check after 10 seconds. Please see the help guide page for a code example:
    https://ninjatrader.com/support/help...ustomevent.htm

    This forum post also includes example scripts using a timer:


    Use one of the drawing methods to draw an object of your choice on the chart, like an arrow or text.
    https://ninjatrader.com/support/help...t8/drawing.htm

    Please let us know if you have any other questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      I would like the check to only occur once on the 1minute candle and only on the first 10seconds.

      Comment


        #4
        Hello lazdubrocq,

        You could do this by adding a 10 second series, which will update OnBarUpdate with BarsInProgress 1 every 10 seconds, and use a set of bools to trigger the action once per bar. (Meaning check if the bool is false to trigger the action, and when the action is triggered set the bool to true. Reset the bool to false when the primary series BarsInProgress 0 updates (or is the first tick of the bar).
        The advantage of this method is that this could be backtested.

        Or you can use a C# timer that elapses every 10 seconds that is enabled on the first tick of a new bar, and then disabled when it updates after 10 seconds.
        This would only work in real-time.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,407 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        98 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
        160 views
        0 likes
        Last Post loganjarosz123  
        Working...
        X