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
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
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:
Code: -
OK. I changed
Code:TradeCollection trades = new TradeCollection(true, true);
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 cls71, Today, 04:45 AM
|
0 responses
1 view
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
213 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
||
Started by TheWhiteDragon, 01-21-2019, 12:44 PM
|
4 responses
544 views
0 likes
|
Last Post
by PaulMohn
Today, 04:09 AM
|
||
Started by GLFX005, Today, 03:23 AM
|
0 responses
3 views
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
||
Started by XXtrader, Yesterday, 11:30 PM
|
2 responses
12 views
0 likes
|
Last Post
by XXtrader
Today, 03:07 AM
|
Comment