NinjaTrader Support Forum  

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 02-15-2010, 12:32 PM   #1
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default Color and Time as Variables

I have some indicators that change the back color upon certain conditions. I'd like to allow the user to select the color as a variable but can't find a way to provide that as an input (like you can for lines). Can anyone tell me how to do that?

Also some indicators only are active during certain time windows. Similarly, is there a way to allow the user to input times as variables?

Thanks.
Richard Von is offline  
Reply With Quote
Old 02-15-2010, 01:31 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello Richard,

Thank you for your post.

Please see the article below on creating user definable Color Inputs:
http://www.ninjatrader-support2.com/...ead.php?t=4977

There isn't an equivalent guide on user definable custom times. Working with DateTime properties is more C# related than NinjaScript. The article below provides advice on working with Date/Time objects in NinjaScript, but you may need to look at some of the C# reference samples to achieve what you want.
http://www.ninjatrader-support2.com/...ad.php?t=19292


http://msdn.microsoft.com/en-us/libr...me(VS.71).aspx
NinjaTrader_RyanM is offline  
Reply With Quote
Old 02-17-2010, 07:39 AM   #3
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for the posts. I've downloaded them and am working on it.
Richard Von is offline  
Reply With Quote
Old 02-17-2010, 10:42 AM   #4
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default

I got the color inputs going fine. Thanks so much.

I think I am following how to manipulate times from the sample you attached, but not sure how to imput a time from the user. Any help?
Richard Von is offline  
Reply With Quote
Old 02-17-2010, 11:07 AM   #5
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi Richard,

Unfortunately this is outside the scope of support we provide. May be easier to accept an INT representing time and work with that.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 02-17-2010, 12:49 PM   #6
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

Hi Richard,

you could try to define a property as DateTime or TimeSpan and test how the result would look like.

Regards
Ralph
Ralph 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
The maximum of two variables Shansen Indicator Development 3 07-13-2009 04:45 AM
How to sum 2 time variables pmaglio General Programming 10 02-11-2009 10:29 AM
Using variables eswap0 General Programming 2 06-07-2008 05:56 PM
Chart background color change - defined time intervals astra Indicator Development 1 03-12-2008 08:38 PM
Limited use of variables andy2001 General Programming 5 03-04-2008 03:47 PM


All times are GMT -6. The time now is 06:28 PM.