Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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:
Code: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
-
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:
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]
Code: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 bortz, 11-06-2023, 08:04 AM
|
47 responses
1,603 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
12 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment