Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get access to strategy from PerformanceMetric

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

    Get access to strategy from PerformanceMetric

    I need a way to get access to the strategy from a custom PerformanceMetric. I tried using the OnAddTrade() and accessing trade.Entry.Order.GetOwnerStrategy(), but this always returns null.

    Is there a way to get access to the strategy? If not, can this be added?

    Thanks.

    #2
    Hello aslane,

    Thank you for your post.

    There are no means to grab the strategy that would be supported. Can you detail the use case here for accessing the strategy from the Performance Metric?

    Comment


      #3
      How about unsupported?

      I wrote my own performance metrics based on flat to flat, and was trying to use the PerformanceMetrics to easily display them in the strat analyzer. However, to do that I need to get access to my object that is held back in the strategy.

      Comment


        #4
        Hello aslane,

        Thank you for your response.

        As the Performance Metrics are separate from the strategy running it is expected that the strategy would not be in sync with the Performance Metric as far as the position, there would not be an option to pull the position of the strategy.

        If you need values based on the position of the strategy you may instead wish to calculate these values inside the strategy or call a partial class to run a function on performance values.

        Comment


          #5
          I already do calculate everything as part of the strategy. In order to do flat to flat statistics, Ninja Trades can not be used since they are fill-to-fill based. So, instead I calculate everything within an add-on support class. I was trying to use the performance metrics as a way to display this information, by returning the information from the Format method but there is no good way to connect back to my objects. Hence the need to get a pointer back to the strategy.

          I can surface the info using my own window, but really wanted to use the Ninja infrastructure.

          As an aside, in the future it would be much more powerful if you continued to open this architecture up and allowed the user to determine what a trade is. This could be done by surfacing the Executions instead of the Trades and allowing the user to optionally insert the Trades. Also, allowing the user to add additional Trade fields. I understand this is not a short term item.

          Comment


            #6
            Hello aslane,

            I have forwarded your notes to development.

            Comment


              #7
              Hello aslane,

              Your suggestions have been assigned the following IDs.
              • SFT-1664: Access to individual trades / executions from the performance metric to perform flat to flat trade pairing and tracking and use the metric to display in the normal NT windows.
              • SFT-1665: Custom trade pairing.
              • SFT-972: Implement a feature which would allow users to add a custom tag to executions and orders.

              Comment


                #8
                I see the is a UserData property on Orders with type XDocument. I guess adding something like this would be very useful for executions as well. For example, one can assign the points value of van Tharp R.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                1 view
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                6 views
                0 likes
                Last Post Javierw.ok  
                Started by timmbbo, Today, 08:59 AM
                2 responses
                10 views
                0 likes
                Last Post bltdavid  
                Started by alifarahani, Today, 09:40 AM
                6 responses
                41 views
                0 likes
                Last Post alifarahani  
                Working...
                X