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 yertle, Yesterday, 08:38 AM
    7 responses
    28 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by bmartz, 03-12-2024, 06:12 AM
    2 responses
    21 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by funk10101, Today, 12:02 AM
    0 responses
    4 views
    0 likes
    Last Post funk10101  
    Started by gravdigaz6, Yesterday, 11:40 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by MarianApalaghiei, Yesterday, 10:49 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X