Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to access data to calculate Initial Risk/Reward from NT8 Trade Performance report

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

    How to access data to calculate Initial Risk/Reward from NT8 Trade Performance report

    Hi,

    I want to calculate initial Risk over reward of a trade from Trade performance data but the output data from the trades tab does not give how much the initial stop ticks were set to or target ticks - it only gives Trade exit condition as StopN {N=1,2...} when a stop is hit, if targetN was hit then exit condition is given as TargetN and the profit amount reflects stop or target amount - both are not available for every trade reported. If a manual close was used then close is reported as exit condition again no way of knowing what the initial stop and target settings were.

    I would like to tabulate for each trade what the initial starting stop and the initial starting target were, to be able to calculate the initial Risk over Reward ratio for the trade when the trade was put on - This is different from the actual Win or Loss and the Average Win/Loss data reported which is also important but a different measure.

    thanks
    Last edited by suraj; 04-05-2022, 08:34 AM.

    #2
    Hello suraj,

    Thank you for your message.


    Yes, this will be expected as the platform's database will only record the price levels at which an order was either filled or canceled. However, if you go into the Control Center > Log window or open the individual log text files from the Documents/NinjaTrader 8/log folder, you will be able to view every step of every order you have placed on the platform including their original submission prices.

    This would be the only way to view the original submission prices for these orders if they were modified.


    Please let me know if you have any additional questions.
    Justin D.NinjaTrader Customer Service

    Comment


      #3
      Hi Justin,
      Thanks for info that database only records price on fills or cancellation of trade. The database additionally has the qualifiers like "Entry", "Stop1", "Target3" etc based on ATM setup used. This is very helpful in analysis of trading system performance.

      Initial Risk, initial Reward and the initial Risk/Reward is a very important factor in validating the viability of systems. Currently I am using a third party "indicator add on" to run backtests of trading systems I intend to use. This add on provides "statistics" which includes the initial Risk and initial Reward settings for for upto 3 contract trade setups, with each contract having individually selectable Stop and Target values.

      Unfortunately this 3rd party add on only works on a static chart and cannot be used with Replay which makes it useless for forward testing and for use with NT8 Strategies. If these parameters (Risk, Reward) were available for NT8 trade performance - then one could do a complete analysis of systems using Strategy builder / NT8 Strategy and NT8 would be the best available testing platform .

      If the third party add-on can record these two parameters for each trade - I wonder if it is possible for Ninja Trader to have two additional fields added to the database to record the initial Risk and the Initial Reward for each Trade row either as a "indicator add on" or natively?

      I would like to make a request to have the capability to record these two parameters added to the NT8 platform and available for export on the Trade Performance tab.

      thanks

      PS: currently there is the new "indicator" to show the Risk and Reward amounts for set R/R values and it shows this is a useful measure for traders to see when placing their trades.
      Last edited by suraj; 04-07-2022, 09:46 AM.

      Comment


        #4
        Hello suraj,

        Thank you for your response.


        Unfortunately, this would be part of the DB structure which cannot currently be modified for different features.


        Please let me know if you have any additional questions.
        Justin D.NinjaTrader Customer Service

        Comment


          #5
          Hi Justin,
          thanks for clarifying that. I am wondering if another approach might work:

          Is it possible for an indicator to read the Trade performance report parameters from the database after a particular trade completes or at the end of the day?.

          If so, one could use a modified version of the recent Risk / Reward indicator to read trade performance report parameters and export along with modified indicator's stored risk reward parameters sorted by trade times.

          if this might work can you please send me a copy of the new Risk Reward indicator source and pointers on how to read relevant sections of the database and how to export data to a csv file from an indicator.

          Thanks,
          Suraj

          Comment


            #6
            Hello Suraj,

            Thank you for your response.


            This would require a custom-coded indicator either created by yourself or a new version of that indicator created by the original developer. If you are looking for resources on how to custom-code this yourself, please let me know, and I can forward you to our NinjaScript team. We would not be able to edit or change another vendor/programmer's custom script though.

            Please let me know if you have any additional questions as well.
            Justin D.NinjaTrader Customer Service

            Comment


              #7
              Hi Justin,

              Thanks for the info - I would like to code it my self. Would appreciate any help or pointers from your Ninja script guys.

              I would like to start with the Ninja Trader version of Risk to Reward indicator as a starting point. ( And so am not trying to change any third party indicator)

              Please can you (1) point me to a copy of the Ninja Trader Risk/Reward indicator source
              (2) point me to any links re how to access Ninja Trader Database parameters from a indicator
              (3) point me to any link as to how to write data out to a csv file from an indicator
              and (4) point me to one of your Ninja Script guys who I can ask questions in this regard,

              thanks,

              Comment


                #8
                Hello suraj,

                Thank you for your reply.

                There is not a risk reward indicator built into NinjaTrader, however, there is a Risk Reward drawing tool which may be used to draw a risk reward drawing object from your own NinjaScript indicator.



                The code for this drawing tool may be found in the Drawing Tools folder in the NinjaScript Editor.

                An example of using a drawing object in an indicator may be found in our help guide here:



                Getting information for any trades on the account is a little more complicated, and requires the use of add-on code to get the account and access that information.

                First you would have to track trades which are made by pairing executions together. It would not be supported to access the NinjaTrader database to extract historical trades/executions. To track executions, you could subscribe to the Account's ExecutionUpdate event and then pair those executions together to create trades. You could then use the prices of the executions to determine whether or not the trade was profitable.

                Account.ExecutionUpdate - https://ninjatrader.com/support/help...tionupdate.htm

                Writing data to a CSV file may be achieved using a StreamWriter. This example from our help guide illustrates:



                You can ask any questions you like in our NinjaScript sections here on the forums and we're more than happy to assist. You can also reach us directly via email at scriptingsupport [at] ninjatrader [dot] com - either way is fine.

                Please let us know if we may be of further assistance to you.

                Comment


                  #9
                  @Kate W the link to Streamwriter documentation in the page you linked gives me a 404 not found
                  Best,

                  Comment


                    #10
                    Originally posted by suraj View Post
                    Hi,

                    I want to calculate initial Risk over reward of a trade...

                    thanks
                    If you open a trade with any existing ATM strategy then you already know the initial risk/reward ratio, no?

                    Comment


                      #11
                      Originally posted by trendisyourfriend View Post

                      If you open a trade with any existing ATM strategy then you already know the initial risk/reward ratio, no?
                      Yes, I could note it down manually and then when I down load Ninja Trader's Trade Performance Report exported data, I could then manually enter and align the Risk and Reward for each trade in the Excel table.

                      But to do calculation for many days or weeks of trading for generating trading system statistics, it is easier and less error prone to be able to download all this information from a single file.

                      I have received a few responses from Ninja Trader staff regarding the Risk Reward indicator and am waiting for information about how to access Ninja Trader database information from an indicator and about how to write data out to a file from a Ninja Trader indicator - it should then be possible to modify the Ninja Trader Risk Reward indicator to output this data to a single csv file - for trades taken during that lifetime (if that is the correct word to use) of the Modified Risk Reward indicator on the chart. Beyond that it may be possible to maintain a data base file on local disk to use with a larger date range of trades but that is getting too complicated to start for my needs.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Kate View Post
                        Hello suraj,

                        Thank you for your reply.

                        There is not a risk reward indicator built into NinjaTrader, however, there is a Risk Reward drawing tool which may be used to draw a risk reward drawing object from your own NinjaScript indicator.

                        ........

                        Please let us know if we may be of further assistance to you.
                        apologize for delay in response - just saw your post on the forum - had seen email notification but not the details.
                        Thanks for the information you have provided -I will go through and the try to attend one of the NinjaScript sessions
                        thanks
                        Suraj

                        Comment


                          #13
                          Originally posted by trendisyourfriend View Post

                          If you open a trade with any existing ATM strategy then you already know the initial risk/reward ratio, no?
                          Took your suggestion in effect - what I am doing is coding the stop and target in the strategy name which is reported in the NT 8 Trade Stats data and filtering it to generate table columns with that data - much simpler, Thanks.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by argusthome, 03-08-2026, 10:06 AM
                          0 responses
                          63 views
                          0 likes
                          Last Post argusthome  
                          Started by NabilKhattabi, 03-06-2026, 11:18 AM
                          0 responses
                          40 views
                          0 likes
                          Last Post NabilKhattabi  
                          Started by Deep42, 03-06-2026, 12:28 AM
                          0 responses
                          21 views
                          0 likes
                          Last Post Deep42
                          by Deep42
                           
                          Started by TheRealMorford, 03-05-2026, 06:15 PM
                          0 responses
                          23 views
                          0 likes
                          Last Post TheRealMorford  
                          Started by Mindset, 02-28-2026, 06:16 AM
                          0 responses
                          51 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Working...
                          X