Skip to main content
Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: strategy · Entries: 15

strategy.account_currency (variable)

Definition The currency the strategy’s figures are reported in, as a string. Type series string Example
GoCharting is a charting and analytics tool. This is not investment advice. Trading and investing carry a high risk of loss and are not suitable for everyone. You can lose some or all of your money.

strategy.closedtrades (variable)

Definition The number of trades closed so far. Type series int Example

strategy.equity (variable)

Definition The strategy’s current equity: initial capital plus net profit plus open profit. Type series float Example

strategy.grossloss (variable)

Definition The total of the profits of all closed trades that did not make a profit, so it is zero or negative: a trade that lost 10 adds -10. Type series float Example

strategy.grossprofit (variable)

Definition The total profit of all winning closed trades. Type series float Example

strategy.initial_capital (variable)

Definition The initial capital set in strategy(). Type series float Example

strategy.losstrades (variable)

Definition The number of closed trades whose profit is zero or negative: a trade that closes at break-even counts here, so strategy.wintrades plus strategy.losstrades equals strategy.closedtrades. Type series int Example

strategy.max_drawdown (variable)

Definition The largest peak-to-trough fall in equity so far. Type series float Example

strategy.max_runup (variable)

Definition The largest trough-to-peak rise in equity so far. Type series float Example

strategy.netprofit (variable)

Definition The total profit of all closed trades, net of commission; a loss is negative. In this build the commission of an entry is deducted when the trade opens, so the value falls at the entry, before the trade closes; the commission of the exit is deducted when it closes. Type series float Example

strategy.openprofit (variable)

Definition The current, unrealised profit of the open position; a loss is negative. Type series float Example

strategy.opentrades (variable)

Definition The number of trades open now (entries not yet closed). Type series int Example

strategy.position_avg_price (variable)

Definition The average entry price of the current position. It is 0, not na, when the position is flat. Type series float Example

strategy.position_size (variable)

Definition The size of the current position: positive when long, negative when short, 0 when flat. Type series float Example

strategy.wintrades (variable)

Definition The number of closed trades that made a profit. Type series int Example