Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Viewing total positions taken
Collapse
X
-
Viewing total positions taken
I build short term positions across multiple instruments with sometimes up to 20 contracts and stagger entries/exits. I want a quick way I can view the total cumulative positions taken during the trading day (not trades as these are simply contracts). Is there a way to put that onto my chart as an indicator? Is there any code that I can draw from to do that?Tags: None
-
mrre1, thanks for your post.
How is this different from the count of the SystemPerformance.AllTrades.Count value? Currently there is not a supported way to retrieve historical executions from the database, so the count needs to begin from the first trade made in real time.
I look forward to hearing form you.
-
I want to keep track of total positions taken (could also be both long and short separately and that would actually be preferred) as I leg in and out of positions. The reports are tied to "trades" which is contracts not positions. The chart trade view in Trade Performance and Data Series > Plot executions makes it cumbersome to track it that way. When I am flat the position would reset.
Although I haven't used SystemPerformance.AllTrades.Count it seems like this would not be what I am trying to do if I am taking both long and short positions in a trading day.
For example, in one day I may take 3 long positions with 40-60 staggered contracts and 5 short positions with 100 staggered contracts. In this example what I would love to be able to quickly see is the 3 and the 5 numbers.Last edited by mrre1; 04-12-2020, 06:32 PM.
Comment
-
He mrree1, thanks for your reply.
The strategy itself would need to keep a tally of the positions taken over time. The OnPositionUpate method is called every time the strategy goes from flat to short/long and back to flat again, so this will let you keep track of positions taken from the start of the strategy. This can be as simple as two integer variables, longCount and shortCount, and you increment those as the strategy goes from flat to long or flat to short.
Please let me know if I can assist any further.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
41 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment