> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# SortinoRatio

## Definition

Returns the Sortino ratio using a **risk free return**.

## Property Value

A **double** value that represents the Sortino ratio using a risk free return.

## Syntax

`\<tradecollection\>.TradesPerformance.SortinoRatio`

## Examples

```csharp
protected override void OnBarUpdate()
{
     // Set a 0% risk free return
     SystemPerformance.AllTrades.TradesPerformance.RiskFreeReturn = 0;

     // Print out the Sortino ratio of all trades based on a zero risk free return
     Print("Sortino ratio is: " + SystemPerformance.AllTrades.TradesPerformance.SortinoRatio);
}
```