Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Plotting text example
Collapse
X
-
ssg10, you could for example take a look at this example - http://www.ninjatrader.com/support/f...ad.php?t=19148 and then adapt it to your needs.
-
Position and MarketPosition
Thanks.
protected override void OnBarUpdate()
{
// If not flat print our open PnL
if (Position.MarketPosition != MarketPosition.Flat)
Print("Open PnL: " + Position.GetProfitLoss(Close[0], PerformanceUnit.Points));
}
I tried the code above and Position. and MarketPosition yield compile errors that it doesn't exist in current context. How to fix this?
Comment
-
Hello,
Indicators do not have access to strategy items such as MarketPosition. This is the difference between indicators and strategies in NinjaTrader.
To output your PnL you would either use text. DrawText(). Or if you want a second panel with a PnL line/graph you can do this with strategy plot inside your strategy.
Please use this sample for strategy plot.
When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
-
I think I have to make it clear what I want to do here.
I want to see my real-time PnL on the screen in percentage. And, it is not strategy trades. It is manual trades that I execute myself from the chart trader or DOM.
Furthermore, would love to see the total account gain/loss % of the day.
I hope this makes it clear, since I think the replies so far is suggesting to plot PnL of strategy trades. Thanks!
Comment
-
I am not sure what you are asking. Chart Trader shows that information directly.Originally posted by ssg10 View PostI think I have to make it clear what I want to do here.
I want to see my real-time PnL on the screen in percentage. And, it is not strategy trades. It is manual trades that I execute myself from the chart trader or DOM.
Furthermore, would love to see the total account gain/loss % of the day.
I hope this makes it clear, since I think the replies so far is suggesting to plot PnL of strategy trades. Thanks!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|
Comment