results (int Mode, int Num): var

Sums up the results of the most recent trades by different criteria. 

Parameters:

Mode

Type of the result sum, a combination of:
0
     - sum up profits
+1   - return number of trades
+2
   - sum up entry/exit price differences
+4   - sum up losing, rather than winning trades
+8   - sum up open trades
+16 - sum up closed trades
+24 - sum up open and closed trades
+32 - sum up only trades of current asset / algo combination

Num Number of trades to sum up.

Remarks:

Examples:

var NumWins = results(1+24,30);	// Number of winning and won trades
var NumLosses = results(1+4+24,30);	// Number of losing and lost trades
var Wins = results(2+24,30)/PIP;	// Total win in pips
var Losses = results(2+4+24,30)/PIP;	// Total loss in pips
var AvgProfit = ifelse(NumWins+NumLosses > 0,
  (Wins-Losses)/(NumWins+NumLosses),0.); // Average profit per trade
var WinRate = ifelse(NumWins+NumLosses > 0,
  NumWins/(NumWins+NumLosses);	// Win rate of last 30 trades
 

See also:

Trade statistics, for(trades), strategy statistics

► latest version online