runs as written · runs with Bentrix's own convention, said in its note · refused by name, the note says what Bentrix lacks · not yet built.
Functions
strategy.cancel#
strategy.cancel(id: string)Cancels the run's pending entries named id
id | string | required |
strategy.cancel_all#
strategy.cancel_all()Cancels every pending entry of the run on this market
strategy.close#
strategy.close(id: string, comment: string?, qty: float?, qty_percent: float?, alert_message: string?, immediately: bool?, disable_alert: bool?)Closes what the entry opened
id | string | required |
comment | string | optional |
qty | float | optional |
qty_percent | float | optional |
alert_message | string | optional |
immediately | bool | optional |
disable_alert | bool | optional |
strategy.close_all#
strategy.close_all(comment: string?, alert_message: string?, immediately: bool?, disable_alert: bool?)Closes every position of the run on this market
comment | string | optional |
alert_message | string | optional |
immediately | bool | optional |
disable_alert | bool | optional |
strategy.entry#
strategy.entry(id: string, direction: string, qty: float?, limit: float?, stop: float?, oca_name: string?, oca_type: string?, comment: string?, alert_message: string?, disable_alert: bool?)An entry at the candle's close: market, limit, stop or stop-limit; one against an open position closes it first
id | string | required |
direction | string | required |
qty | float | optional |
limit | float | optional |
stop | float | optional |
oca_name | string | optional |
oca_type | string | optional |
comment | string | optional |
alert_message | string | optional |
disable_alert | bool | optional |
strategy.exit#
strategy.exit(id: string, from_entry: string?, qty: float?, qty_percent: float?, profit: float?, limit: float?, loss: float?, stop: float?, trail_price: float?, trail_points: float?, trail_offset: float?, oca_name: string?, comment: string?, comment_profit: string?, comment_loss: string?, comment_trailing: string?, alert_message: string?, alert_profit: string?, alert_loss: string?, alert_trailing: string?, disable_alert: bool?)The position's stop and target on the venue, a partial close for less than all of it, a trail run in Bentrix
id | string | required |
from_entry | string | optional |
qty | float | optional |
qty_percent | float | optional |
profit | float | optional |
limit | float | optional |
loss | float | optional |
stop | float | optional |
trail_price | float | optional |
trail_points | float | optional |
trail_offset | float | optional |
oca_name | string | optional |
comment | string | optional |
comment_profit | string | optional |
comment_loss | string | optional |
comment_trailing | string | optional |
alert_message | string | optional |
alert_profit | string | optional |
alert_loss | string | optional |
alert_trailing | string | optional |
disable_alert | bool | optional |
strategy.order#
strategy.order(id: string, direction: string, qty: float?, limit: float?, stop: float?, oca_name: string?, oca_type: string?, comment: string?, alert_message: string?, disable_alert: bool?)An order with no reversal
id | string | required |
direction | string | required |
qty | float | optional |
limit | float | optional |
stop | float | optional |
oca_name | string | optional |
oca_type | string | optional |
comment | string | optional |
alert_message | string | optional |
disable_alert | bool | optional |
Variables
strategy.account_currency#
The workbench's account currency
strategy.closedtrades#
The run's closed trades
strategy.equity#
The workbench's equity
strategy.eventrades#
The run's closed trades at exactly zero
strategy.grossloss#
The run's losing trades' sum
strategy.grossprofit#
The run's winning trades' sum
strategy.initial_capital#
The workbench's opening balance, never the script's declaration
strategy.losstrades#
The run's losing closed trades
strategy.max_drawdown#
The run's largest equity drawdown in money
strategy.netprofit#
The run's closed profit, net of costs
strategy.openprofit#
The open position's profit in the account's currency
strategy.opentrades#
The run's open positions on this market
strategy.position_avg_price#
The position's entry price, na flat
strategy.position_entry_name#
The id of the entry that opened the position
strategy.position_size#
The run's position on this market in lots, short negative
strategy.wintrades#
The run's winning closed trades
Constants
strategy.cash#
A quantity type: money, turned into lots at the entry quote
strategy.commission.*#
Commission types, read and not used: the feed's costs are
strategy.direction.*#
Strategy.direction.all, long, short
strategy.fixed#
A quantity type: lots
strategy.long#
A direction
strategy.oca.*#
Strategy.oca.none, cancel, reduce
strategy.percent_of_equity#
A quantity type: a share of the equity, as money
strategy.short#
A direction
Families
strategy.*#
A strategy script is a second body under Bentrix's strategy runner; its account, costs and fills are the workbench's
strategy.risk.*#
The run's limits read from a script; the document's limits stand for them