Instrument statistics

Definitions

N
The number of trades which have been done between TESTPERION.FROM and TESTPERIOD.UNTIL.
T_i
The position closing price at moment i: T_i = \begin{cases} CLOSED.PL_i - CLOSED.PL_{i-1} & \text{ if } i > 1 \\ CLOSED.PL_1 & \text{ if } i = 1 \end{cases}.
N^{TRADE}
The number of closed positions during the life of a strategy.
SUM.TRADE
The sum of profit or loss of the strategy: SUM.TRADE = \sum_{i=1}^{N^{TRADE}} PL_{i}.
SUM.WINTRADE
The total sum of all closed positions with positive PL_{i} > 0: SUM.WINTRADE = \sum_{i = 1}^{N^{TRADE}} PL_{i} [\![ PL_{i} > 0 ]\!].
SUM.LOSETRADE
The total sum of all closed positions with negative PL_{i} < 0: SUM.LOSETRADE = \sum_{i = 1}^{N^{TRADE}} PL_{i} [\![ PL_{i} < 0 ]\!].
N^{PL+}
The number of closed positions with positive PL_i value: N^{PL+} = \sum_{i = 1}^{N^{TRADE}} [\![ PL_{i} > 0 ]\!].
N^{PL-}
The number of closed positions with negative PL_i value: N^{PL-} = \sum_{i = 1}^{N^{TRADE}} [\![ PL_{i} < 0 ]\!].
S_i
The price with which a trade was done at moment i, by the strategy.
Q_i
The quantity that strategy buys or sells at the moment i.
SIDE_i
In each step of a strategy can either buying or selling an asset. The value of SIDE_i \in \{\text{BUY}, \text{SELL}\} describes strategy’s position at moment i.
S^{MAX}_{i}
The maximum price with which a trade was done by the strategy up to the moment i: S^{MAX}_{i} = MAX_{j \in \{1, \ldots i\}} S_j.
S^{MIN}_{i}
The minimum price with which a trade was done by the strategy up to the moment i: S^{MIN}_{i} = MIN_{j \in \{1, \ldots i\}} S_j..
MFE_{i}
The best possible trade at moment i: MFE_{i} = \begin{cases} S_{i} - S_{i}^{MIN} & SIDE_{i} = SELL \\ S_{i}^{MAX} - S_{i} & SIDE_{i} = BUY  \end{cases}.
SUM.MFE
The sum of the best possible trades: SUM.MFE = \sum_{i=1}^{N^{TRADE}} MFE_i \times Q_i.
MAE_i
The worst trade to be done at moment i: MAE_i = \begin{cases} S_{i} - S_{i}^{MAX}& \text{if } SIDE_{i} = SELL \\ S_{i}^{MIN} - S_{i}& \text{if } SIDE_{i} = BUY \end{cases}.
SUM.MAE
The sum of the worst possible trades: SUM.MAE = \sum_{i = 1}^{N} MAE_i \times Q_i.

Simple statistics

Test Period From
This is the time when the first trade was done by the strategy, its symbol is TESTPERIOD.FROM.
Test Period Until
This is the time when the last trade was done by the strategy, its symbol is TESTPERIOD.UNTIL.
Best Trade
This is the best position closing price, it is defined as follows

T_{N}^{MAX} = MAX_{i \in \{1, 2, \ldots N\}} T_i

Worst Trade
This is the worst position closing price, it is defined as follows

T_{N}^{MIN} = MIN_{i \in \{1, 2, \ldots N\}} T_i

Average trade statistics

Average Trade
It is the average profit or loss of all the transactions made by the strategy. It is defined as follows

AVG.TRADE = \frac{SUM.TRADE}{N^{TRADE}}

Average Winning Trade
It is the average price of closed position with PL_i > 0, it is defined as follows:

AVG.WINTRADE = \frac{SUM.WINTRADE}{N^{PL+}}

Average Loosing Trade
It is the average price of closed position with PL_i < 0, it is defined as follows:

AVG.LOSETRADE = \frac{SUM.LOSETRADE}{N^{PL-}}

