Skip to main content

Strategy

Strategy

Account Info

FunctionStatusDescription
strategy.account_currencyAccount currency
strategy.equityAccount equity
strategy.grosslossGross loss
strategy.grossloss_percentGross loss percentage
strategy.grossprofitGross profit
strategy.grossprofit_percentGross profit percentage
strategy.initial_capitalInitial capital
strategy.margin_liquidation_priceMargin liquidation price
strategy.netprofitNet profit
strategy.netprofit_percentNet profit percentage

Trade Statistics

FunctionStatusDescription
strategy.avg_losing_tradeAverage losing trade
strategy.avg_losing_trade_percentAverage losing trade percent
strategy.avg_tradeAverage trade
strategy.avg_trade_percentAverage trade percent
strategy.avg_winning_tradeAverage winning trade
strategy.avg_winning_trade_percentAverage winning trade percent
strategy.closedtradesNumber of closed trades
strategy.eventradesNumber of even trades
strategy.losstradesNumber of losing trades
strategy.opentradesNumber of open trades
strategy.wintradesNumber of winning trades

Closed Trades

FunctionStatusDescription
strategy.closedtrades.first_indexFirst closed trade index
strategy.closedtrades.commission()Get commission
strategy.closedtrades.entry_bar_index()Get entry bar index
strategy.closedtrades.entry_comment()Get entry comment
strategy.closedtrades.entry_id()Get entry ID
strategy.closedtrades.entry_price()Get entry price
strategy.closedtrades.entry_time()Get entry time
strategy.closedtrades.exit_bar_index()Get exit bar index
strategy.closedtrades.exit_comment()Get exit comment
strategy.closedtrades.exit_id()Get exit ID
strategy.closedtrades.exit_price()Get exit price
strategy.closedtrades.exit_time()Get exit time
strategy.closedtrades.max_drawdown()Get max drawdown
strategy.closedtrades.max_drawdown_percent()Get max drawdown percent
strategy.closedtrades.max_runup()Get max runup
strategy.closedtrades.max_runup_percent()Get max runup percent
strategy.closedtrades.profit()Get profit
strategy.closedtrades.profit_percent()Get profit percent
strategy.closedtrades.size()Get size

Drawdown & Runup

FunctionStatusDescription
strategy.max_contracts_held_allMax contracts held (all)
strategy.max_contracts_held_longMax contracts held (long)
strategy.max_contracts_held_shortMax contracts held (short)
strategy.max_drawdownMaximum drawdown
strategy.max_drawdown_percentMaximum drawdown percent
strategy.max_runupMaximum runup
strategy.max_runup_percentMaximum runup percent

Position Info

FunctionStatusDescription
strategy.openprofitOpen profit
strategy.openprofit_percentOpen profit percent
strategy.position_avg_pricePosition average price
strategy.position_entry_namePosition entry name
strategy.position_sizePosition size

Open Trades

FunctionStatusDescription
strategy.opentrades.capital_heldCapital held
strategy.opentrades.commission()Get commission
strategy.opentrades.entry_bar_index()Get entry bar index
strategy.opentrades.entry_comment()Get entry comment
strategy.opentrades.entry_id()Get entry ID
strategy.opentrades.entry_price()Get entry price
strategy.opentrades.entry_time()Get entry time
strategy.opentrades.max_drawdown()Get max drawdown
strategy.opentrades.max_drawdown_percent()Get max drawdown percent
strategy.opentrades.max_runup()Get max runup
strategy.opentrades.max_runup_percent()Get max runup percent
strategy.opentrades.profit()Get profit
strategy.opentrades.profit_percent()Get profit percent
strategy.opentrades.size()Get size

Constants

FunctionStatusDescription
strategy.cashCash constant
strategy.fixedFixed constant
strategy.longLong constant
strategy.percent_of_equityPercent of equity constant
strategy.shortShort constant

Commission

FunctionStatusDescription
strategy.commission.cash_per_contractCash per contract
strategy.commission.cash_per_orderCash per order
strategy.commission.percentCommission percent

Direction

FunctionStatusDescription
strategy.direction.allAll directions
strategy.direction.longLong direction
strategy.direction.shortShort direction

OCA

FunctionStatusDescription
strategy.oca.cancelOCA cancel
strategy.oca.noneOCA none
strategy.oca.reduceOCA reduce

Order Management

FunctionStatusDescription
strategy.cancel()Cancel order
strategy.cancel_all()Cancel all orders

Position Management

FunctionStatusDescription
strategy.close()Close position
strategy.close_all()Close all positions
strategy.entry()Enter position
strategy.exit()Exit position
strategy.order()Place order

Conversion

FunctionStatusDescription
strategy.convert_to_account()Convert to account
strategy.convert_to_symbol()Convert to symbol
strategy.default_entry_qty()Default entry quantity

Risk Management

FunctionStatusDescription
strategy.risk.allow_entry_in()Allow entry in
strategy.risk.max_cons_loss_days()Max consecutive loss days
strategy.risk.max_drawdown()Max drawdown
strategy.risk.max_intraday_filled_orders()Max intraday filled orders
strategy.risk.max_intraday_loss()Max intraday loss
strategy.risk.max_position_size()Max position size