I am trying to debug the OnAddTrade method but it looks like it is called multiple times for the same trade. Is there a way to filter those calls just for debugging purposes?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
PerformanceMetric debugging
Collapse
X
-
Hello,
Thank you for posting.
I wanted to collect some information regarding the current use. Can you tell me, is this currently being used in backtesting or was this from a historical/realtime trades?
Also, how many times per trade are you seeing this being called?
I look forward to being of further assistance.
-
roughly 5 times and is called from both historical/realtime and backtesting modesOriginally posted by NinjaTrader_Jesse View PostHello,
Thank you for posting.
I wanted to collect some information regarding the current use. Can you tell me, is this currently being used in backtesting or was this from a historical/realtime trades?
Also, how many times per trade are you seeing this being called?
I look forward to being of further assistance.
Comment
-
Hello,
Thank you for the reply.
I had to confirm with development on this item, after testing I do see that it is variable at how many times this override is called and this is expected. The reason this is expected is that this metric is being called for multiple collections where the trade is added.
A more accurate description proposed for the help guide definition of this method would be as follows:
This method is called as each trade is added to each performance collection, this means this is called multiple times per trade. This is a pure function used for your calculations, please keep all logic inside of the method body to retain as a pure function.
Using a performance metric with private variables or otherwise is not suggested as they are designed to be pure methods that simply do a calculation on the added trade. Being called multiple times should not affect your logic, if it currently does you would need to change the logic to be a pure function that does not rely on class variables.
I look forward to being of further assistance.Last edited by NinjaTrader_Jesse; 10-11-2017, 07:37 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
88 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
48 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
31 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
34 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
69 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment