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 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-12-2012, 05:47 PM   #1
raefon72
Member
 
Join Date: Jun 2010
Location: gold coast australia
Posts: 92
Thanks: 15
Thanked 6 times in 5 posts
Default ToTime variables

Hi Guys,

trying to make an indicator that plots out times of day as entered as a variable. Converting a variable into a time period so that deductions can be made is a little confusing. Is there an easy method for this. The below gives a time of 159000 which doesnt exist.
Thanks Raef

privateint d1Buy1 = 160000; // Default setting for D1Buy1

if( ToTime(Time[0]) == (d1Buy1 - 1000) ){DrawVerticalLine("tag2"+CurrentBar, 0, zupdotcolor);
DrawText(
"TimeZone"+ CurrentBar, bz1, 0, Low[0] - (seperation) *TickSize, Color.Black);}
raefon72 is offline  
Reply With Quote
Old 05-13-2012, 07:55 AM   #2
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,201
Thanks: 24
Thanked 1,227 times in 998 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by raefon72 View Post
Hi Guys,

trying to make an indicator that plots out times of day as entered as a variable. Converting a variable into a time period so that deductions can be made is a little confusing. Is there an easy method for this. The below gives a time of 159000 which doesnt exist.
Thanks Raef

privateint d1Buy1 = 160000; // Default setting for D1Buy1

if( ToTime(Time[0]) == (d1Buy1 - 1000) ){DrawVerticalLine("tag2"+CurrentBar, 0, zupdotcolor);
DrawText(
"TimeZone"+ CurrentBar, bz1, 0, Low[0] - (seperation) *TickSize, Color.Black);}
You might be better off using the standard C# Time structures.
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
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
Variables with ToTime Torso Strategy Development 16 02-17-2011 09:52 AM
toTime velocity General Programming 2 12-24-2009 10:02 AM
ToTime in 7 vs 6.5 ATI user Version 7 Beta General Questions & Bug Reports 9 12-15-2009 09:35 AM
ToTime John833 Strategy Development 2 11-25-2008 10:08 AM
ToTime Edgar V. General Programming 7 04-02-2008 08:57 AM


All times are GMT -6. The time now is 01:01 AM.