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 NullPointStrategies, Today, 05:17 AM
|
0 responses
48 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
66 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment