Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Implementing own statistics

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

    Implementing own statistics

    Hello

    First of all: You have a great tool, I am now working a few weeks with it and learning. Always again surprised what I can do with NT!

    Nevertheless NT performance statistics has 2 shortcomings in my point of view:
    1. Already discussed in this forum: If entries per direction is more than one, then the cumulated % profit is wrong resp. misleading. An example:
    1.2.2010 Go long with 100.- / 31.12.2010 Exit with 200.- (Profit: 100.-)
    2.2.2010 Go long with 100.- / 31.12.2010 Exit with 200.- (Profit: 100.-)
    3.2.2010 Go long with 100.- / 31.12.2010 Exit with 200.- (Profit: 100.-)
    As you can see, we have hier Entries per direction = 3. NT will calculate as cumulated % profit 300%. But this is wrong, since my invested capital obviously is not 100.- but 300.-. The total profit is therefore 100%.

    2. The max drawdown is somewhat misleading (If i understood it correct?).
    Example:
    Max consecutive down is 10%, then my strategy wins 1%, then again down 10%, then up 1%, then again down 10%, then up 1%, then again down 10%, then up 1%, then again down 10%.
    NT will calculate a max drawdown of 10%. But in the above example I will have lost almost 50% of my capital. Quite an important factor when I decide to use leverage or not.
    I would like to implement therefore a max drawdown defined as follows:
    Max difference between a high and a low.


    Therefore I would like to add some calculations in backtesting. But how is this done best?

    1. As I understand from the forum it is not possible to recognize whether a strategy has finished backtestet. Is it possible to retrieve the date range the user has defined when testing? So I could check with the date, as you suggest somewhere in the forum when it ends

    2. Is it possible to access the executions data? I have seen I can access the trade data, but in order to find out what is max capital needed from my account, I would need the exectutions

    3. Is there an easy way to access in the code the statistics calculated in the performance tab and print to file?


    thanks & regards
    Andre

    #2
    Andre, thanks for the feedback and post - I'll have to check into the EntriesPerDirection cumlated profit observation. For the Max Drawdown, correct, this is the single biggest drawdown observed, it's not cumulative.

    1. Correct, you could could add user defined DateTime inputs to set and programmatically access the backtest date range.

    2. For this you can pass the IExecution object in the Trade() class - http://www.ninjatrader-support.com/H...radeClass.html

    3. Unfortunately this is not supported, you would need use the Export to Excel functionality.

    Comment


      #3
      thanks for the feedback.
      About point 1: Can I access from the code the end date of the testing range?

      Comment


        #4
        Beauregard, accessing this directly is unfortunately not supported.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        652 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X