NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 11-29-2010, 10:41 PM   #1
solvmatic
Member
 
Join Date: Nov 2010
Posts: 59
Thanks: 1
Thanked 4 times in 2 posts
Default convert ToTime(e.Time) integar to seconds

I am not a programmer, can some one help me with a script to convert the integar time format HHMMSS generated from ToTime() into seconds,

for example, integar time 113015 to seconds:

11x60x60 + 30x60 + 15 = 41415 seconds

Last edited by solvmatic; 11-29-2010 at 10:44 PM.
solvmatic is offline  
Reply With Quote
Old 11-30-2010, 03:31 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

I think this is would be what you're after -

Print(TimeSpan.Parse(ToTime(Time[0]).ToString()).TotalSeconds);
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-30-2010, 04:08 PM   #3
solvmatic
Member
 
Join Date: Nov 2010
Posts: 59
Thanks: 1
Thanked 4 times in 2 posts
Default

Bertrand, thanks for your reply, it works!!
hopefully i can use it to come out a indicator to show the speed of tape and order size.
solvmatic is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DayOfWeek or ToTime or Time? GreenTrade Strategy Development 10 06-11-2012 06:30 PM
e.Time vs ToTime mgin98 General Programming 4 09-28-2010 03:00 PM
ToTime (Time [0]) hegh2000 Version 7 Beta General Questions & Bug Reports 4 02-03-2010 11:03 AM
convert limit order to market after N seconds dha3936420 Strategy Development 1 08-12-2008 08:38 AM
Question about ToTime(Time[0]) mazachan General Programming 1 07-09-2007 09:08 AM


All times are GMT -6. The time now is 02:50 PM.