PDA

View Full Version : Accessing properties values


delta88
09-27-2007, 06:12 AM
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:

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

NinjaTrader_Ray
09-27-2007, 07:02 AM
You could try:

Lines[0].Value
Lines[1].Value

delta88
09-27-2007, 10:53 AM
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