Strategy PropertiesΒΆ

Inside your strategy you can also get a lot of information about the state of the strategy and set specific variables to determine how the strategy works. Here is a list of those properties that you can use:

cash

Returns the current cash.

portfolio_value

Returns the current portfolio value (cash + positions value).

first_iteration

Returns True if this is the first iteration of the strategy (is True if the lifecycle method on_trading_iteration is being excuted for the first time).

is_backtesting

Returns True if the strategy is running in backtesting mode.

quote_asset

Returns the quote asset for the strategy.

name

Returns the name of the strategy.

initial_budget

Returns the initial budget for the strategy.

minutes_before_closing

Get or set the number of minutes that the strategy will stop executing before market closes.

minutes_before_opening

Get or set the number of minutes that the strategy will start executing before the market opens.

sleeptime

Get or set the current sleep time for the strategy.

last_on_trading_iteration_datetime

Returns the datetime of the last iteration.

timezone

Returns the timezone of the data source.

pytz

Returns the pytz object of the data source.

unspent_money

Deprecated, will be removed in the future.