NinjaScript > Language Reference > Strategy > TradeCollection > TradesPerformance >

SharpeRatio

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Returns the Sharpe ratio using a zero risk free return.
 

Property Value

A double value that represents the Sharpe ratio using a zero risk free return.

 

Syntax
<TradeCollection>.TradesPerformance.SharpeRatio

 

 

Examples

protected override void OnBarUpdate()
{
    // Print out the Sharpe ratio of all trades based on a zero risk free return

    Print("Average # bars per trade is: " + Performance.AllTrades.TradesPerformance.SharpeRatio);
}