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 09-27-2007, 06:12 AM   #1
delta88
Junior Member
 
Join Date: Aug 2007
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Default Accessing properties values

I would like to access a parameter value (see picture) in the indicator properties for furher calculations. In this case it's the position of a horizontal line that I would like to pass to a variable.

The line is generated by the wizard and looks like this:

Quote:
Add(new Line(Color.DarkOliveGreen, 80, "HiBase"));
Add(new Line(Color.DarkOliveGreen, 20, "LoBase"));
Now, these lines generate a menu on their own (indicator properties), but I don't know how to access a single parameter of the subsection.
How can I do that and whats the correct code for it?

Delta88
Attached Images
File Type: png Lines_Properties_Value.png (7.8 KB, 12 views)
delta88 is offline  
Reply With Quote
Old 09-27-2007, 07:02 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

You could try:

Lines[0].Value
Lines[1].Value
NinjaTrader_Ray is offline  
Reply With Quote
Old 09-27-2007, 10:53 AM   #3
delta88
Junior Member
 
Join Date: Aug 2007
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Default

Ok thanks, that worked.
The only place it worked was when I put it into the OnBarUpdate() section. I first put it into the Initialize() section, which would have been more elegant.
There it would only give me the default values of the lines, regardless of what I choose in the properties.

But thats Ok too.

Delta88
delta88 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
Line properties mrlucky1x Charting 1 08-27-2007 11:44 AM
Stategy Properties Json Strategy Development 1 04-02-2007 02:08 AM
NT6 Chart Trader Properties guym SuperDOM and other Order Entry Windows 3 12-14-2006 05:01 AM
Unmoveable properties boxes Antraman Charting 2 09-15-2006 04:16 PM
Basic Entry Properties scjohn Miscellaneous Support 5 12-13-2005 06:30 AM


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