Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is there a way to get the last exit price in a strategy?
Collapse
X
-
Is there a way to get the last exit price in a strategy?
Is there a way to get the last exit price in a strategy?Tags: None
-
Hello ronaldgreene828, thanks for writing in.
This can be accessed through the SystemPerformance class:
if (SystemPerformance.AllTrades.Count > 1)
{
Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1];
Print(lastTrade.Exit.Price);
}
Another way to get this would be to use OnExecutionUpdate and capture the last exit price every time an exit is performed:
Please implement this within your strategy and let me know if any questions come up.
-
Thanks very much and sorry for the delayed response due to work taking me away from this project.
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
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment