Hi,

For our trading bot we are trying to integrate the following stuff:

- Z-score
- Sharpe ratio
- Sortino ratio

The problem we have is that we use the double down strategy (rebuy more stocks if the price drops x % at the moment our tool indicators tell us that we have a high performance to win the new trade). Because of this strategy we don’t have the losing numbers we need in the calculation. Hope someone can help us with this part:

Concrete we like to use this formula:

Z = [N x (R – 0.5) – P] / [(P x (P – N)] / (N – 1)]½

When:

N is the total number of trades during a series;

R is the total number of series of winning and losing trades;

P equals 2 x W x L

W is the total number of winning trades during a series

L is the total number of losing trades during a series

Problem is we dont have losing trades (continue rebuy, dont use a stoploss)

Anyone has a solution how we can fix this?