TradeCollection trades = new TradeCollection(true, true); SystemPerformance.AllTrades.Where(t => t.Entry.Name == "Entry01").ToList().ForEach(t => trades.Add(t)); var winningTrades = trades.WinningTrades; // null var losingTrades = trades.LosingTrades; // null
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Custom TradeCollection WinningTrades Property is Null
Collapse
X
-
Custom TradeCollection WinningTrades Property is Null
When I create a custom TradeCollection as referenced in this thread (https://ninjatrader.com/support/foru...radecollection) some properties are null:
Is there something else one needs to do for those properties to be populated?Code: -
OK. I changed
toCode:TradeCollection trades = new TradeCollection(true, true);
and the properties are now populated.Code:TradeCollection trades = new TradeCollection(false, true);
Can you tell me what I changed by doing this? The parameter name is only "sub".
Thanks,
-
Hello BarzTrading,
Using a custom trade collection would be general C# and is not documented as an intended use in the NinjaTrader help guide.
However, that said, I am test adding to a custom trade collection using a secondary MSFT series with the sub parameter as false with new TradeCollection() and I am able to get performance and I am not able to reproduce this behavior.
If you test this strategy on a 1 Day AAPL chart while connected to Kinetick End of Day (Free) (so that we can ensure you get daily data for equities) is the print showing the performance as 0?Attached FilesChelsea B.NinjaTrader Customer Service
Comment
-
Thanks, Chelsea. Your example is not testing the issue I described. Most of the performance values are available. It is specifically the WinningTrades and LosingTrades properties of the TradeCollection that are not populated when sub=true.
They are populated when sub=false.
When I add the following to your example the results are consistent with mine:
Code:if (trades.WinningTrades == null) { Print("WinningTrades is null"); } else { Print("WinningTrades is NOT null"); }
Comment
-
Hello BarzTrading,
Thank you for catching that I was not looking at the Winning and Losing collections specifically.
I was able to reproduce.
I'm inquiring further with our development, however, this would be undocumented and I cannot guarantee I will get a reply.
However, I will let you know anything I find out.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
38 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment