I know that I can use SystemPerformance.AllTrades function in a strategy. However, I would like to use it to tabulate manual entries on the instrument that i have been trading on the chart. Would this be possible?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is it possible to access Trades in an indicator?
Collapse
X
-
Is it possible to access Trades in an indicator?
Hi, I would like to display my trade metrics on my charts (Eg. Number of trades, long or short, PnL for the day) using Draw.Text in an indicator.
I know that I can use SystemPerformance.AllTrades function in a strategy. However, I would like to use it to tabulate manual entries on the instrument that i have been trading on the chart. Would this be possible?
Tags: None
-
Hello kelson,
Welcome to the NinjaTrader support forum.
That is possible by using the addon framework and the Account object/methods.
Rather than using the trade collection you would use the execution events or Execution collection to find execution information. You can also access other values the account has, the help guide left sidebar for the Account section has various related samples.
I look forward to being of further assistance.
-
Hi Jesse, thank you for the assistance. I have tried but the trade numbers are updating. Am I missing something?
Code:.......... private void OnExecutionUpdate(object sender, ExecutionEventArgs e) { foreach (Execution execution in myAccount.Executions) { todayTrades=todayTrades+1; } } protected override void OnBarUpdate() { Draw.TextFixed(this, "TT","Number of Trades:"+ todayTrades, TextPosition.TopLeft,Brushes.White, new NinjaTrader.Gui.Tools.SimpleFont("Arial", 12), Brushes.Transparent,Brushes.Transparent,0); }
Comment
-
Hello kelson,
This really is not enough for me to know whats wrong. Did you subscribe to the OnExecutionUpdate event like the Account sample that I linked to?
You may want to use a Print here inside the event to see if that is being called:
Code:private void OnExecutionUpdate(object sender, ExecutionEventArgs e) { Print("Here"); Print(e); }
You can also try using the Count on that collection:
I look forward to being of further assistance.Code:myAccount.Executions.Count
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment