Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how do I create and display on a chart a line parallel to my custom indicator?
Collapse
X
-
Hello joemiller,
Thank you for your response.
It may be easier to add the additional plot to the current indicator.
You could displace the line using + or - a number:
You can find a reference sample on plots at the following link as well: http://www.ninjatrader.com/support/f...ead.php?t=3227Code:myCustomPlot.Set(joeXXOindicator()[0] + myDisplacement);
Please let me know if I may be of further assistance.
Comment
-
indicator is attached.
indicator is attached.
thanks PatrickAttached Files
Comment
-
Did you define the Plot's access properties?Originally posted by joemiller View PostI tried several things with no success [eg]
Add(new Plot(new Pen(Color.Red, 2), "PlotXXO_1")); //initialize region
PlotXXO_1.Set(joeXXOindicator()[0] + 0.00500);//onbarupdate region
I have no idea how to make it work. please advise.
Comment
-
Hello joemiller,
Thank you for your response.
Koganam was correct, the plot needs to be defined in the properties:
In addition, adding the value of 0.005 may not even be noticeable on some instruments. I tried this on the ES and I had to expand the chart on the y-axis to even see the new plot. I tried the following and received more desirable results no matter the instrument:Code:#region Properties [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 PlotXXO { get { return Values[0]; } } [B] [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 PlotXXO_1 { get { return Values[1]; } }[/B]
For information on TickSize please visit the following link: http://www.ninjatrader.com/support/h...7/ticksize.htmCode:PlotXXO_1.Set(XXOpen + (1*TickSize));
Please let me know if I may be of further assistance.
Comment
-
In the initialize region I added the statement
‘Add(new Plot(new Pen(Color.Black, 1), "PlotXXO_1"));’
patterned after
‘Add(new Plot(new Pen(Color.Red, 2), "PlotXXO"));’
hoping that it would generate the parallel line in a black instead of a red color. However it did not work. I blindly tried several fixes without success. Should I maybe have something additional in the properties region or elsewhere?
Comment
-
I cannot get the following DrawLine to work.
// ..............(.... tag ,..... auto, ...start, starty, end, endy,.. color , ...........dash ,.. width)
// .................................scale... bars.............bars............................. ......style , ..pixels
// .............................................. ago.............ago
//DrawLine("PlotXXO", false,.... 10,... 1.33,.... 0,.. 1.33,.. Color.Red, DashStyle.Dot, 2);
It has been placed in region OnBarUpdate as follows
PlotXXO_1.Set(XXOpen + (25*TickSize));
DrawLine("PlotXXO", false, 10, 1.33, 0, 1.33, Color.Red, DashStyle.Dot, 2);
The following statements are in the initialize region:
Add(new Plot(new Pen(Color.Red, 2), "PlotXXO"));
Add(new Plot(new Pen(Color.Black, 0), "PlotXXO_1"));
starty and endy values = 1.33 are for test and are for the forex euro dollar/us dollar currency pair.
A listing of the indicator is attached in post #7.
I’m thinking that it may be a simple matter of syntax or form such as the wrong tag?
I’m aware that clarification to all this will probably be necessary.
Last edited by joemiller; 08-20-2013, 06:59 PM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
594 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment