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 AlessioCianini12, Today, 01:38 AM
      0 responses
      25 views
      0 likes
      Last Post AlessioCianini12  
      Started by nandhumca, Yesterday, 11:54 PM
      0 responses
      26 views
      0 likes
      Last Post nandhumca  
      Started by nandhumca, Yesterday, 11:51 PM
      0 responses
      25 views
      0 likes
      Last Post nandhumca  
      Started by ezrollin, Yesterday, 11:48 PM
      2 responses
      26 views
      0 likes
      Last Post ezrollin  
      Started by jjanguda, Yesterday, 10:15 PM
      1 response
      26 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Working...
      X