bbstrader 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bbstrader might be problematic. Click here for more details.

bbstrader/__ini__.py CHANGED
@@ -13,5 +13,4 @@ from bbstrader import btengine
13
13
  from bbstrader import metatrader
14
14
  from bbstrader import models
15
15
  from bbstrader import trading
16
- from bbstrader import strategies
17
16
  from bbstrader import tseries
@@ -12,7 +12,6 @@ Features
12
12
 
13
13
  - **Event-Driven Architecture**: Processes market data, generates signals, executes orders, and manages portfolio updates in response to events, closely mimicking live trading environments.
14
14
  - **Historical Market Data Support**: Utilizes historical OHLCV data from CSV files, Yahoo finance and MT5 terminal allowing for the testing of strategies over various market conditions and time frames.
15
- - **Strategy Implementation Flexibility**: Abstract base classes for strategies and other components enable users to define custom trading logic and data handling processes.
16
15
  - **Performance Metrics Calculation**: Includes tools for calculating key performance indicators, such as `Sharpe Ratio`, `Sortino Ratio`, and `drawdowns`, to evaluate the effectiveness of trading strategies.
17
16
  - **Visualization**: Generates plots of the `equity curve`, `returns`, `drawdowns`, and other metrics for comprehensive strategy `performance analysis`.
18
17
 
@@ -22,29 +21,34 @@ Components
22
21
  - **Backtest**: Orchestrates the backtesting process, managing events and invoking components.
23
22
  - **Event**: Abstract class for events, with implementations for market data, signals, fill and order events.
24
23
  - **DataHandler**: Abstract class for market data handling, with an implementation for `HistoricalCSVHandler`, `MT5HistoricDataHandler`, `YFHistoricDataHandler`. We will add another data handling in the future such as MacroEconomic Data, Fundamental Data, TICK Data and Real-time Data.
25
- - **Strategy**: Abstract class for trading strategies, allowing for custom signal generation logic.
26
24
  - **Portfolio**: Manages positions and calculates performance metrics, responding to market data and signals.
27
25
  - **ExecutionHandler**: Abstract class for order execution, with a simulated execution handler provided with an implementation for `SimulatedExecutionHandler`.
28
26
  - **Performance**: Utility functions for calculating performance metrics and visualizing strategy performance.
29
27
 
30
- Examples:
31
- >>> from bbstrader.btengine import run_backtest
32
- >>> run_backtest(test_mode=True, test_strategy='ou', test_quantity=2000)
28
+ Examples
29
+ ========
33
30
 
31
+ >>> from bbstrader.btengine import run_backtest
32
+ >>> from datetime import datetime
34
33
  >>> run_backtest(
35
34
  ... symbol_list=['AAPL', 'GOOG'],
36
35
  ... start_date=datetime(2020, 1, 1),
37
- ... data_handler=CustomDataHandler(),
38
- ... strategy=MovingAverageStrategy(),
39
- ... exc_handler=CustomExecutionHandler(),
36
+ ... data_handler=DataHandler,
37
+ ... strategy=Strategy,
38
+ ... exc_handler=ExecutionHandler,
40
39
  ... initial_capital=500000.0,
41
40
  ... heartbeat=1.0
42
41
  ... )
42
+
43
+ Notes
44
+ =====
45
+
46
+ See `bbstrader.btengine.backtest.run_backtest` for more details on the backtesting process and its parameters.
43
47
  """
44
48
  from bbstrader.btengine.data import *
45
49
  from bbstrader.btengine.event import *
46
50
  from bbstrader.btengine.execution import *
47
51
  from bbstrader.btengine.performance import *
48
52
  from bbstrader.btengine.backtest import *
49
- from bbstrader.btengine.portfolio import Portfolio
50
53
  from bbstrader.btengine.strategy import Strategy
54
+ from bbstrader.btengine.portfolio import Portfolio