Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output file name with StreamWriter

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

    Output file name with StreamWriter

    Hi,
    (1) I've benefited a lot from NT StreamWriter. Thank you so much.
    (2) I've created private string path2 = "D:\\data\\CL30Minute.txt"; to store the text.
    (3) I'm more concerned about daily intra day values.How could I append the current date automatically to the file name by adding some codes within your script? ( The output file name will then looks like 20101228CL30Minute.txt ; 20101229CL30Minute.txt etc )
    Thanks and Happy New Year To all NT staffs.
    Last edited by m. khalid; 12-29-2010, 11:59 AM.

    #2
    Hello m. khalid,

    We're glad you find this utility useful. You can use DateTime.Now to pull the current system time.

    If you just wanted the day portion of this, can use ToDay(DateTime.Now)
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hello RyanM,
      (1) ToDay(DateTime.Now) seems like returning the current date.
      (2) What if my DataSeries start date is set to 2010-11-23, I'd like the date to return as 20101123 as well? Thanks.

      Comment


        #4
        If you'd like to return the time from your chart's time stamp, you can use ToDay (Time[0])

        If you want to capture this on the first bar:

        if (CurrentBar == 0)
        double myStartDate = ToDay (Time[0]);
        Last edited by NinjaTrader_RyanM1; 12-29-2010, 02:20 PM.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        27 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        183 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        335 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        260 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X