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.JesseNinjaTrader Customer Service
-
Originally 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.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
8 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 02:34 AM |
Comment