Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing date

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

    Printing date

    Hi everyone

    To carry out some historical tests, I know how to print out Open[0], Close[0], etc., to the Output window.

    But I'd also like to be able to print - with the price data - the date (not the time, which I don't need, as I'll be using 'Bars.BarsSinceSession') of the bar, not as an integer, but in the usual format, such as today's date

    April 17 2013

    or

    4/17/13

    Is this possible? Any suggestions will be much appreciated.

    #2
    Hello,

    The Time[0] function is going to give you both the Date and the Time.

    If all you need is the Date format and not the time, you can override this string to customize the output you want.

    For example, Time[0].ToString("D") would output : Monday, April 15, 2013

    You can do more customization to format this however you like. Please have a look at the following links for information on this:



    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks very much, Matthew, that's exactly what I was looking for.

      I've also learnt a lot more about printing and the various formats available.

      Comment

      Latest Posts

      Collapse

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