Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed

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

    DrawTextFixed

    Hello,

    I know how to plot with drawtextfixed the close of current bar (COBCtrue = Close[0], COBCfalse=Close[1]) in my charts, and also calculations with it.
    But what I dont know is how to plot with drawtextfixed the time of the close of that bar. How can I get it please?

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thank you for your post.

    You can print the current bar time using Time[0] for the most recently closed bar when running OnBarClose or Time[1] when running OnEachTick/OnPriceChange.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Hello,

      thank you for your reply. This works.
      I dont know now for next step how to check if time of last bar ("Time[0]")= actual / current time (or maybe current time-1 as Time[0] might be current time-1 minute). Can Time[0] and current time be rounded to minute (to compare time by hour and minute)

      Thank you!
      Toni

      Comment


        #4
        Hello tonynt,

        Thank you for your reply.

        I'm a little unclear on what you're asking here, specifically about rounding to minute - what exactly is the use case? Time[0] will return the current timestamp of the bar. You can access the Hour and Minute of Time[0] with Time[0].Hour and Time[0].Minute if you want to just display the minute and hour of the timestamp.

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Hello,

          thank you for your reply. What I want to do is to compare the time of close last bar (most recent bar) with current time. And when it does not match then eg to plot backcolor gray. So I do not need to read every minute 24 charts the time to know if chart is updating correctly and the last bar is really the last bar. If there is an issue as it occurs sometimes and the last bar is not really the last bar because chart stopped plotting new bars eg 30 minutes ago then I see it easily without reading the numbers. When you watch many charts you trust in the bars and then decide a trade from it - and as it occurred this week I did a trade from the bars of correlated fx-pairs but this chart stopped plotting 2 hours ago. How could I know without reading databox or hover over and this for many charts... so my easy solution to avoid this is as described when last bar is not correct with time then drawtextfixed "attention" in the chart or backcoloring...

          Thank you!
          Tony

          Comment


            #6
            Hello tonynt,

            Thank you for your reply.

            The problem with the approach you're trying is that On Bar Update is event based and will only be triggered if it is receiving ticks. So if a chart is not receiving data, it would not iterate through On Bar Update.

            You may want to look at this Data Feed Monitor indicator from our publicly available user app share for an example of how you could compare the time of the last incoming data to the current time - this may pretty much do what you want out of the box:

            Updated: Oct 22, 2015 1:00 PM File – Setting and Display of NT Priority removed from Indicator Updated: Oct 9, 2015 7:10 AM File – Show and plot NonLast and Lost volume information Updated: Jun 8, 2015 2:40 PM File Text – Local clock adjustment removed. Not needed when using Dimension 4, as suggested by […]


            Please let us know if we may be of further assistance to you.

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            603 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            349 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            104 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            560 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X