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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        236 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        151 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        162 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        243 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        198 views
        0 likes
        Last Post CarlTrading  
        Working...
        X