Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PerformanceMetric debugging

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PerformanceMetric debugging

    Hi

    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?

    #2
    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

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      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 modes

      Comment


        #4
        in addition the metric is instanciated multiple times so a private flag to filter does not work, a static does however u need to reload the whole app domain

        Comment


          #5
          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 Kaledus, Today, 01:29 PM
          0 responses
          3 views
          0 likes
          Last Post Kaledus
          by Kaledus
           
          Started by PaulMohn, Today, 12:36 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          36 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by rdtdale, Today, 01:02 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          3 responses
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X