Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Gross profit / net profit plot ?
Collapse
X
-
Hello Dudley,
You can find samples of accessing those values here:
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
To plot a value you can use either AddPlot or also drawing tools to display a value on the chart.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
- Likes 1
-
The way I usually do it, I have my property setting as such:
[Browsable(false)]
[XmlIgnore]
public Series<double> OvernightHigh
{
get { return Values[0]; }
}
In OnState.Configure I am adding the plot like so:
AddPlot(new Stroke(HighColor, DashStyleHelper.Dot, 3), PlotStyle.Line, "OvernightHigh"); // Plots[0]
In OnBarUpdate, I am using the following:.
OvernightHigh[0] = overnightHigh; // overnightHigh is a double that is keeping track of the price level.
Notice that the OvernightHigh in properties is the same OvernightHigh[0] from OnBarUpdate.
I am using Values[0] in the properties because that is the first Plot I have added in OnState.Configure, which is why I have also commented Plots[0] next to it, to keep track.
If I were to add another plot, I would make sure that one has Values[1] in the properties.
Let me know if that helps you.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
88 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
134 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment