The sum of the profits of all winning closed trades.
strategy.grossprofit is a series float: the total of every closed trade that made money, before the losing trades are subtracted. It never decreases.
Type
series float
Remarks
- Divide it by
strategy.grosslossfor the profit factor; guard against a grossloss of 0 on the first winning trades. - A large value is not a good sign on its own. Read it beside
strategy.grossloss, because net profit is the difference.
Example
//@version=6
strategy("Gross versus net", initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
if ta.crossover(ta.sma(close, 10), ta.sma(close, 30))
strategy.entry("Long", strategy.long)
if ta.crossunder(ta.sma(close, 10), ta.sma(close, 30))
strategy.close("Long")
plot(strategy.grossprofit, "Gross profit", color.green)
plot(strategy.netprofit, "Net profit", color.blue)See also
strategy.grosslossstrategy.netprofitstrategy.wintradesstrategy.grossprofit_percentstrategy.avg_winning_trade
Runs on Sidechair