Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Optimizer Type: Annualized Daily Sharpe Ratio for NT7

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

    New Optimizer Type: Annualized Daily Sharpe Ratio for NT7

    Hey all,

    Here is a new optimizer type for calculating the annualized daily Sharpe ratio on NT7. The Sharpe ratio included in NT is the monthly sharpe ratio, which is a decent measure if you are optimizing a strategy over several years, but if you only optimize a strategy over 3 years, then you only have 36 data points, which leads to somewhat meaningless stats.

    Therefore, I created a metric based on daily returns which yields more data points. I somewhat arbitrarily chose 100 trades to be the minimum amount of trades under which the daily sharpe ratio just gets set to 0 (for lack of data/reliability). Feel free to change this if you want a different threshold.

    I also annualized the sharpe ratio by multiplying by sqrt(252) - this is often done in industry. I did not factor in the risk-free rate.

    To add this optimizer type, copy the file (.cs file) to:
    "Documents/Ninjatrader 7/bin/Custom/Type".

    Then, just compile any random strategy (press F5 or click all the way through the wizard) and then you should be able to select it when optimizing. It is called "Daily Sharpe Ratio" in the "optimize on..." field.

    Please let me know if you find any problems with the code or if you have any questions. I have not had any issues thus far and take no responsibility if something goes wrong (don't see why it would). I also double checked the results in excel. There is a slight difference between the two results, probably due to rounding, but it isn't significant.

    Cheers
    Attached Files

    #2
    Excellent. Thanks for sharing, pmorissette!
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X