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 03-30-2009, 02:36 AM   #1
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default DashStyle.Style enum?

tying to include an option in the "Parameters" section of the Indicator Window to select the DashStyle options along with the Color options that I already have which work correctly

Code:
#region Variables
// Wizard generated variables
private Color lineColor = Color.Cyan;
privateint line_Size = 1;
private DashStyle style = DashStyle.Custom;
Code:
// Serialize our Color object
[Browsable(false)]
publicstring StyleSerialize
{
get { return NinjaTrader.Gui.Design.SerializableDashStyle.ToString(style); }//SerializableColor
set { style = NinjaTrader.Gui.Design.SerializableDashStyle.FromString(value); }
}
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 08:19 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

duck_CA,

Unfortunately this is outside the scope of what we can offer support for. Thank you for understanding.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-30-2009, 08:27 AM   #3
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default No Problem

I understand Josh...Ninja has been extremely helpful and appreciate it...

Can you tell me if this is even possible?

Thanks again
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 08:34 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Technically, yes, but unfortunately I just don't have any information on how you could proceed to realize it though.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-30-2009, 08:36 AM   #5
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Thanks Josh

where this is a will...there's a way...lol
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 01:02 PM   #6
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

DashStyle is an enumeration, is that true, duck_CA? If so, wouldn't an enumeration serialised by the C#- compiler automaticaly? I thought so. Have you tried just to define a property for your dash style to see, how it works?

Regards
Ralph
Ralph is offline  
Reply With Quote
Old 03-30-2009, 01:24 PM   #7
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Thanks Ralph

Sorry but I can't seem to understand what you mean as this stuff is very challenging for me...

I need somehow to try and do what you had mentioned but not sure where to start

thanks
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 01:35 PM   #8
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

I understand. In the reference sample section is an example, how to define an own enum to be used with the property grid. I would try to install it and to modify it for your dash style.

http://www.ninjatrader-support2.com/...ead.php?t=3420

Regards
Ralph
Ralph is offline  
Reply With Quote
Old 03-30-2009, 01:37 PM   #9
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default Thanks

Thank you for pointing me in the right direction Ralph !
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 01:40 PM   #10
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

If you don't get it working that (simple) way, post it again. We will find a solution.

Regards
Ralph
Ralph is offline  
Reply With Quote
Old 03-30-2009, 02:19 PM   #11
duck_CA
Senior Member
 
Join Date: Jan 2008
Location: sacramento CA
Posts: 181
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Yahoo to duck_CA Send a message via Skype™ to duck_CA
Default I think this should work

Ralph...
Thanks for everything...This seems to work

jason
Code:
#region Variables
private DashStyle hlinestyle = DashStyle.Solid; 
Code:
protectedoverridevoid OnBarUpdate()
{
DrawHorizontalLine("Current_price",Close[0],LineColor,HorizLineStyle,line_Size);
}
Code:
#region Properties
 
[Description("Horizontal line style")]
[Category("Parameters")]
public DashStyle HorizLineStyle
{
get { return hlinestyle; }
set { hlinestyle = value; }
}
duck_CA is offline  
Reply With Quote
Old 03-30-2009, 02:24 PM   #12
Ralph
Senior Member
 
Join Date: Jul 2008
Posts: 527
Thanks: 0
Thanked 9 times in 6 posts
Default

Looks good, I would have done the same.

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
How to use Gridlines DashStyle - Custom. shawnj Charting 3 09-18-2010 12:19 PM
Syntax for Adding DashStyle and Width for plot commodity_trader Miscellaneous Support 3 09-04-2008 10:17 AM
6.5 Bug GridLines DashStyle Custom shawnj Charting 10 06-03-2008 11:35 PM
DashStyle within Plot Method whitmark Suggestions And Feedback 1 12-11-2007 08:23 AM
DashStyle.Custom...? funk101 Indicator Development 3 05-06-2007 08:34 AM


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