I've built myself an indi that when a trade occurs, it prints various things about the trade to several lists, that I then print out to the output window for use in Excel.
I'm currently using the following code to add the date and time of the trade:
listDate.Add(ToDay(Time[0])); listTime.Add(ToTime(Time[0]));
20130907 (ie, 09/07/2013)
155759 (ie, 3:57:59p)
I was curious if anyone had a slick way of formatting the above code to format the outputs accordingly:
ToDay(Time[0]) --> mm/dd/yyyy --> EX: 9/7/2013 (ie, not 09/07/2013)
ToTime(Time[0]) --> hh:mm am/pm --> EX: 11:15 am or 2:13 pm (ie, no seconds and not 02:13 pm)
Also, I was curious if anyone knew of a way to grab the day of week from the Time[0] property.
Finally, I would need to know what list type the newly formatted items would be (ie, int, double, string). For instance, ToDay() and ToTime() are current lists of type int, but would the newly formatted lists be of type string? Also, would the weekday list be a type string?
I know, pretty boring stuff, but I appreciate your help if you have the time.
Thanks for your help!
Aventeren
Comment