Bentrix Docs
HomePricingDashboard

Assay reference: strategy — orders and the run

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#

runs — Bentrix's own convention
strategy.cancel(id: string)

Cancels the run's pending entries named id

idstringrequired

strategy.cancel_all#

runs — Bentrix's own convention
strategy.cancel_all()

Cancels every pending entry of the run on this market

strategy.close#

runs — Bentrix's own convention
strategy.close(id: string, comment: string?, qty: float?, qty_percent: float?, alert_message: string?, immediately: bool?, disable_alert: bool?)

Closes what the entry opened

idstringrequired
commentstringoptional
qtyfloatoptional
qty_percentfloatoptional
alert_messagestringoptional
immediatelybooloptional
disable_alertbooloptional

strategy.close_all#

runs — Bentrix's own convention
strategy.close_all(comment: string?, alert_message: string?, immediately: bool?, disable_alert: bool?)

Closes every position of the run on this market

commentstringoptional
alert_messagestringoptional
immediatelybooloptional
disable_alertbooloptional

strategy.entry#

runs — Bentrix's own convention
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

idstringrequired
directionstringrequired
qtyfloatoptional
limitfloatoptional
stopfloatoptional
oca_namestringoptional
oca_typestringoptional
commentstringoptional
alert_messagestringoptional
disable_alertbooloptional

strategy.exit#

runs — Bentrix's own convention
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

idstringrequired
from_entrystringoptional
qtyfloatoptional
qty_percentfloatoptional
profitfloatoptional
limitfloatoptional
lossfloatoptional
stopfloatoptional
trail_pricefloatoptional
trail_pointsfloatoptional
trail_offsetfloatoptional
oca_namestringoptional
commentstringoptional
comment_profitstringoptional
comment_lossstringoptional
comment_trailingstringoptional
alert_messagestringoptional
alert_profitstringoptional
alert_lossstringoptional
alert_trailingstringoptional
disable_alertbooloptional

strategy.order#

runs — Bentrix's own convention
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

idstringrequired
directionstringrequired
qtyfloatoptional
limitfloatoptional
stopfloatoptional
oca_namestringoptional
oca_typestringoptional
commentstringoptional
alert_messagestringoptional
disable_alertbooloptional

Variables

strategy.account_currency#

runs — Bentrix's own convention

The workbench's account currency

strategy.closedtrades#

runs — Bentrix's own convention

The run's closed trades

strategy.equity#

runs — Bentrix's own convention

The workbench's equity

strategy.eventrades#

runs — Bentrix's own convention

The run's closed trades at exactly zero

strategy.grossloss#

runs — Bentrix's own convention

The run's losing trades' sum

strategy.grossprofit#

runs — Bentrix's own convention

The run's winning trades' sum

strategy.initial_capital#

runs — Bentrix's own convention

The workbench's opening balance, never the script's declaration

strategy.losstrades#

runs — Bentrix's own convention

The run's losing closed trades

strategy.max_drawdown#

runs — Bentrix's own convention

The run's largest equity drawdown in money

strategy.netprofit#

runs — Bentrix's own convention

The run's closed profit, net of costs

strategy.openprofit#

runs — Bentrix's own convention

The open position's profit in the account's currency

strategy.opentrades#

runs — Bentrix's own convention

The run's open positions on this market

strategy.position_avg_price#

runs — Bentrix's own convention

The position's entry price, na flat

strategy.position_entry_name#

runs — Bentrix's own convention

The id of the entry that opened the position

strategy.position_size#

runs — Bentrix's own convention

The run's position on this market in lots, short negative

strategy.wintrades#

runs — Bentrix's own convention

The run's winning closed trades

Constants

strategy.cash#

runs

A quantity type: money, turned into lots at the entry quote

strategy.commission.*#

runs

Commission types, read and not used: the feed's costs are

strategy.direction.*#

runs

Strategy.direction.all, long, short

strategy.fixed#

runs

A quantity type: lots

strategy.long#

runs

A direction

strategy.oca.*#

runs

Strategy.oca.none, cancel, reduce

strategy.percent_of_equity#

runs

A quantity type: a share of the equity, as money

strategy.short#

runs

A direction

Families

strategy.*#

not yet

A strategy script is a second body under Bentrix's strategy runner; its account, costs and fills are the workbench's

strategy.risk.*#

not yet

The run's limits read from a script; the document's limits stand for them

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed