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

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.
    JimNinjaTrader Customer Service

    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 TradeSaber, Today, 07:18 AM
      0 responses
      4 views
      0 likes
      Last Post TradeSaber  
      Started by PaulMohn, Today, 05:00 AM
      0 responses
      9 views
      0 likes
      Last Post PaulMohn  
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      6 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      17 views
      0 likes
      Last Post SantoshXX  
      Working...
      X