pybroker package
Global imports.
Submodules
- pybroker.cache module
CacheDateFields
DataSourceCacheKey
IndicatorCacheKey
ModelCacheKey
clear_caches()
clear_data_source_cache()
clear_indicator_cache()
clear_model_cache()
disable_caches()
disable_data_source_cache()
disable_indicator_cache()
disable_model_cache()
enable_caches()
enable_data_source_cache()
enable_indicator_cache()
enable_model_cache()
- pybroker.common module
- pybroker.config module
StrategyConfig
StrategyConfig.initial_cash
StrategyConfig.fee_mode
StrategyConfig.fee_amount
StrategyConfig.subtract_fees
StrategyConfig.enable_fractional_shares
StrategyConfig.round_fill_price
StrategyConfig.max_long_positions
StrategyConfig.max_short_positions
StrategyConfig.buy_delay
StrategyConfig.sell_delay
StrategyConfig.bootstrap_samples
StrategyConfig.bootstrap_sample_size
StrategyConfig.exit_on_last_bar
StrategyConfig.exit_cover_fill_price
StrategyConfig.exit_sell_fill_price
StrategyConfig.bars_per_year
StrategyConfig.return_signals
StrategyConfig.return_stops
StrategyConfig.round_test_result
- pybroker.context module
BaseContext
BaseContext.config
BaseContext.calc_target_shares()
BaseContext.cash
BaseContext.indicator()
BaseContext.input()
BaseContext.long_positions()
BaseContext.loss_rate
BaseContext.model()
BaseContext.orders()
BaseContext.pending_orders()
BaseContext.pos()
BaseContext.positions()
BaseContext.preds()
BaseContext.short_positions()
BaseContext.total_equity
BaseContext.total_margin
BaseContext.total_market_value
BaseContext.trades()
BaseContext.win_rate
ExecContext
ExecContext.symbol
ExecContext.buy_fill_price
ExecContext.buy_shares
ExecContext.buy_limit_price
ExecContext.sell_fill_price
ExecContext.sell_shares
ExecContext.sell_limit_price
ExecContext.hold_bars
ExecContext.score
ExecContext.session
ExecContext.stop_loss
ExecContext.stop_loss_pct
ExecContext.stop_loss_limit
ExecContext.stop_loss_exit_price
ExecContext.stop_profit
ExecContext.stop_profit_pct
ExecContext.stop_profit_limit
ExecContext.stop_profit_exit_price
ExecContext.stop_trailing
ExecContext.stop_trailing_pct
ExecContext.stop_trailing_limit
ExecContext.stop_trailing_exit_price
ExecContext.bars
ExecContext.calc_target_shares()
ExecContext.cancel_all_pending_orders()
ExecContext.cancel_pending_order()
ExecContext.cancel_stop()
ExecContext.cancel_stops()
ExecContext.close
ExecContext.cover_all_shares()
ExecContext.cover_fill_price
ExecContext.cover_limit_price
ExecContext.cover_shares
ExecContext.dt
ExecContext.foreign()
ExecContext.high
ExecContext.indicator()
ExecContext.input()
ExecContext.long_pos()
ExecContext.low
ExecContext.model()
ExecContext.open
ExecContext.preds()
ExecContext.sell_all_shares()
ExecContext.short_pos()
ExecContext.to_result()
ExecContext.volume
ExecContext.vwap
ExecResult
ExecResult.symbol
ExecResult.date
ExecResult.buy_fill_price
ExecResult.sell_fill_price
ExecResult.score
ExecResult.hold_bars
ExecResult.buy_shares
ExecResult.buy_limit_price
ExecResult.sell_shares
ExecResult.sell_limit_price
ExecResult.long_stops
ExecResult.short_stops
ExecResult.cover
ExecResult.pending_order_id
ExecResult.cover
ExecResult.long_stops
ExecResult.pending_order_id
ExecResult.short_stops
ExecSignal
PosSizeContext
set_exec_ctx_data()
set_pos_size_ctx_data()
- pybroker.data module
- pybroker.eval module
BootConfIntervals
BootstrapResult
ConfInterval
DrawdownConfs
DrawdownMetrics
EvalMetrics
EvalMetrics.trade_count
EvalMetrics.initial_market_value
EvalMetrics.end_market_value
EvalMetrics.total_pnl
EvalMetrics.unrealized_pnl
EvalMetrics.total_return_pct
EvalMetrics.annual_return_pct
EvalMetrics.total_profit
EvalMetrics.total_loss
EvalMetrics.total_fees
EvalMetrics.max_drawdown
EvalMetrics.max_drawdown_pct
EvalMetrics.win_rate
EvalMetrics.loss_rate
EvalMetrics.winning_trades
EvalMetrics.losing_trades
EvalMetrics.avg_pnl
EvalMetrics.avg_return_pct
EvalMetrics.avg_trade_bars
EvalMetrics.avg_profit
EvalMetrics.avg_profit_pct
EvalMetrics.avg_winning_trade_bars
EvalMetrics.avg_loss
EvalMetrics.avg_loss_pct
EvalMetrics.avg_losing_trade_bars
EvalMetrics.largest_win
EvalMetrics.largest_win_pct
EvalMetrics.largest_win_bars
EvalMetrics.largest_loss
EvalMetrics.largest_loss_pct
EvalMetrics.largest_loss_bars
EvalMetrics.max_wins
EvalMetrics.max_losses
EvalMetrics.sharpe
EvalMetrics.sortino
EvalMetrics.calmar
EvalMetrics.profit_factor
EvalMetrics.ulcer_index
EvalMetrics.upi
EvalMetrics.equity_r2
EvalMetrics.std_error
EvalMetrics.annual_std_error
EvalMetrics.annual_volatility_pct
EvalResult
EvaluateMixin
annual_total_return_percent()
avg_profit_loss()
bca_boot_conf()
calmar_ratio()
conf_profit_factor()
conf_sharpe_ratio()
iqr()
largest_win_loss()
log_profit_factor()
max_drawdown_percent()
max_wins_losses()
r_squared()
relative_entropy()
sharpe_ratio()
sortino_ratio()
total_profit_loss()
total_return_percent()
win_loss_rate()
winning_losing_trades()
- pybroker.ext.data module
- pybroker.indicator module
Indicator
IndicatorSet
IndicatorsMixin
adx()
aroon_diff()
aroon_down()
aroon_up()
close_minus_ma()
cubic_deviation()
cubic_trend()
delta_on_balance_volume()
detrended_rsi()
highest()
indicator()
intraday_intensity()
laguerre_rsi()
linear_deviation()
linear_trend()
lowest()
macd()
money_flow()
normalized_negative_volume_index()
normalized_on_balance_volume()
normalized_positive_volume_index()
price_change_oscillator()
price_intensity()
price_volume_fit()
quadratic_deviation()
quadratic_trend()
reactivity()
returns()
stochastic()
stochastic_rsi()
volume_momentum()
volume_weighted_ma_ratio()
- pybroker.log module
Logger
Logger.backtest_executions_loading()
Logger.backtest_executions_start()
Logger.calc_bootstrap_metrics_completed()
Logger.calc_bootstrap_metrics_start()
Logger.debug_buy_shares_exceed_cash()
Logger.debug_clear_data_source_cache()
Logger.debug_clear_indicator_cache()
Logger.debug_clear_model_cache()
Logger.debug_compute_indicators()
Logger.debug_disable_data_source_cache()
Logger.debug_disable_indicator_cache()
Logger.debug_disable_model_cache()
Logger.debug_enable_data_source_cache()
Logger.debug_enable_indicator_cache()
Logger.debug_enable_model_cache()
Logger.debug_filled_buy_order()
Logger.debug_filled_sell_order()
Logger.debug_get_data_source_cache()
Logger.debug_get_indicator_cache()
Logger.debug_get_model_cache()
Logger.debug_place_buy_order()
Logger.debug_place_sell_order()
Logger.debug_schedule_order()
Logger.debug_set_data_source_cache()
Logger.debug_set_indicator_cache()
Logger.debug_set_model_cache()
Logger.debug_unfilled_buy_order()
Logger.debug_unfilled_sell_order()
Logger.debug_unscheduled_order()
Logger.disable()
Logger.disable_progress_bar()
Logger.download_bar_data_completed()
Logger.download_bar_data_start()
Logger.enable()
Logger.enable_progress_bar()
Logger.indicator_data_loading()
Logger.indicator_data_start()
Logger.info_download_bar_data_start()
Logger.info_indicator_data_start()
Logger.info_invalidate_data_source_cache()
Logger.info_loaded_bar_data()
Logger.info_loaded_indicator_data()
Logger.info_loaded_model()
Logger.info_loaded_models()
Logger.info_train_model_completed()
Logger.info_train_model_start()
Logger.info_train_split_start()
Logger.info_walkforward_between_time()
Logger.info_walkforward_on_days()
Logger.loaded_bar_data()
Logger.loaded_indicator_data()
Logger.loaded_models()
Logger.train_split_completed()
Logger.train_split_start()
Logger.walkforward_completed()
Logger.walkforward_start()
Logger.warn_bootstrap_sample_size()
- pybroker.model module
- pybroker.portfolio module
Entry
Order
Portfolio
Portfolio.cash
Portfolio.equity
Portfolio.market_value
Portfolio.fees
Portfolio.fee_amount
Portfolio.subtract_fees
Portfolio.enable_fractional_shares
Portfolio.orders
Portfolio.margin
Portfolio.pnl
Portfolio.long_positions
Portfolio.short_positions
Portfolio.symbols
Portfolio.bars
Portfolio.position_bars
Portfolio.win_rate
Portfolio.loss_rate
Portfolio.buy()
Portfolio.capture_bar()
Portfolio.check_stops()
Portfolio.exit_position()
Portfolio.incr_bars()
Portfolio.remove_stop()
Portfolio.remove_stops()
Portfolio.sell()
PortfolioBar
Position
PositionBar
Stop
StopRecord
Trade
- pybroker.scope module
ColumnScope
IndicatorScope
ModelInputScope
PendingOrder
PendingOrderScope
PredictionScope
PriceScope
StaticScope
StaticScope.logger
StaticScope.data_source_cache
StaticScope.data_source_cache_ns
StaticScope.indicator_cache
StaticScope.indicator_cache_ns
StaticScope.model_cache
StaticScope.model_cache_ns
StaticScope.default_data_cols
StaticScope.custom_data_cols
StaticScope.all_data_cols
StaticScope.freeze_data_cols()
StaticScope.get_indicator()
StaticScope.get_indicator_names()
StaticScope.get_model_source()
StaticScope.has_indicator()
StaticScope.has_model_source()
StaticScope.instance()
StaticScope.param()
StaticScope.register_custom_cols()
StaticScope.set_indicator()
StaticScope.set_model_source()
StaticScope.unfreeze_data_cols()
StaticScope.unregister_custom_cols()
disable_logging()
disable_progress_bar()
enable_logging()
enable_progress_bar()
get_signals()
param()
register_columns()
unregister_columns()
- pybroker.slippage module
- pybroker.strategy module
- pybroker.vect module
adx()
aroon_diff()
aroon_down()
aroon_up()
close_minus_ma()
cross()
cubic_deviation()
cubic_trend()
delta_on_balance_volume()
detrended_rsi()
highv()
intraday_intensity()
inverse_normal_cdf()
laguerre_rsi()
linear_deviation()
linear_trend()
lowv()
macd()
money_flow()
normal_cdf()
normalized_negative_volume_index()
normalized_on_balance_volume()
normalized_positive_volume_index()
price_change_oscillator()
price_intensity()
price_volume_fit()
quadratic_deviation()
quadratic_trend()
reactivity()
returnv()
stochastic()
stochastic_rsi()
sumv()
volume_momentum()
volume_weighted_ma_ratio()