Ratio Average Win Average Loss
It is the ratio between the expected profitable trade and expected unprofitable trade. It is defined as follows:

RATIO.AVGWINAVGLOSS =
\begin{cases}
\frac{AVG.WINTRADE}{|AVG.LOSETRADE|} & \text{if } AVG.LOSETRADE \neq 0 \\
NULL & \text{if } AVG.LOSETRADE = 0
\end{cases}

Average maximum favorable excursion
It is the average of best possible trades. It is defined as follows

AVG.MFE = \frac{SUM.MFE}{N}

Average maximum adverse excursion
It is the average of the worst trades. It is defined as follows:

AVG.MAE = \frac{SUM.MAE}{N}

Average End Trade Drawdown
It is the difference between the maximum excursion average and the average trade. It is defined as follows:

AVG.ETD = AVG.MAE - AVG.TRADE

Number of trades

Total Number of TRADES
Total number of all trades done by the strategy is equal to N^{TRADE}.
Total Number of Short Trades
Total number of short trades done by the strategy. It is defined as follows:

N.SHORT = \sum_{i=1}^{N^{TRADE}} [\![ SIDE_i = SELL ]\!]

Total Number of Long Trades
Total number of long trades done by the strategy. It is defined as follows:

N.LONG = \sum_{i=1}^{N^{TRADE}} [\![ SIDE_i = BUY ]\!]

Total Number of Winning Trades
It is a number of closed positions which are profitable.

N.WINNING = \sum_{i = 1}^{N^{TRADE}} [\![ PL_i > 0 ]\!]

Total Number of Loosing Trades
It is a number of closed positions which are unprofitable.

N.LOSING = \sum_{i = 1}^{N^{TRADE}} [\![ PL_i < 0 ]\!]

Percent of Profitable Trades
It it the ratio, expressed in percents, between the number of winning trades and all trades. It is defined as follows:

PROFITABLE.TRADES = \frac{N.WINNING}{N^{TRADE}} \times 100

Profit/loss statistics

Gross Loss
It is a sum of all unprofitable closed positions. It is defined as follows:

GROSS.LOSS = \sum_{i = 1}^{N^{TRADE}} PL_{i} [\![ PL_i < 0 ]\!]

Gross Profit
It is a sum of all profitable closed positions. It is defined as follows:

GROSS.PROFIT = \sum_{i = 1}^{N^{TRADE}} PL_{i} [\![ PL_i > 0 ]\!]

PnL%
It is the precentage change in the portfolio value, when the strategy is finished. It is defined as follows:

PnL\% = \frac{GROSS.PROFIT + GROSS.LOSS}{IC} \times 100

Profit Factor
It is a ratio between the ratio between total profit of all closed positions and the total loss of all closed positions. It is defined as follows:

PROFIT.FACTOR =
\begin{cases}
\frac{GROSS.PROFIT}{|GROSS.LOSS|} & \text{if } GROSS.LOSS \neq 0 \\
NULL & \text{if } GROSS.LOSS = 0
\end{cases}

Net Profit
It is the difference between the gross profit and the gross loss. It is defined as follows:

NET.PROFIT = GROSS.PROFIT - |GROSS.LOSS|

Last Price
It is the last market price of an instrument when the strategy is done. Its symbol is LAST.PRICE.
Closed PnL
Overall profit reduced by loss of all closed positions. Expresses actual accounted revenue of strategy at some moment i. Calculated basing on all actual transactions (the volume and price of transaction are known). Denoted as CLOSED.PL.
Estimated PnL
Theoretical profit reduced by loss concerning only open positions, estimated basing on current market price and volume of instruments kept in strategy’s portfolio. Denoted as ESTIMATED.PL.
Total PnL
This statistic is defined as a sum of the two previous statistics.

TOTAL.PL = ESTIMATED.PL + CLOSED.PL

Other statistics

Trading Period
Length of period between strategy start and it’s finish.
Longest Flat Period
Length of longest period in which closing trades did not give any profit.
Average Time In Market
Average time of position being open, calculated among all already closed positions.