PDA

View Full Version : ConstantLine Indicator


MichaelB
11-03-2007, 11:06 PM
Hello All,
To identiry possible future support / resistance price levels, often lines are drawm at swing highs and lows , also Market Profile charts may be used to indentify these price levels.
Once drawn on a chart , transferring these lines to other charts of the same symbol, can be a very time consuming and tedious.
Ninja has an indicator called ConstantLines, with the ability to draw four lines and no default setting

My question is ;
(1) Can the number of lines be increased to 12
(2) Can this indicator have a default setting , button , so that once lines are drawn to certain levels, press the button , these lines become the default setting , and all lines can be transferred to another chart of the same symbol , by just applying the indicator

Thanks
Michael B

NinjaTrader_Josh
11-03-2007, 11:10 PM
1) You can make a custom variant of the default indicator to include 12 lines. Just add 8 more plots, 8 more line variables, and set the value 8 more times. Basically duplicate the way the current code is working 8 more times.

2) You can preset the default values by hard coding them in, but we do not support the creation of a button you could press that would save the values.
Line1Value = 502;
Line2Value = 609;

CarlosAlberto
11-04-2007, 07:17 AM
Josh
I did as you suggested and generated a 15 lines ConstantLine Indicator (CL15ES). I intend to add my SR lines and market profile values -hard coded- on a daily basis. After correcting several errors, I still have a couple that I cannot correct as they appear in the Ninja generated code area. In lines 400 and 399 it expects to see a " } ". However, I can see the " } " where they are supposed to be.

So what is the problem? I am not a programmer but I can modified a few things in some indicators. Your suggestion was one of them.

Indicator attached

Thanks

Carlos

NinjaTrader_Josh
11-04-2007, 11:42 AM
Hi Carlos,

You forgot to end the last Line15 set.
This is what you have
[Description("Line 15 Value")]
[Category("Parameters")]
public double Line15Value
{
get { return line15Value; }
set { line15Value = value; }
This is what it should be
[Description("Line 15 Value")]
[Category("Parameters")]
public double Line15Value
{
get { return line15Value; }
set { line15Value = value; }
}Also you are going to need to duplicate this code segment up to 15
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Line4
{
get { return Values[3]; }
}At the end you should have this for your Line15
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Line15
{
get { return Values[14]; }
}

gimligoose
10-30-2008, 11:06 PM
Could the constantline Indicator be modified to plot horizontal rectangles with a width of say 5 ES points and an opacity of say 3, instead of lines?

NinjaTrader_Ben
10-31-2008, 08:19 AM
Hello,


Yes you could do this following similar logic. Code it and let us know if you get stuck so we can assist.

This link on DrawRectangle will get you started:
http://www.ninjatrader-support.com/HelpGuideV6/DrawRectangle.html