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 cmtjoancolmenero, Yesterday, 03:58 PM
    4 responses
    23 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Brevo, Today, 01:45 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rjbtrade1, 11-30-2023, 04:38 PM
    2 responses
    73 views
    0 likes
    Last Post DavidHP
    by DavidHP
     
    Started by suroot, 04-10-2017, 02:18 AM
    5 responses
    3,021 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Stanfillirenfro, Today, 07:23 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X