Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

output time stamp for bar index

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

    output time stamp for bar index

    i'm having issues with debugging an indicator and i need to output the time stamp for specific bars... the indicator names the bars LastPeakTsi, PrevPeakTsi, ThirdPeakTsi etc. and uses the bar index keeping track of the peaks and valleys until another confirmed peak or valley comes along and pushes the last one out... since the bar index is more cumbersome to deal with on a chart i was hoping to output the bar time stamp next to the bar number in my output window for troubleshooting...
    how does one do this ? searched around for "output bar time" and other ways but didn't uncover anything...
    thanks/w

    one of my debugging print strings:

    Print("Last Tsi Peak Bar# "+ LastPeakBar);
    Print("Previous Tsi Peak Bar# "+ PrevPeakBar);
    Print("Third Tsi Peak Bar# "+ ThirdPeakBar);
    Print("Fourth Tsi Peak Bar# "+ FourthPeakBar);

    looking for something like Time[LastPeakBar] to add after +LastPeakBar on the output line

    #2
    Hello stafe,

    Thanks for your post.

    You could use Bars.GetTime(LastPeakBar) to get the timestamp associated with the specific peak at index LastPeakBar.

    You could also consider: Time[CurrentBar-LastPeakBar] which would return the same result.

    Let us know if you have any additional questions.

    Comment


      #3
      woah, i didn't realize i could do math inside a bar index bracket [ ]... super cool...

      thanks

      Comment

      Latest Posts

      Collapse

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