ExchangeExpConfig
dataclass backtide.backtest.ExchangeExpConfig
Exchange and execution settings for an experiment.
| Attributes |
commission_type : str | CommissionType, default="percentage"
Fee structure applied to every executed order.
commission_pct : float, default=0.1
Percentage commission per trade.
commission_fixed : float, default=0.0
Fixed commission per trade.
slippage : float, default=0.05
Simulated market-impact percentage.
allowed_order_types : list[str | OrderType], default=["market"]
Which order types the engine accepts.
partial_fills : bool, default=False
Whether to simulate partial order fills.
allow_margin : bool, default=False
Whether margin trading is enabled.
max_leverage : float, default=2.0
Maximum leverage ratio.
initial_margin : float, default=50.0
Initial margin percentage.
maintenance_margin : float, default=25.0
Maintenance margin percentage.
margin_interest : float, default=0.0
Annual interest rate on borrowed funds.
raise_on_margin_limit : bool, default=False
If
allow_short_selling : bool, default=FalseTrue, the engine raises an error when an order would breach
max_leverage or when equity falls below maintenance_margin.
If False, orders are auto-shrunk or rejected and a warning is
recorded instead. Does not affect max_position_size, which
always rejects (never aborts) independently.
Whether short selling is permitted.
borrow_rate : float, default=0.0
Annual borrow cost for short positions.
raise_on_short_violation : bool, default=False
If
max_position_size : int, default=100True, the engine raises an error when a sell order would
create or increase a short position while allow_short_selling
is False. If False, such orders are silently rejected with a
warning instead of aborting the run.
Max allocation to one position (% of portfolio equity).
conversion_mode : str | CurrencyConversionMode, default="immediate"
How foreign-currency proceeds are converted.
conversion_threshold : float | None, default=None
Threshold for
conversion_period : str | ConversionPeriod | None, default=NoneHoldUntilThreshold mode.
Period for
conversion_interval : int | None, default=NoneEndOfPeriod mode.
Bar count for
CustomInterval mode.
|
See Also
Data settings for an experiment.
Complete configuration for a single backtest experiment.
Portfolio settings for an experiment.
Methods
| to_dict | Convert to a dictionary. |
method backtide.backtestto_dict()
Convert to a dictionary.
| Returns |
dict
Self as dict.
|