Thanks
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
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.BertrandNinjaTrader Customer Service
-
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.
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
-
ssg10, what you could do is shown in the strategy script attached - this would not work from an indicator for manual trades. It would work from a strategy for the account it's executing on and up to the level of info what we show documented for the GetAccountValue method :
Attached FilesBertrandNinjaTrader Customer Service
Comment
-
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 Gerik, Today, 09:40 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:50 AM | ||
Started by RookieTrader, Today, 09:37 AM
|
1 response
10 views
0 likes
|
Last Post Today, 09:43 AM | ||
Started by alifarahani, Today, 09:40 AM
|
0 responses
5 views
0 likes
|
Last Post
by alifarahani
Today, 09:40 AM
|
||
Started by KennyK, 05-29-2017, 02:02 AM
|
3 responses
1,284 views
0 likes
|
Last Post Today, 09:35 AM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
11 responses
186 views
0 likes
|
Last Post Today, 09:28 AM |
Comment