Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Candle timer? How to know when a new candle is about to be printed

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

    Candle timer? How to know when a new candle is about to be printed

    Hi Folks,
    Is there a way to know how much longer a candle has before it completes and a new candle starts printing? In tradingview there is a small timer on each candle - just wondering if there is something similar in Ninja Trader. Or perhaps an indicator that does this.
    Thanks!

    #2
    Hello Problem_Gambler,

    Thank you very much for your post.

    Please add the "Bar Timer" indicator to achieve this. This indicator would count the seconds down until a time-based candle closes.

    Please don't hesitate to let me know, should you have any further questions.

    Thank you for choosing NinjaTrader!

    Comment


      #3
      Brilliant thanks!

      Comment


        #4
        @NinjaTrader_Manfred


        When I try to add the "bar timer" indicator, it says that it is disabled.

        Any ideas to solve this issue?
        Last edited by SQ009; 06-27-2023, 08:45 AM.

        Comment


          #5
          Hello SQ009,

          Thank you very much for your post and welcome to the NinjaTrader forums!

          This would usually indicate that you either are using the Bar Timer on a chart that is not based on time (e.g. a volume-, tick-, or Renko-Chart) or that the instrument currently does not receive real-time data.

          Please note, you may also find the Tick Counter and Volume Counter indicators on your platform. Those would work with the respective charts.

          Please don't hesitate to let me know, should you have any further questions!

          Comment


            #6
            Can you use the BarTimer indicator in a strategy such as below

            BarTimer[0] < 5;

            to trigger an exit using OnPriceChange strategy that would send exit market when BarTimer had counted down to 4

            I would assume this would not work in a backtest

            Comment


              #7
              Hello DTSSTS,

              Thank you for your note.

              Although you wouldn't be able to directly use the value of the bar timer indicator in the way you have indicated (such as BarTimer[0]), you could calculations similar to how the bar time works into your strategy's logic. The source code for the Bar Timer is available to view in the NinjaScript Editor, and you could see how it uses a System.Windows.Threading.DispatcherTimer object to calculate the barTimeLeft value that is drawn as a text object on the chart. You could add a timer object into your strategy to calculate if there are less than 5 seconds left on the forming bar in order to submit your exit.

              For more information, please see the following resources:Please let us know if we may be of further assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              29 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              64 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X