TradesPerformance

View as Markdown

Definition

Performance profile of a collection of Trade objects.

Methods and Properties

ParameterDescription
AverageBarsInTradeA double value representing the average number of bars per trade
AverageEntryEfficiencyA double value representing the average entry efficiency
AverageExitEfficiencyA double value representing the average exit efficiency
AverageTimeInMarketA TimeSpan value representing quantity-weighted average duration of a trade
AverageTotalEfficiencyA double value representing the average total efficiency
TotalCommissionA double value representing the total commission
CurrencyGets a TradesPerformanceValues object in currency
GrossLossA double value representing the gross loss
GrossProfitA double value representing the gross profit
LongestFlatPeriodA TimeSpan value representing longest duration of being flat
MaxConsecutiveLoserAn int value representing the maximum number of consecutive losses seen
MaxConsecutiveWinnerAn int value representing the maximum number of consecutive winners seen
MaxTime2RecoverA TimeSpan value representing maximum time to recover from a draw down
MonthlyStdDevA double value representing the monthly standard deviation
MonthlyUlcerA double value representing the monthly Ulcer index
NetProfitA double value representing the net profit
PercentGets a TradesPerformanceValues object in percent
PerformanceMetricsAn array of custom NinjaScript performance metrics
PipsGets a TradesPerformanceValues object in pips
PointsGets a TradesPerformanceValues object in points
ProfitFactorA double value representing the profit factor
R2A double value representing the R-squared value
RiskFreeReturnA double value representing the risk free return rate
SharpeRatioA double value representing the Sharpe Ratio
SortinoRatioA double value representing the Sortino Ratio
TicksGets a TradesPerformanceValues object in ticks
TotalQuantityAn int value representing the total quantity
TotalSlippageA double value representing the total slippage. This is presented in points, I.E. 0.25 for 1 execution on E-mini S&P 500 Futures.
TradesCountAn int value representing the trades count
TradesPerDayAn int value representing the avg trades per day

Examples

1protected override void OnBarUpdate()
2{
3 // Only trade if you have less than 5 consecutive losers in a row
4 if (SystemPerformance.RealTimeTrades.TradesPerformance.MaxConsecutiveLoser < 5)
5 {
6 // Trade logic here
7 }
8}