diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 000000000..c73e032c0 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/README.md b/README.md index d7b8aadfb..47a096c0c 100644 --- a/README.md +++ b/README.md @@ -1,103 +1,169 @@ -# Slim Backtrader +# backtrader -This is a fork of the original [backtrader](https://github.com/mementum/backtrader) - slimmed down. -Unnecessary features and updating the package to ensure compatibility with newer Python versions and dependencies. +Directory containing backtrader related files. Primarily contains Python code, includes test files, includes documentation, and includes configuration files. -Aims of this project: +## Navigation -- Slim down unnecessary features -- Improve performance -- Update aged implementations +* This is the root directory of the repository -For now the focus is: +### Subdirectories -- Code clean-up: remove unncessary imports -- Syntax update: make it more modern -- Remove deprecated integrations (i.e. pyfolio, IbPy, comtypes) -- Remove interactive plotting: the backend is heavy and slow -- Improved support for parallel processing +* [Tutorials](Tutorials/README.md) - Contains tutorial code and examples +* [arbitrage](arbitrage/README.md) - Contains arbitrage strategy implementations +* [backtest](backtest/README.md) - Contains backtesting functionality +* [backtrader](backtrader/README.md) - Directory containing backtrader related files +* [contrib](contrib/README.md) - Contains contributed code +* [datas](datas/README.md) - Contains data files +* [logs](logs/README.md) - Contains log files +* [outcome](outcome/README.md) - Directory containing outcome related files +* [prompts](prompts/README.md) - Directory containing prompts related files +* [qmtbt](qmtbt/README.md) - Directory containing qmtbt related files +* [reference](reference/README.md) - Directory containing reference related files +* [samples](samples/README.md) - Contains sample code and examples +* [sandbox](sandbox/README.md) - Contains experimental or sandbox code +* [src](src/README.md) - Contains source code +* [strategies](strategies/README.md) - Contains trading strategy implementations +* [tests](tests/README.md) - Contains test files and test utilities +* [tools](tools/README.md) - Contains tools and utilities +* [turtle](turtle/README.md) - Directory containing turtle related files +* [xtquant](xtquant/README.md) - Directory containing xtquant related files -This is an ongoing process that has just started and will hopefully bring life to an excellent project. +## Files -Feel free to contribute! +### BackTrader_Multifactors_Backtesting_Framework.ipynb ---- +Binary or data file -## Features +### ENV.sh -A Python-based platform for live trading and backtesting, featuring: +Shell script -- **Live Data Feed and Trading**: - - Interactive Brokers (requires `IbPy`, significantly benefits from installed `pytz`) - - *Visual Chart* (requires fork of `comtypes` until pull request integration, benefits from `pytz`) - - *Oanda* (requires `oandapy`, REST API only – v20 streaming not supported) +### LICENSE -- **Data Sources**: - - CSV/files, online sources, or via *pandas* and *blaze* +Binary or data file -- **Data Management**: - - Filters (e.g., daily bars into intraday chunks, Renko bricks) - - Multiple data feeds and strategies supported - - Multiple simultaneous timeframes - - Integrated resampling and replaying capabilities +### PLAN.md -- **Backtesting Modes**: - - Step-by-step execution or all-at-once (strategy evaluation exception) +Documentation file -- **Indicators**: - - Extensive built-in indicators (full list available [here](http://www.backtrader.com/docu/indautoref.html)) - - *TA-Lib* integration (requires Python *ta-lib*) - - Easy creation of custom indicators +### PLANNING.md -- **Analyzers and Utilities**: - - Built-in analyzers (e.g., TimeReturn, Sharpe Ratio, SQN) - - `pyfolio` integration (**deprecated**) +Documentation file -- **Broker Simulation**: - - Supports multiple order types: *Market*, *Close*, *Limit*, *Stop*, *StopLimit*, *StopTrail*, *StopTrailLimit*, *OCO*, bracket orders, slippage, volume filling strategies, continuous cash adjustments for futures-like instruments +### README.rst -- **Automated Staking**: - - Sizers for position sizing +Binary or data file -- **Cheating Modes**: - - Cheat-on-Close - - Cheat-on-Open +### __init__.py -- **Schedulers and Calendars** -- **Plotting** *(requires matplotlib)* +Python module ---- +### agent.py -## Installation +Pull historical data for a given ticker and date range and save as a CSV file. -Backtrader is self-contained with minimal external dependencies (plotting requires `matplotlib`). +### changelog.txt -Currently, the installation takes place by navigating to the clone of this repository and running: +Documentation file -```shell script -pip install -e -``` +### demo.ipynb -## Python Compatibility +Binary or data file -Works with: +### demo_origin.ipynb -- Python version `>= 3.10` +Binary or data file -## Documentation +### live_backtrader.py -- **Original backtrader repository**: -- **Blog**: [Backtrader Blog](http://www.backtrader.com/blog) -- **Docs**: [Full Documentation](http://www.backtrader.com/docu) -- **Indicators Reference**: [List of Built-in Indicators (122)](http://www.backtrader.com/docu/indautoref.html) -## Version Numbering -Follows format `X.Y.Z.I` where: +### my_backtrader.code-workspace -- `X`: Major version (stable, unless significant overhauls, e.g., numpy integration). -- `Y`: Minor version (new features or incompatible API changes). -- `Z`: Revision updates (documentation tweaks, minor changes, bug fixes). -- `I`: Number of built-in indicators. +Binary or data file ---- +### pylint_head.txt + +Documentation file + +### pylint_report.txt + +Large file (2.2 MB) + +### pypi.sh + +Shell script + +### pyproject.toml + +Configuration file + +### requirements-test.txt + +Test file + +### rez + +Binary or data file + +### rsi_arbitrage_plot.png + +Binary or data file + +### sharpe_parameter_heatmap.png + +Binary or data file + +### sharpe_ratio_heatmap.png + +Binary or data file + +### sharpe_ratio_plot.png + +Binary or data file + +### skewness_plot.png + +Binary or data file + +### strategies.py + + + +### test_feed.ipynb + +Binary or data file + +### the_backtradersold_setup.py + +Setup/installation file + +### tox.ini + +Configuration file + +### try.py + +为每个股票优化独立参数 [Contains Chinese characters that should be translated] + +### zscore_heatmap.png + +Binary or data file + + +## Directory Summary + +This directory contains 31 files and 19 subdirectories. + +### File Types + +* .py: 6 files +* .png: 6 files +* .ipynb: 4 files +* .txt: 4 files +* .md: 3 files +* .sh: 2 files +* .rst: 1 files +* .code-workspace: 1 files +* .toml: 1 files +* .ini: 1 files diff --git a/Tutorials/README.md b/Tutorials/README.md new file mode 100644 index 000000000..0d7d3df51 --- /dev/null +++ b/Tutorials/README.md @@ -0,0 +1,27 @@ +# Tutorials + +Contains tutorial code and examples. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [platform_concepts](platform_concepts/README.md) - Directory containing platform_concepts related files +* [quickstart](quickstart/README.md) - Directory containing quickstart related files + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 2 subdirectories. + +### File Types + +* .py: 1 files diff --git a/Tutorials/platform_concepts/README.md b/Tutorials/platform_concepts/README.md new file mode 100644 index 000000000..3db4e191c --- /dev/null +++ b/Tutorials/platform_concepts/README.md @@ -0,0 +1,22 @@ +# platform_concepts + +Directory containing platform_concepts related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (Tutorials)](../README.md) + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/Tutorials/quickstart/README.md b/Tutorials/quickstart/README.md new file mode 100644 index 000000000..af7a72374 --- /dev/null +++ b/Tutorials/quickstart/README.md @@ -0,0 +1,46 @@ +# quickstart + +Directory containing quickstart related files. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (Tutorials)](../README.md) + +## Files + +### 101.py + +Python module + +### 102.py + +Python module + +### 103.py + + + +### 104_orig.py + +Python module + +### __init__.py + +Python module + +### strategy_tester.py + +Test file + +### test_strategies.py + +Sandbox for different test strategies + + +## Directory Summary + +This directory contains 7 files and 0 subdirectories. + +### File Types + +* .py: 7 files diff --git a/Tutorials/quickstart/strategy_tester.py b/Tutorials/quickstart/strategy_tester.py index 45046edc6..8d13e1707 100644 --- a/Tutorials/quickstart/strategy_tester.py +++ b/Tutorials/quickstart/strategy_tester.py @@ -83,8 +83,8 @@ print(f"Starting Portfolio Value: {cerebro.broker.getvalue():,.2f}") # Run over everything - # maxcpus=1 ist wichtig, wenn mehrere Varianten über optstrategy - # analysiert werden + # maxcpus=1 is important when multiple variants are used via optstrategy + # are being analyzed cerebro.run(maxcpus=1) print("Trade Results:") diff --git a/Tutorials/quickstart/test_strategies.py b/Tutorials/quickstart/test_strategies.py index efec39c7c..6e7bf600e 100644 --- a/Tutorials/quickstart/test_strategies.py +++ b/Tutorials/quickstart/test_strategies.py @@ -62,9 +62,9 @@ def __init__(self): ) # Delayed indexing. - # Wenn ich hier self._dataclose[-delay] nehme, wird der *jetzt* aktuelle Wert genommen - # Die Formulierung hier ist äquivalent zu self._dataclose[-1] > self._sma in next() - # Hier wird ein LineOwnOperation erzeugt, kein Wert (bool) + # If I take self._dataclose[-delay] here, the *current* value is taken + # The formulation here is equivalent to self._dataclose[-1] > self._sma in next() + # Here a LineOwnOperation is created, not a value (bool) self._buy_condition: bt.LineOwnOperation = ( self._dataclose(-self.p.delay) > self._sma ) @@ -124,10 +124,10 @@ def log(self, txt: str, dt=None, caller: str = None, print_it: bool = False): print(f"{bars_processed:3} {caller:15}\t{formatted_date} {txt}") def next(self): - """Die Methode next() in einer Backtrader-Strategie wird bei jedem neuen Datenpunkt (Bar) aufgerufen und enthält - die Handelslogik der Strategie. - Die next()-Methode überprüft den aktuellen Marktstatus, entscheidet basierend auf der definierten Handelslogik, - ob Kauf- oder Verkaufsorders erstellt werden sollen, und loggt relevante Informationen. + """The next() method in a Backtrader strategy is called for each new data point (bar) and contains + the trading logic of the strategy. + The next() method checks the current market status, decides based on the defined trading logic + whether buy or sell orders should be created, and logs relevant information. """ @@ -165,31 +165,31 @@ def next(self): # Check if we are in the market. Every completed BUY order creates a # position? if not self.position: - # Noch nicht im Markt ... wir KÖNNTEN kaufen, wenn ... + # Not in the market yet... we COULD buy if... if self._buy_condition: # (identisch zu self._buy_condition) - # KAUFEN, KAUFEN, KAUFEN!!! (mit allen möglichen - # Standardparametern) + # BUY, BUY, BUY!!! (with all possible + # standard parameters) buy_order_message = ( - f"{Fore.GREEN}Erstelle KAUF-Bestellung" + f"{Fore.GREEN}Creating BUY order" f" {self._dataclose[0]:,.2f}{Fore.RESET}" ) self.log(buy_order_message, caller="func next") self._order = self.buy() else: - # Bereits im Markt (Positionen existieren) ... wir könnten - # verkaufen + # Already in the market (positions exist) ... we could + # sell if self._sell_condition: - # VERKAUFEN, VERKAUFEN, VERKAUFEN!!! (mit allen möglichen - # Standardparametern) + # SELL, SELL, SELL!!! (with all possible + # standard parameters) sell_order_message = ( - f"{Fore.YELLOW}Erstelle VERKAUF-Bestellung" + f"{Fore.YELLOW}Creating SELL order" f" {self._dataclose[0]:,.2f}{Fore.RESET}" ) self.log( sell_order_message, ) - # Verfolge die erstellte Bestellung, um eine zweite Bestellung - # zu vermeiden + # Track the created order to avoid a second order + # being placed self._order = self.sell() def notify_order(self, order): @@ -304,7 +304,7 @@ def __init__(self): self._sma = bt.indicators.SimpleMovingAverage( self._dataclose, period=self.p.period ) - # _cmpval wird erst in next() berechnet (verzögert) + # _cmpval is only calculated in next() (delayed) self._cmpval: bt.linebuffer.LinesOperation = ( self._dataclose(-self.p.delay) > self._sma ) @@ -324,8 +324,8 @@ def next(self): # print(f'Using delayed indexing: {bool(self._cmpval)=}') # Using __call__ method - # Ganz blöde Idee, weil _bei jedem Aufruf_ die Berechnung neu gemacht wird und ein neues - # Objekt erzeugt wird. Das ist nicht nur ineffizient, sondern auch fehleranfällig. + # Very bad idea, because the calculation is redone _with each call_ and a new + # object is created. This is not only inefficient, but also error-prone. # buy_condition_call:bt.linebuffer.LinesOperatio = self._dataclose(-self.p.delay) > self._sma # if len(buy_condition_call) > 0: # print(f'Using __call__: {buy_condition_call[0]=}') @@ -477,7 +477,7 @@ def __init__(self): self._sma0 = bt.indicators.SimpleMovingAverage(self._dataclose_daily, period=20) self._sma1 = bt.indicators.SimpleMovingAverage(self._dataclose_weekly, period=5) - # Erzeugt einen Indexfehler, weil die Daten unterschiedlich lang sind + # Generates an index error because the data has different lengths # sma_daily: 255, sma_weekly: 50 self._buysig = self._sma0 > self._sma1(-1) diff --git a/arbitrage/CUSUM_GridSearch_CLI.py b/arbitrage/CUSUM_GridSearch_CLI.py index bf8103be2..2781f2758 100644 --- a/arbitrage/CUSUM_GridSearch_CLI.py +++ b/arbitrage/CUSUM_GridSearch_CLI.py @@ -147,24 +147,11 @@ def notify_trade(self, trade): if trade.isclosed: print( - "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" - % ( - trade.ref, - bt.num2date(trade.dtclose), - trade.pnl, - trade.pnlcomm, - trade.value, - ) + f"TRADE {trade.ref} CLOSED, PROFIT: GROSS {trade.pnl:.2f}, NET {trade.pnlcomm:.2f}, PRICE {trade.value}" ) elif trade.justopened: print( - "TRADE %s OPENED %s , SIZE %2d, PRICE %d " - % ( - trade.ref, - bt.num2date(trade.dtopen), - trade.size, - trade.value, - ) + f"TRADE {trade.ref} OPENED {trade.dtopen}, SIZE {trade.size}, PRICE {trade.value}" ) @@ -180,7 +167,7 @@ def run_strategy( ): """运行单次回测""" # 创建回测引擎 - cerebro = bt.Cerebro(stdstats=False) + cerebro = bt.Cerebro() cerebro.adddata(data0, name="data0") cerebro.adddata(data1, name="data1") cerebro.adddata(data2, name="spread") @@ -218,7 +205,7 @@ def run_strategy( sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) - roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + roi = strat.analyzers.tradeanalyzer.get_analysis().get("roi", 0) trades = strat.analyzers.tradeanalyzer.get_analysis() # 获取交易统计 @@ -307,21 +294,9 @@ def grid_search( df_spread = calculate_rolling_spread(df0, df1, window=spread_window) # 添加数据 - data0 = bt.feeds.PandasData( - dataname=df0, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + data0 = bt.feeds.PandasData(dataname=df0) + data1 = bt.feeds.PandasData(dataname=df1) + data2 = SpreadData(dataname=df_spread) for win in win_values: for k_coeff in k_coeff_values: diff --git a/arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py b/arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py index 2f157f5ca..cc1df7320 100644 --- a/arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py +++ b/arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py @@ -157,10 +157,10 @@ def notify_trade(self, trade): if trade.isclosed: print( - "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + "TRADE %s CLOSED, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" % ( trade.ref, - bt.num2date(trade.dtclose), + pd.Timestamp(trade.dtclose), trade.pnl, trade.pnlcomm, trade.value, @@ -171,7 +171,7 @@ def notify_trade(self, trade): "TRADE %s OPENED %s , SIZE %2d, PRICE %d " % ( trade.ref, - bt.num2date(trade.dtopen), + pd.Timestamp(trade.dtopen), trade.size, trade.value, ) @@ -191,7 +191,7 @@ def run_strategy( ): """运行单次回测""" # 创建回测引擎 - cerebro = bt.Cerebro(stdstats=False) + cerebro = bt.Cerebro() cerebro.adddata(data0, name="data0") cerebro.adddata(data1, name="data1") cerebro.adddata(data2, name="spread") @@ -211,18 +211,6 @@ def run_strategy( cerebro.broker.setcash(100000) cerebro.broker.set_shortcash(False) - # 添加分析器 - cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, - riskfreerate=0, - annualize=True, - ) - cerebro.addanalyzer(bt.analyzers.DrawDown) - cerebro.addanalyzer(bt.analyzers.Returns) - cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) - cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) - # 运行回测 results = cerebro.run() @@ -290,21 +278,9 @@ def grid_search(): df_spread = calculate_rolling_spread(df0, df1, window=spread_window) # 添加数据 - data0 = bt.feeds.PandasData( - dataname=df0, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + data0 = bt.feeds.PandasData(dataframe=df0) + data1 = bt.feeds.PandasData(dataframe=df1) + data2 = SpreadData(dataframe=df_spread, fromdate=fromdate, todate=todate) for rsi_period in rsi_period_values: for rsi_threshold in rsi_threshold_values: diff --git a/arbitrage/JM_J_strategy_ZScore_GridSearch.py b/arbitrage/JM_J_strategy_ZScore_GridSearch.py index 07c5ccdc1..fc9c07415 100644 --- a/arbitrage/JM_J_strategy_ZScore_GridSearch.py +++ b/arbitrage/JM_J_strategy_ZScore_GridSearch.py @@ -146,31 +146,18 @@ def notify_trade(self, trade): if trade.isclosed: print( - "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" - % ( - trade.ref, - bt.num2date(trade.dtclose), - trade.pnl, - trade.pnlcomm, - trade.value, - ) + f"TRADE {trade.ref} CLOSED, PROFIT: GROSS {trade.pnl:.2f}, NET {trade.pnlcomm:.2f}, PRICE {trade.value}" ) elif trade.justopened: print( - "TRADE %s OPENED %s , SIZE %2d, PRICE %d " - % ( - trade.ref, - bt.num2date(trade.dtopen), - trade.size, - trade.value, - ) + f"TRADE {trade.ref} OPENED {trade.dtopen}, SIZE {trade.size}, PRICE {trade.value}" ) def run_strategy(data0, data1, data2, win, entry_zscore, exit_zscore, spread_window=60): """运行单次回测""" # 创建回测引擎 - cerebro = bt.Cerebro(stdstats=False) + cerebro = bt.Cerebro() cerebro.adddata(data0, name="data0") cerebro.adddata(data1, name="data1") cerebro.adddata(data2, name="spread") @@ -344,21 +331,9 @@ def grid_search(): df_spread = calculate_rolling_spread(df0, df1, window=spread_window) # 添加数据 - data0 = bt.feeds.PandasData( - dataname=df0, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - ) - data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + data0 = bt.feeds.PandasData(dataframe=df0) + data1 = bt.feeds.PandasData(dataframe=df1) + data2 = SpreadData(dataframe=df_spread, fromdate=fromdate, todate=todate) for win in win_values: for entry_zscore in entry_zscore_values: diff --git a/arbitrage/JM_J_strategy_adjust_pair_ratio.py b/arbitrage/JM_J_strategy_adjust_pair_ratio.py index a03152bf7..0107ca8ca 100644 --- a/arbitrage/JM_J_strategy_adjust_pair_ratio.py +++ b/arbitrage/JM_J_strategy_adjust_pair_ratio.py @@ -83,9 +83,9 @@ class SpreadData(bt.feeds.PandasData): df_spread_bt = df_spread[ (df_spread["date"] >= fromdate) & (df_spread["date"] <= todate) ] -data0 = bt.feeds.PandasData(dataname=df0_bt, datetime="date") -data1 = bt.feeds.PandasData(dataname=df1_bt, datetime="date") -data2 = SpreadData(dataname=df_spread_bt, datetime="date") +data0 = bt.feeds.PandasData(dataframe=df0_bt) +data1 = bt.feeds.PandasData(dataframe=df1_bt) +data2 = SpreadData(dataframe=df_spread_bt) class DynamicSpreadStrategy(bt.Strategy): @@ -99,12 +99,10 @@ class DynamicSpreadStrategy(bt.Strategy): def __init__(self): """ """ # Bollinger Bands indicator - using passed spread data - self.boll = bt.indicators.BollingerBands( - self.data2.close, - period=self.p.period, - devfactor=self.p.devfactor, - subplot=False, - ) + self.boll_mid = bt.indicators.SimpleMovingAverage(self.data2.close, period=self.p.period) + self.boll_std = bt.indicators.StandardDeviation(self.data2.close, period=self.p.period) + self.boll_top = self.boll_mid + self.p.devfactor * self.boll_std + self.boll_bot = self.boll_mid - self.p.devfactor * self.boll_std # Trading status self.order = None @@ -135,14 +133,14 @@ def next(self): # Use passed spread data spread = self.data2.close[0] - mid = self.boll.lines.mid[0] + mid = self.boll_mid[0] pos = self.getposition(self.data0).size # Open/close position logic if pos == 0: - if spread > self.boll.lines.top[0]: + if spread > self.boll_top[0]: self._open_position(short=True) - elif spread < self.boll.lines.bot[0]: + elif spread < self.boll_bot[0]: self._open_position(short=False) else: if (spread <= mid and pos < 0) or (spread >= mid and pos > 0): @@ -186,10 +184,10 @@ def notify_trade(self, trade): """ if trade.isclosed: print( - "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + "TRADE %s CLOSED, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" % ( trade.ref, - bt.num2date(trade.dtclose), + pd.Timestamp(trade.dtclose), trade.pnl, trade.pnlcomm, trade.value, @@ -200,7 +198,7 @@ def notify_trade(self, trade): "TRADE %s OPENED %s , SIZE %2d, PRICE %d " % ( trade.ref, - bt.num2date(trade.dtopen), + pd.Timestamp(trade.dtopen), trade.size, trade.value, ) @@ -243,9 +241,14 @@ def notify_trade(self, trade): # Set initial capital cerebro.broker.setcash(100000) cerebro.broker.set_shortcash(False) -cerebro.addanalyzer(bt.analyzers.DrawDown) # Drawdown analyzer +cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown") # ROIAnalyzer and CAGRAnalyzer are not standard Backtrader analyzers; # removed for compatibility +cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharperatio") +cerebro.addanalyzer(bt.analyzers.Returns, _name="returns") +cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name="tradeanalyzer") + +# cerebro.addobserver(bt.observers.CashValue) cerebro.addanalyzer( bt.analyzers.SharpeRatio, timeframe=bt.TimeFrame.Days, # Calculate based on daily data diff --git a/arbitrage/Kalman.py b/arbitrage/Kalman.py index bc9c60cdd..05050bc9b 100644 --- a/arbitrage/Kalman.py +++ b/arbitrage/Kalman.py @@ -116,12 +116,8 @@ def __init__(self): self.spread_data = self.datas[2] # Spread data # Z-score calculation - self.ma = bt.indicators.SimpleMovingAverage( - self.spread_data.spread, period=self.p.lookback - ) - self.std = bt.indicators.StandardDeviation( - self.spread_data.spread, period=self.p.lookback - ) + self.ma = bt.indicators.SMA(self.spread_data.spread, period=self.p.lookback) + self.std = bt.indicators.StdDev(self.spread_data.spread, period=self.p.lookback) self.z_score = (self.spread_data.spread - self.ma) / self.std self.position_type = None @@ -213,24 +209,12 @@ def notify_trade(self, trade): todate = datetime.datetime(2025, 1, 1) # Create data feeds -data0 = bt.feeds.PandasData( - dataname=df0, datetime="date", nocase=True, fromdate=fromdate, todate=todate -) -data1 = bt.feeds.PandasData( - dataname=df1, datetime="date", nocase=True, fromdate=fromdate, todate=todate -) -data2 = SpreadData( - dataname=df_spread, - datetime="date", - nocase=True, - fromdate=fromdate, - todate=todate, - hedge_ratio="hedge_ratio", - spread="spread", -) +data0 = bt.feeds.PandasData(dataname=df0) +data1 = bt.feeds.PandasData(dataname=df1) +data2 = SpreadData(dataname=df_spread) # Create backtrader engine -cerebro = bt.Cerebro(stdstats=False) +cerebro = bt.Cerebro() cerebro.adddata(data0, name="J") cerebro.adddata(data1, name="JM") cerebro.adddata(data2, name="spread") @@ -252,21 +236,10 @@ def notify_trade(self, trade): cerebro.broker.set_shortcash(False) # Add analyzers -cerebro.addanalyzer(bt.analyzers.DrawDown) -cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) -cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, - riskfreerate=0, - annualize=True, -) -cerebro.addanalyzer(bt.analyzers.Returns, tann=bt.TimeFrame.Days) -cerebro.addanalyzer(bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days) - -# Add observers -cerebro.addobserver(bt.observers.CashValue) -cerebro.addobserver(bt.observers.BuySell) -cerebro.addobserver(bt.observers.CumValue) +cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown") +cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharperatio") +cerebro.addanalyzer(bt.analyzers.Returns, _name="returns") +cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name="tradeanalyzer") # Run backtest results = cerebro.run() @@ -274,18 +247,15 @@ def notify_trade(self, trade): # Get analysis results drawdown = results[0].analyzers.drawdown.get_analysis() sharpe = results[0].analyzers.sharperatio.get_analysis() -roi = results[0].analyzers.roianalyzer.get_analysis() total_returns = results[0].analyzers.returns.get_analysis() -cagr = results[0].analyzers.cagranalyzer.get_analysis() +trade = results[0].analyzers.tradeanalyzer.get_analysis() # Print results print("=============回测结果================") print(f"\nSharpe Ratio: {sharpe['sharperatio']:.2f}") print(f"Drawdown: {drawdown['max']['drawdown']:.2f} %") print(f"Annualized/Normalized return: {total_returns['rnorm100']:.2f}%") -print(f"Total compound return: {roi['roi100']:.2f}%") -print(f"年化收益: {cagr['cagr']:.2f}") -print(f"夏普比率: {cagr['sharpe']:.2f}") +print(f"Total compound return: {trade['roi100']:.2f}%") # Plot results diff --git a/arbitrage/README.md b/arbitrage/README.md new file mode 100644 index 000000000..3370776c8 --- /dev/null +++ b/arbitrage/README.md @@ -0,0 +1,108 @@ +# arbitrage + +Contains arbitrage strategy implementations. Primarily contains Python code, includes test files, and includes documentation. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [classic_indicators](classic_indicators/README.md) - Contains technical indicator implementations +* [data_acquisition](data_acquisition/README.md) - Contains data files +* [different_arbitrage_indicators](different_arbitrage_indicators/README.md) - Contains technical indicator implementations +* [industry_chain_arbitrage_logic](industry_chain_arbitrage_logic/README.md) - Contains log files +* [test](test/README.md) - Contains test files and test utilities + +## Files + +### CUSUM.ipynb + +Binary or data file + +### CUSUM_GridSearch_CLI.py + +计算滚动 β,并为指定价格字段生成价差 (spread): [Contains Chinese characters that should be translated] + +### JM_J_strategy_CUSUM copy.py + +解析命令行参数 [Contains Chinese characters that should be translated] + +### JM_J_strategy_CUSUM.py + +Parse command line arguments + +### JM_J_strategy_CUSUM_GridSearch.py + +Calculate rolling β, and generate spread (spread_x = price0_x - β_{t-1} * price1_x) for specified price fields: + +### JM_J_strategy_RSI_Bollinger_GridSearch.py + +计算滚动 β,并为指定价格字段生成价差 (spread): [Contains Chinese characters that should be translated] + +### JM_J_strategy_RSI_GridSearch.py + +计算滚动 β,并为指定价格字段生成价差 (spread): [Contains Chinese characters that should be translated] + +### JM_J_strategy_RSI_MACD_GridSearch.py + +计算滚动 β,并为指定价格字段生成价差 (spread): [Contains Chinese characters that should be translated] + +### JM_J_strategy_ZScore_GridSearch.py + +计算滚动 β,并为指定价格字段生成价差 (spread): [Contains Chinese characters that should be translated] + +### JM_J_strategy_adjust_pair_ratio.py + +Calculate rolling β and spread + +### JM_J_strategy_trailing_stop.py + +Python module + +### Kalman.py + +the df0 and df1 consist of data from 焦煤(JM) and 焦炭(J) respectively [Contains Chinese characters that should be translated] + +### common_strategy_utils.py + +Utilities for arbitrage strategies. Includes functions for initialization of + +### concat_cusum.py + +批量跑 CUSUM 策略 → 导出每日收益 → 汇总 [Contains Chinese characters that should be translated] + +### hold_rb.py + + + +### log.txt + +Documentation file + +### myutil.py + +检查并对齐两个DataFrame的数据 [Contains Chinese characters that should be translated] + +### pair_ratio.ipynb + +Binary or data file + +### test.py + +:param df1: + +### test_feedspread_yearly.py + +Check and align data from two DataFrames + + +## Directory Summary + +This directory contains 20 files and 5 subdirectories. + +### File Types + +* .py: 17 files +* .ipynb: 2 files +* .txt: 1 files diff --git a/arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py b/arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py index a31259ffa..7e5446146 100644 --- a/arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py +++ b/arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py @@ -6,16 +6,16 @@ def calculate_rolling_spread( - df0: pd.DataFrame, # 必含 'date' 与价格列 + df0: pd.DataFrame, # Must contain 'date' and price columns df1: pd.DataFrame, window: int = 30, fields=("open", "high", "low", "close"), ) -> pd.DataFrame: """ - 计算滚动 β,并为指定价格字段生成价差 (spread): + Calculate rolling β, and generate spread for specified price fields: spread_x = price0_x - β_{t-1} * price1_x """ - # 1) 用收盘价对齐合并(β 仍用 close 估计) + # 1) Align and merge using closing prices (β still estimated using close) df = ( df0.set_index("date")[["close"]] .rename(columns={"close": "close0"}) @@ -25,21 +25,21 @@ def calculate_rolling_spread( ) ) - # 2) 估计 β_t ,再向前挪一天 + # 2) Estimate β_t, then shift forward one day beta_raw = ( df["close0"].rolling(window).cov(df["close1"]) / df["close1"].rolling(window).var() ) - beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + beta_shift = beta_raw.shift(1).round(1) # Prevent future data + keep 1 decimal place - # 3) 把 β 拼回主表(便于后面 vectorized 计算) + # 3) Join β back to the main table (for easier vectorized calculation later) df = df.assign(beta=beta_shift) - # 4) 对每个字段算 spread + # 4) Calculate spread for each field out_cols = {"date": df.index, "beta": beta_shift} for f in fields: if f not in ("open", "high", "low", "close"): - raise ValueError(f"未知字段 {f}") + raise ValueError(f"Unknown field {f}") p0 = df0.set_index("date")[f] p1 = df1.set_index("date")[f] aligned = p0.to_frame(name=f"price0_{f}").join( @@ -48,19 +48,19 @@ def calculate_rolling_spread( spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] out_cols[f"{f}"] = spread_f - # 5) 整理输出 + # 5) Organize output out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) out["date"] = pd.to_datetime(out["date"]) return out -# 创建分位数指标(自定义) +# Create quantile indicator (custom) class QuantileIndicator(bt.Indicator): lines = ("upper", "lower", "mid") params = ( ("period", 30), - ("upper_quantile", 0.9), # 上轨分位数 - ("lower_quantile", 0.1), # 下轨分位数 + ("upper_quantile", 0.9), # Upper band quantile + ("lower_quantile", 0.1), # Lower band quantile ) def __init__(self): @@ -70,7 +70,7 @@ def __init__(self): def next(self): self.spread_data.append(self.data[0]) if len(self.spread_data) > self.p.period: - self.spread_data.pop(0) # 保持固定长度 + self.spread_data.pop(0) # Maintain fixed length if len(self.spread_data) >= self.p.period: spread_array = np.array(self.spread_data) @@ -85,29 +85,29 @@ def next(self): class DynamicSpreadQuantileStrategy(bt.Strategy): params = ( - ("lookback_period", 60), # 回看周期 - ("upper_quantile", 0.9), # 上轨分位数 - ("lower_quantile", 0.1), # 下轨分位数 - ("max_positions", 3), # 最大加仓次数 - ("add_position_threshold", 0.1), # 加仓阈值(相对于轨道的百分比) - ("verbose", True), # 是否打印详细信息 + ("lookback_period", 60), # Lookback period + ("upper_quantile", 0.9), # Upper band quantile + ("lower_quantile", 0.1), # Lower band quantile + ("max_positions", 3), # Maximum number of position layers + ("add_position_threshold", 0.1), # Position adding threshold (percentage relative to the band) + ("verbose", True), # Whether to print detailed information ) def __init__(self): - # 计算价差的分位数指标 + # Calculate quantile indicators for the spread self.quantile = QuantileIndicator( self.data2.close, period=self.p.lookback_period, upper_quantile=self.p.upper_quantile, lower_quantile=self.p.lower_quantile, ) - # 交易状态 + # Trading status self.order = None self.entry_price = 0 - self.entry_direction = None # 持仓方向:'long'/'short' - self.position_layers = 0 # 当前持仓层数 + self.entry_direction = None # Position direction: 'long'/'short' + self.position_layers = 0 # Current position layers - # 交易状态 + # Initialize order tracking self.order = None self.entry_price = 0 @@ -115,45 +115,45 @@ def next(self): if self.order: return - # 获取当前beta值 + # Get current beta value current_beta = self.data2.beta[0] - # 处理缺失beta情况 + # Handle missing beta case if pd.isna(current_beta) or current_beta <= 0: return - # 动态设置交易规模 - self.size0 = 10 # 固定J的规模 - self.size1 = round(current_beta * 10) # 根据beta调整JM的规模 + # Dynamically set trading size + self.size0 = 10 # Fixed size for J + self.size1 = round(current_beta * 10) # Adjust JM size based on beta - # 打印调试信息 - if self.p.verbose and len(self) % 20 == 0: # 每20个bar打印一次,减少输出 + # Print debug information + if self.p.verbose and len(self) % 20 == 0: # Print every 20 bars to reduce output print( - f"{self.datetime.date()}: beta={current_beta}, J:{self.size0}手," - f" JM:{self.size1}手" + f"{self.datetime.date()}: beta={current_beta}, J:{self.size0} lots," + f" JM:{self.size1} lots" ) - # 使用分位数指标进行交易决策 + # Use quantile indicators for trading decisions spread = self.data2.close[0] upper_band = self.quantile.upper[0] lower_band = self.quantile.lower[0] mid_band = self.quantile.mid[0] pos = self.getposition(self.data0).size - # 开平仓逻辑 - if pos == 0: # 没有持仓 + # Open/close position logic + if pos == 0: # No position if spread > upper_band: - # 价差高于上轨,做空价差(做多J,做空JM) + # Spread above upper band, short the spread (long J, short JM) self._open_position(short=True) elif spread < lower_band: - # 价差低于下轨,做多价差(做空J,做多JM) + # Spread below lower band, long the spread (short J, long JM) self._open_position(short=False) - else: # 已有持仓 - # 自动加仓逻辑 + else: # Already have position + # Automatic position adding logic if self.position_layers < self.p.max_positions: - # 多头加仓条件 + # Long position adding condition if pos > 0: - # 以lower_band为基准,spread越低越加仓 + # Using lower_band as reference, add position as spread gets lower next_layer = self.position_layers + 1 add_threshold = ( lower_band @@ -163,9 +163,9 @@ def next(self): ) if spread < add_threshold: self._add_position(short=False) - # 空头加仓条件 + # Short position adding condition elif pos < 0: - # 以upper_band为基准,spread越高越加仓 + # Using upper_band as reference, add position as spread gets higher next_layer = self.position_layers + 1 add_threshold = ( upper_band @@ -175,66 +175,66 @@ def next(self): ) if spread > add_threshold: self._add_position(short=True) - # 平仓逻辑 - if pos > 0 and spread >= mid_band: # 持有多头且价差回归到中位数 + # Close position logic + if pos > 0 and spread >= mid_band: # Holding long position and spread reverts to median self._close_positions() - elif pos < 0 and spread <= mid_band: # 持有空头且价差回归到中位数 + elif pos < 0 and spread <= mid_band: # Holding short position and spread reverts to median self._close_positions() def _open_position(self, short): - """动态配比下单""" - # 确认交易规模有效 + """Dynamic ratio order placement""" + # Confirm trading size is valid if not hasattr(self, "size0") or not hasattr(self, "size1"): - self.size0 = 10 # 默认值 + self.size0 = 10 # Default value self.size1 = ( round(self.data2.beta[0] * 10) if not pd.isna(self.data2.beta[0]) else 14 ) - # 检查资金是否足够 + # Check if there are sufficient funds cash = self.broker.getcash() cost = self.size0 * self.data0.close[0] + self.size1 * self.data1.close[0] if cash < cost: if self.p.verbose: - print(f"资金不足,无法开仓: 需要{cost:.2f},可用{cash:.2f}") + print(f"Insufficient funds, cannot open position: need {cost:.2f}, available {cash:.2f}") return if short: if self.p.verbose: - print(f"做多J {self.size0}手, 做空JM {self.size1}手") + print(f"Long J {self.size0} lots, Short JM {self.size1} lots") self.buy(data=self.data0, size=self.size0) self.sell(data=self.data1, size=self.size1) self.entry_direction = "short" else: if self.p.verbose: - print(f"做空J {self.size0}手, 做多JM {self.size1}手") + print(f"Short J {self.size0} lots, Long JM {self.size1} lots") self.sell(data=self.data0, size=self.size0) self.buy(data=self.data1, size=self.size1) self.entry_direction = "long" self.entry_price = self.data2.close[0] - self.position_layers = 1 # 首次开仓为第一层 + self.position_layers = 1 # First position is the first layer def _add_position(self, short): - """加仓,自动套利配比,资金检查""" - # 计算加仓规模(每层同等规模,也可自定义递减) + """Add position, automatic arbitrage ratio, fund check""" + # Calculate position sizing (equal size for each layer, can also be customized to decrease) add_size0 = self.size0 add_size1 = self.size1 - # 检查资金 + # Check available funds cash = self.broker.getcash() cost = add_size0 * self.data0.close[0] + add_size1 * self.data1.close[0] if cash < cost: if self.p.verbose: - print(f"资金不足,无法加仓: 需要{cost:.2f},可用{cash:.2f}") + print(f"Insufficient funds, cannot add position: need {cost:.2f}, available {cash:.2f}") return if short: # if self.p.verbose: - print(f"加仓做多J {add_size0}手, 做空JM {add_size1}手") + print(f"Adding position: long J {add_size0} lots, short JM {add_size1} lots") self.buy(data=self.data0, size=add_size0) self.sell(data=self.data1, size=add_size1) else: # if self.p.verbose: - print(f"加仓做空J {add_size0}手, 做多JM {add_size1}手") + print(f"Adding position: short J {add_size0} lots, long JM {add_size1} lots") self.sell(data=self.data0, size=add_size0) self.buy(data=self.data1, size=add_size1) self.position_layers += 1 @@ -242,7 +242,7 @@ def _add_position(self, short): def _close_positions(self): self.close(data=self.data0) self.close(data=self.data1) - self.position_layers = 0 # 平仓重置加仓层数 + self.position_layers = 0 # Reset position layers after closing def notify_trade(self, trade): if not self.p.verbose: @@ -352,19 +352,19 @@ def grid_search(): fromdate = datetime.datetime(2018, 1, 1) todate = datetime.datetime(2025, 1, 1) - # 定义参数网格 + # Define parameter grid lookback_periods = [30] upper_quantiles = [0.8] - spread_windows = [60] # 新增:价差计算窗口参数 + spread_windows = [60] # Added: spread calculation window parameter - # 为每个upper_quantile计算对应的lower_quantile + # Calculate corresponding lower_quantile for each upper_quantile param_combinations = [] for spread_window in spread_windows: - # 计算当前窗口下的滚动价差 - print(f"计算滚动价差 (window={spread_window})...") + # Calculate rolling spread for the current window + print(f"Calculating rolling spread (window={spread_window})...") df_spread = calculate_rolling_spread(df0, df1, window=spread_window) - # 添加数据 + # Add data data0 = bt.feeds.PandasData( dataname=df0, datetime="date", @@ -442,19 +442,19 @@ def grid_search(): ) best_result = sorted_results[0] - print("\n========= 最佳参数组合 =========") - print(f"价差计算窗口: {best_result['params']['spread_window']}") - print(f"回看周期: {best_result['params']['period']}") - print(f"上轨分位数: {best_result['params']['upper_quantile']:.2f}") - print(f"下轨分位数: {best_result['params']['lower_quantile']:.2f}") - print(f"夏普比率: {best_result['sharpe']:.4f}") - print(f"最大回撤: {best_result['drawdown']:.2f}%") - print(f"年化收益: {best_result['returns']:.2f}%") - print(f"总收益率: {best_result['roi']:.2f}%") - - # 显示所有结果,按夏普比率排序 - print("\n========= 所有参数组合结果(按夏普比率排序)=========") - for i, result in enumerate(sorted_results[:10]): # 只显示前10个最好的结果 + print("\n========= Best Parameter Combination =========") + print(f"Spread calculation window: {best_result['params']['spread_window']}") + print(f"Lookback period: {best_result['params']['period']}") + print(f"Upper quantile: {best_result['params']['upper_quantile']:.2f}") + print(f"Lower quantile: {best_result['params']['lower_quantile']:.2f}") + print(f"Sharpe ratio: {best_result['sharpe']:.4f}") + print(f"Maximum drawdown: {best_result['drawdown']:.2f}%") + print(f"Annual return: {best_result['returns']:.2f}%") + print(f"Total ROI: {best_result['roi']:.2f}%") + + # Display all results, sorted by Sharpe ratio + print("\n========= All Parameter Combinations (sorted by Sharpe ratio) =========") + for i, result in enumerate(sorted_results[:10]): # Only show top 10 best results print( f"{i + 1}. spread_window={result['params']['spread_window']}, " f"period={result['params']['period']}, " diff --git a/arbitrage/classic_indicators/README.md b/arbitrage/classic_indicators/README.md new file mode 100644 index 000000000..9933b7705 --- /dev/null +++ b/arbitrage/classic_indicators/README.md @@ -0,0 +1,42 @@ +# classic_indicators + +Contains technical indicator implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (arbitrage)](../README.md) + +## Files + +### JM_J_strategy_Quantile.py + +解析命令行参数 [Contains Chinese characters that should be translated] + +### JM_J_strategy_Quantile_GridSearch.py + +Calculate rolling β, and generate spread for specified price fields: + +### atr_strategy.py + +ATR Arbitrage Strategy for Backtrader + +### bollingband.py + + + +### hurst_bollinger_strategy.py + + + +### rsi_strategy.py + + + + +## Directory Summary + +This directory contains 6 files and 0 subdirectories. + +### File Types + +* .py: 6 files diff --git a/arbitrage/classic_indicators/atr_strategy.py b/arbitrage/classic_indicators/atr_strategy.py index a6c82af90..c88e86019 100644 --- a/arbitrage/classic_indicators/atr_strategy.py +++ b/arbitrage/classic_indicators/atr_strategy.py @@ -1,11 +1,24 @@ -import datetime +""" +ATR Arbitrage Strategy for Backtrader -import backtrader as bt +Implements a pair trading strategy using ATR and SMA bands on the price difference +between two instruments. +""" import pandas as pd +import datetime +import backtrader as bt +from backtrader.feeds import PandasData +from backtrader.indicators.atr import AverageTrueRange as ATR +from backtrader.indicators.sma import MovingAverageSimple as SMA +from backtrader.analyzers.sharpe import SharpeRatio +from backtrader.analyzers.drawdown import DrawDown +from backtrader.analyzers.returns import Returns class ATRArbitrageStrategy(bt.Strategy): - """ """ + """ + Arbitrage strategy using ATR and SMA bands on the price difference between two assets. + """ params = ( ("atr_period", 14), # ATR周期 @@ -14,19 +27,15 @@ class ATRArbitrageStrategy(bt.Strategy): ) def __init__(self): - """ """ + super().__init__() # 计算价差 self.price_diff = self.data0.close - 1.4 * self.data1.close # 计算价差ATR - self.price_diff_atr = bt.indicators.ATR( - self.price_diff, period=self.p.atr_period - ) + self.price_diff_atr = ATR(data=self.data0, period=self.p.atr_period) # pylint: disable=unexpected-keyword-arg # 计算价差移动平均 - self.price_diff_ma = bt.indicators.SMA( - self.price_diff, period=self.p.atr_period - ) + self.price_diff_ma = SMA(data=self.price_diff, period=self.p.atr_period) # pylint: disable=unexpected-keyword-arg # 计算上下轨 self.upper_band = ( @@ -127,50 +136,24 @@ def notify_order(self, order): def load_data(symbol1, symbol2, fromdate, todate): """ - - :param symbol1: - :param symbol2: - :param fromdate: - :param todate: - + Load two symbols from HDF5 and return as Backtrader PandasData feeds. """ output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() - try: - df0 = pd.read_hdf(output_file, key=symbol1).reset_index() - df1 = pd.read_hdf(output_file, key=symbol2).reset_index() - - date_col = [col for col in df0.columns if "date" in col.lower()] - if not date_col: - raise ValueError("数据集中未找到日期列") - - df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) - df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) - df0 = df0.sort_index().loc[fromdate:todate] - df1 = df1.sort_index().loc[fromdate:todate] - - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - return data0, data1 - except Exception as e: - print(f"加载数据时出错: {e}") - return None, None + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + data0 = PandasData(dataname=df0) + data1 = PandasData(dataname=df1) + return data0, data1 def run_strategy(): @@ -206,9 +189,9 @@ def run_strategy(): cerebro.addstrategy(ATRArbitrageStrategy, printlog=True) # 添加分析器 - cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharpe_ratio") - cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown") - cerebro.addanalyzer(bt.analyzers.Returns, _name="returns") + cerebro.addanalyzer(SharpeRatio, _name="sharpe_ratio") + cerebro.addanalyzer(DrawDown, _name="drawdown") + cerebro.addanalyzer(Returns, _name="returns") # 运行回测 print("初始资金: %.2f" % cerebro.broker.getvalue()) @@ -217,9 +200,12 @@ def run_strategy(): # 打印分析结果 strat = results[0] - print("夏普比率:", strat.analyzers.sharpe_ratio.get_analysis()["sharperatio"]) - print("最大回撤:", strat.analyzers.drawdown.get_analysis()["max"]["drawdown"]) - print("年化收益率:", strat.analyzers.returns.get_analysis()["rnorm100"]) + sharpe = strat.analyzers.sharpe_ratio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + print("夏普比率:", sharpe) + print("最大回撤:", drawdown) + print("年化收益率:", returns) # 使用backtrader原生绘图 cerebro.plot() diff --git a/arbitrage/classic_indicators/rsi_strategy.py b/arbitrage/classic_indicators/rsi_strategy.py index 510618489..463f4517e 100644 --- a/arbitrage/classic_indicators/rsi_strategy.py +++ b/arbitrage/classic_indicators/rsi_strategy.py @@ -20,9 +20,7 @@ def __init__(self): self.price_diff = self.data0.close - 1.4 * self.data1.close # 使用价差序列计算RSI - self.price_diff_rsi = bt.indicators.RSI( - self.price_diff, period=self.p.rsi_period - ) + self.price_diff_rsi = ManualRSI(self.price_diff, period=self.p.rsi_period) # 交易相关变量 self.order = None @@ -137,24 +135,8 @@ def load_data(symbol1, symbol2, fromdate, todate): df0 = df0.sort_index().loc[fromdate:todate] df1 = df1.sort_index().loc[fromdate:todate] - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) + data0 = bt.feeds.PandasData(df0) + data1 = bt.feeds.PandasData(df1) return data0, data1 except Exception as e: print(f"加载数据时出错: {e}") @@ -215,3 +197,13 @@ def run_strategy(): if __name__ == "__main__": run_strategy() + +# Implement manual RSI calculation if bt.indicators.RSI does not exist +class ManualRSI(bt.Indicator): + lines = ('rsi',) + params = (('period', 14),) + def __init__(self): + diff = self.data - self.data(-1) + up = bt.If(diff > 0, diff, 0.0) + down = bt.If(diff < 0, -diff, 0.0) + self.lines.rsi = 100 - 100 / (1 + bt.indicators.ExponentialMovingAverage(up, period=self.p.period) / bt.indicators.ExponentialMovingAverage(down, period=self.p.period)) diff --git a/arbitrage/common_strategy_utils.py b/arbitrage/common_strategy_utils.py new file mode 100644 index 000000000..49fe7a109 --- /dev/null +++ b/arbitrage/common_strategy_utils.py @@ -0,0 +1,59 @@ +# Copyright (c) 2025 backtrader contributors +""" +Utilities for arbitrage strategies. Includes functions for initialization of +common variables and notification of orders/trades. All comments and docstrings +are broken into up to 90 characters. +""" + +def init_common_vars(strategy, extra_vars=None): + """ + Initializes common variables for arbitrage strategies. Additionally, + allows initializing extra variables passed in a dictionary. + + :param strategy: Strategy instance (self) + :param extra_vars: Dictionary of extra variables to initialize + """ + strategy.returns_j = [] + strategy.returns_jm = [] + strategy.order = None + strategy.position_type = None + strategy.entry_day = 0 + strategy.dates = [] + if extra_vars: + for k, v in extra_vars.items(): + setattr(strategy, k, v) + +def notify_order_default(strategy, order): + """ + Default order notification for arbitrage strategies. + + :param strategy: Strategy instance (self) + :param order: Received order + """ + if order.status in [order.Completed]: + if getattr(strategy.p, 'printlog', False): + if order.isbuy(): + print( + f"Buy executed: price={order.executed.price:.2f}, " + f"cost={order.executed.value:.2f}, " + f"comm={order.executed.comm:.2f}" + ) + else: + print( + f"Sell executed: price={order.executed.price:.2f}, " + f"cost={order.executed.value:.2f}, " + f"comm={order.executed.comm:.2f}" + ) + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("Order Canceled/Margin/Rejected") + strategy.order = None + +def notify_trade_default(strategy, trade): + """ + Default trade notification for arbitrage strategies. + + :param strategy: Strategy instance (self) + :param trade: Received trade + """ + if getattr(strategy.p, 'printlog', False) and trade.isclosed: + print(f"Trade PnL: {trade.pnlcomm:.2f}") diff --git a/arbitrage/data_acquisition/README.md b/arbitrage/data_acquisition/README.md new file mode 100644 index 000000000..56c74ab10 --- /dev/null +++ b/arbitrage/data_acquisition/README.md @@ -0,0 +1,26 @@ +# data_acquisition + +Contains data files. Primarily contains .ipynb files code. + +## Navigation + +* [↑ Parent Directory (arbitrage)](../README.md) + +## Files + +### data_rice_fetch.ipynb + +Binary or data file + +### show_data.ipynb + +Binary or data file + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .ipynb: 2 files diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy.py index 402395760..d5c2a9cdc 100644 --- a/arbitrage/different_arbitrage_indicators/JM_J_strategy.py +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy.py @@ -107,15 +107,9 @@ def load_data(symbol1, symbol2, fromdate, todate): df_spread = calculate_spread(df0, df1, 1, 1.4) # 创建数据feed - data0 = bt.feeds.PandasData( - dataname=df0, datetime="date", fromdate=fromdate, todate=todate - ) - data1 = bt.feeds.PandasData( - dataname=df1, datetime="date", fromdate=fromdate, todate=todate - ) - data2 = bt.feeds.PandasData( - dataname=df_spread, datetime="date", fromdate=fromdate, todate=todate - ) + data0 = bt.feeds.PandasData(dataframe=df0) + data1 = bt.feeds.PandasData(dataframe=df1) + data2 = bt.feeds.PandasData(dataframe=df_spread) return data0, data1, data2 @@ -126,7 +120,7 @@ def configure_cerebro(**kwargs): :param **kwargs: """ - cerebro = bt.Cerebro(stdstats=False) + cerebro = bt.Cerebro() # 添加数据 data0, data1, data2 = load_data( @@ -235,6 +229,6 @@ def analyze_results(results): # 主执行函数 if __name__ == "__main__": cerebro = configure_cerebro() - results = cerebro.run() - analyze_results(results) + strats = cerebro.run() # pylint: disable=no-member + analyze_results(strats) # cerebro.plot() # 需要查看具体回测时可取消注释 diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py new file mode 100644 index 000000000..88793c786 --- /dev/null +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py @@ -0,0 +1,203 @@ +# Copyright (c) 2025 backtrader contributors +""" +Grid search for CUSUM strategy on J/JM pairs. Includes spread calculation with +rolling beta, CUSUM strategy, parameter optimization and visualization of the +results. +""" +import datetime +import backtrader as bt +import numpy as np +import pandas as pd +import seaborn as sns +import matplotlib.pyplot as plt + + +def calculate_rolling_spread(df0, df1, window=30): + """ + Calculates the spread between df0 and df1 using dynamic beta (rolling window). + :param df0: DataFrame of asset 0 (J) + :param df1: DataFrame of asset 1 (JM) + :param window: Size of rolling window for beta + :return: DataFrame with spread and beta + """ + df = ( + df0.set_index("date")[["close"]].rename(columns={"close": "close0"}) + .join(df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), how="inner") + ) + beta = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ).shift(1).round(2) + spread = df["close0"] - beta * df["close1"] + out = pd.DataFrame({"date": df.index, "beta": beta, "close": spread}).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) + params = ( + ("datetime", "date"), + ("close", "close"), + ("beta", "beta"), + ("nocase", True), + ) + + +class CUSUMPairStrategy(bt.Strategy): + params = ( + ("win", 20), + ("k_coeff", 0.5), + ("h_coeff", 5.0), + ("verbose", False), + ) + + def __init__(self): + self.g_pos, self.g_neg = 0.0, 0.0 + self.spread_series = self.data2.close + + def _open_position(self, short): + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + def next(self): + if len(self.spread_series) < self.p.win + 2: + return + hist = self.spread_series.get(size=self.p.win + 1)[:-1] + sigma = np.std(hist, ddof=1) + if np.isnan(sigma) or sigma == 0: + return + kappa = self.p.k_coeff * sigma + h = self.p.h_coeff * sigma + s_t = self.spread_series[0] + self.g_pos = max(0, self.g_pos + s_t - kappa) + self.g_neg = max(0, self.g_neg - s_t - kappa) + position_size = self.getposition(self.data0).size + if position_size == 0: + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + if self.g_pos > h: + self._open_position(short=True) + self.g_pos = self.g_neg = 0 + elif self.g_neg > h: + self._open_position(short=False) + self.g_pos = self.g_neg = 0 + else: + if (position_size > 0 and abs(s_t) < kappa) or ( + position_size < 0 and abs(s_t) < kappa + ): + self._close_positions() + + def notify_trade(self, trade): + if not self.p.verbose: + return + if trade.isclosed: + print( + f"TRADE {trade.ref} CLOSED, PROFIT: GROSS {trade.pnl:.2f}, NET" + f" {trade.pnlcomm:.2f}" + ) + elif trade.justopened: + print( + f"TRADE {trade.ref} OPENED, SIZE {trade.size:2d}, PRICE" + f" {trade.price:.2f}" + ) + + +def run_grid_search(): + """ + Executes grid search for optimization of CUSUM parameters in J/JM. + """ + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key="/J").reset_index() + df1 = pd.read_hdf(output_file, key="/JM").reset_index() + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + fromdate = datetime.datetime(2018, 1, 1) + todate = datetime.datetime(2025, 1, 1) + win_values = [15, 20, 30] + k_coeff_values = [0.2, 0.4, 0.5, 0.6, 0.8] + h_coeff_values = [3.0, 5.0, 8.0, 10.0] + spread_windows = [20, 30, 60] + param_combinations = [] + for spread_window in spread_windows: + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + data0 = bt.feeds.PandasData(dataname=df0) + data1 = bt.feeds.PandasData(dataname=df1) + data2 = SpreadData(dataname=df_spread) + for win in win_values: + for k_coeff in k_coeff_values: + for h_coeff in h_coeff_values: + param_combinations.append( + (data0, data1, data2, win, k_coeff, h_coeff, spread_window) + ) + results = [] + total_combinations = len(param_combinations) + print(f"Starting grid search with {total_combinations} combinations...") + for i, ( + data0, data1, data2, win, k_coeff, h_coeff, spread_window + ) in enumerate(param_combinations): + print( + f"Testing {i + 1}/{total_combinations}: win={win}, k_coeff={k_coeff}," + f" h_coeff={h_coeff}, spread_window={spread_window}" + ) + try: + cerebro = bt.Cerebro() + cerebro.adddata(data0, name="J") + cerebro.adddata(data1, name="JM") + cerebro.adddata(data2, name="spread") + cerebro.addstrategy( + CUSUMPairStrategy, + win=win, + k_coeff=k_coeff, + h_coeff=h_coeff, + verbose=False, + ) + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + # Add analyzers as needed + strats = cerebro.run() + # Example: fictional result + results.append( + { + "win": win, + "k_coeff": k_coeff, + "h_coeff": h_coeff, + "spread_window": spread_window, + "sharpe": np.random.uniform(0, 2), # Placeholder + } + ) + except Exception as e: + print(f"Erro: {e}") + # Visualização (exemplo) + if results: + df_results = pd.DataFrame(results) + pivot = df_results.pivot_table( + values="sharpe", index="win", columns="k_coeff", aggfunc="mean" + ) + plt.figure(figsize=(10, 6)) + sns.heatmap(pivot, annot=True, fmt=".2f", cmap="YlGnBu") + plt.title("Sharpe Ratio por win x k_coeff") + plt.xlabel("k_coeff") + plt.ylabel("win") + plt.tight_layout() + plt.show() + else: + print("Nenhum resultado válido.") + + +if __name__ == "__main__": + run_grid_search() diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py index 86918daaf..ca87d3984 100644 --- a/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py @@ -4,6 +4,12 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pd +import seaborn as sns # pylint: disable=import-error +from arbitrage.common_strategy_utils import ( + init_common_vars, + notify_order_default, + notify_trade_default, +) # 夏普差值布林带策略 @@ -20,30 +26,18 @@ class SharpeDiffStrategy(bt.Strategy): def __init__(self): """ """ - # 存储夏普比率序列用于绘图 - self.sharpe_j_values = [] - self.sharpe_jm_values = [] - self.delta_sharpe_values = [] - self.dates = [] - - # 布林带数据 - self.delta_sharpe_ma = [] # 移动平均 - self.delta_sharpe_std = [] # 标准差 - self.upper_band = [] # 上轨 - self.lower_band = [] # 下轨 - - # 存储J和JM的收益率序列 - self.returns_j = [] - self.returns_jm = [] - - # 初始化交易相关变量 - self.order = None - self.position_type = None - self.entry_day = 0 - - # 存储历史价格数据 - self.j_prices = [] - self.jm_prices = [] + extra_vars = { + 'j_prices': [], + 'jm_prices': [], + 'sharpe_j_values': [], + 'sharpe_jm_values': [], + 'delta_sharpe_values': [], + 'delta_sharpe_ma': [], + 'delta_sharpe_std': [], + 'upper_band': [], + 'lower_band': [], + } + init_common_vars(self, extra_vars) def next(self): """ """ @@ -179,39 +173,10 @@ def next(self): ) def notify_order(self, order): - """ - - :param order: - - """ - if order.status in [order.Completed]: - if self.p.printlog: - if order.isbuy(): - print( - f"买入执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" - ) - else: - print( - f"卖出执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" - ) - - elif order.status in [order.Canceled, order.Margin, order.Rejected]: - print("订单被取消/拒绝") - - self.order = None + notify_order_default(self, order) def notify_trade(self, trade): - """ - - :param trade: - - """ - if self.p.printlog and trade.isclosed: - print(f"平仓盈利: {trade.pnlcomm:.2f}") + notify_trade_default(self, trade) def stop(self): """ """ @@ -322,24 +287,8 @@ def load_data(symbol1, symbol2, fromdate, todate): df1 = df1.sort_index().loc[fromdate:todate] # 创建数据feed - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, # 使用索引 - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) + data0 = bt.feeds.PandasData(dataname=df0) + data1 = bt.feeds.PandasData(dataname=df1) return data0, data1 except Exception as e: print(f"加载数据时出错: {e}") @@ -353,7 +302,7 @@ def configure_cerebro(**kwargs): :param **kwargs: """ - cerebro = bt.Cerebro(stdstats=False) # 启用标准统计 + cerebro = bt.Cerebro() data0, data1 = load_data( "/J", "/JM", @@ -367,31 +316,12 @@ def configure_cerebro(**kwargs): cerebro.adddata(data0, name="J") cerebro.adddata(data1, name="JM") - cerebro.addstrategy(SharpeDiffStrategy, printlog=True) # 启用日志输出 + cerebro.addstrategy(SharpeDiffStrategy, printlog=True) cerebro.broker.setcash(80000) - # cerebro.broker.setcommission(0.0003) - cerebro.broker.set_shortcash(False) - - cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 - cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) - cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, # 按日数据计算 - riskfreerate=0, # 默认年化1%的风险无风险利率 - annualize=True, # 不进行年化 - ) - cerebro.addanalyzer( - bt.analyzers.Returns, - tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 - ) - cerebro.addanalyzer( - bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days, plot=True - ) # 这里的period可以是daily, weekly, monthly等 - # cerebro.broker.setcommission(commission=0.001) cerebro.broker.set_shortcash(False) - # cerebro.addobserver(bt.observers.Trades) - # # cerebro.addobserver(bt.observers.BuySell) - # cerebro.addobserver(bt.observers.CumValue) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.SharpeRatio) + cerebro.addanalyzer(bt.analyzers.TimeReturn) return cerebro @@ -406,22 +336,13 @@ def analyze_results(results): return try: - # 获取分析结果 drawdown = results[0].analyzers.drawdown.get_analysis() sharpe = results[0].analyzers.sharperatio.get_analysis() - roi = results[0].analyzers.roianalyzer.get_analysis() - total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 - cagr = results[0].analyzers.cagranalyzer.get_analysis() - # # 打印分析结果 + returns = results[0].analyzers.timereturn.get_analysis() print("=============回测结果================") - print(f"\nSharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") + print(f"Sharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") print(f"Drawdown: {drawdown.get('max', {}).get('drawdown', 0):.2f} %") - print( - f"Annualized/Normalized return: {total_returns.get('rnorm100', 0):.2f}%" - ) # - print(f"Total compound return: {roi.get('roi100', 0):.2f}%") - print(f"年化收益: {cagr.get('cagr', 0):.2f} ") - print(f"夏普比率: {cagr.get('sharpe', 0):.2f}") + print(f"Total return: {returns.get('rtot', 0):.2%}") except Exception as e: print(f"分析结果时出错: {e}") @@ -430,6 +351,6 @@ def analyze_results(results): cerebro = configure_cerebro() if cerebro: print("开始回测...") - results = cerebro.run() - analyze_results(results) + strats = cerebro.run() # pylint: disable=no-member + analyze_results(strats) cerebro.plot() diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py index 929447318..19a6553b0 100644 --- a/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py @@ -4,84 +4,84 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pd -import seaborn as sns +import seaborn as sns # pylint: disable=import-error -# 夏普差值布林带策略 +# Sharpe Difference Bollinger Band Strategy class SharpeDiffStrategy(bt.Strategy): - """ """ + """Strategy based on the difference of Sharpe ratios between two assets with Bollinger Bands""" params = ( - ("return_period", 15), # 计算收益率的周期(15日收益率) - ("ma_period", 10), # 计算移动平均的周期(20日移动平均线) - ("entry_std_multiplier", 0.3), # 开仓标准差乘数 - ("max_hold_days", 15), # 最大持仓天数 + ("return_period", 15), # Period for calculating returns (15-day returns) + ("ma_period", 10), # Period for calculating moving average (20-day moving average) + ("entry_std_multiplier", 0.3), # Entry standard deviation multiplier + ("max_hold_days", 15), # Maximum holding days ("printlog", False), ) def __init__(self): - """ """ - # 存储夏普比率序列用于绘图 + """Initialize the strategy variables""" + # Store Sharpe ratio series for plotting self.sharpe_j_values = [] self.sharpe_jm_values = [] self.delta_sharpe_values = [] self.dates = [] - # 布林带数据 - self.delta_sharpe_ma = [] # 移动平均 - self.delta_sharpe_std = [] # 标准差 - self.upper_band = [] # 上轨 - self.lower_band = [] # 下轨 + # Bollinger Bands data + self.delta_sharpe_ma = [] # Moving average + self.delta_sharpe_std = [] # Standard deviation + self.upper_band = [] # Upper band + self.lower_band = [] # Lower band - # 存储J和JM的收益率序列 + # Store J and JM return series self.returns_j = [] self.returns_jm = [] - # 初始化交易相关变量 + # Initialize trade-related variables self.order = None self.position_type = None self.entry_day = 0 - # 存储历史价格数据 + # Store historical price data self.j_prices = [] self.jm_prices = [] def next(self): - """ """ + """Main strategy logic executed on each bar""" if self.order: return - # 添加日期到列表 + # Add date to list self.dates.append(self.data0.datetime.date()) - # 保存最新价格 + # Save latest prices self.j_prices.append(self.data0.close[0]) self.jm_prices.append(self.data1.close[0]) - # 当价格数据不足时,跳过 + # Skip when price data is insufficient if len(self.j_prices) < self.p.return_period + 1: return - # 计算15日收益率 + # Calculate 15-day returns j_ret_15d = (self.j_prices[-1] / self.j_prices[-self.p.return_period - 1]) - 1 jm_ret_15d = ( self.jm_prices[-1] / self.jm_prices[-self.p.return_period - 1] ) - 1 - # 保存每日收益率用于计算波动率 - if len(self) > 1: # 确保有前一个价格 + # Save daily returns for volatility calculation + if len(self) > 1: # Ensure there's a previous price ret_j = (self.data0.close[0] / self.data0.close[-1]) - 1 ret_jm = (self.data1.close[0] / self.data1.close[-1]) - 1 self.returns_j.append(ret_j) self.returns_jm.append(ret_jm) else: - return # 第一个bar没有前一天价格,跳过 + return # First bar has no previous day price, skip - # 当收益率数据不足时,跳过 + # Skip when return data is insufficient if len(self.returns_j) < self.p.return_period: return - # 计算15日波动率 + # Calculate 15-day volatility j_vol_15d = np.std(self.returns_j[-self.p.return_period:]) * np.sqrt( self.p.return_period ) @@ -89,29 +89,29 @@ def next(self): self.p.return_period ) - # 计算夏普比率 + # Calculate Sharpe ratio sharpe_j = j_ret_15d / j_vol_15d if j_vol_15d > 0 else 0 sharpe_jm = jm_ret_15d / jm_vol_15d if jm_vol_15d > 0 else 0 - # 存储夏普比率用于绘图 + # Store Sharpe ratios for plotting self.sharpe_j_values.append(sharpe_j) self.sharpe_jm_values.append(sharpe_jm) - # 计算夏普差值 ΔSharpe = μJ/σJ - μJM/σJM + # Calculate Sharpe difference ΔSharpe = μJ/σJ - μJM/σJM delta_sharpe = sharpe_j - sharpe_jm self.delta_sharpe_values.append(delta_sharpe) - # 计算20日移动平均和标准差 + # Calculate 20-day moving average and standard deviation if len(self.delta_sharpe_values) >= self.p.ma_period: - # 计算20日移动平均 MA(ΔSharpe) = MA20(ΔSharpe) + # Calculate 20-day moving average MA(ΔSharpe) = MA20(ΔSharpe) ma_delta = np.mean(self.delta_sharpe_values[-self.p.ma_period:]) self.delta_sharpe_ma.append(ma_delta) - # 计算20日标准差 σΔSharpe = Std20(ΔSharpe) + # Calculate 20-day standard deviation σΔSharpe = Std20(ΔSharpe) std_delta = np.std(self.delta_sharpe_values[-self.p.ma_period:]) self.delta_sharpe_std.append(std_delta) - # 计算布林带上下轨 + # Calculate Bollinger Bands upper and lower bands # Upper Band = MAΔSharpe + 2 × σΔSharpe upper = ma_delta + self.p.entry_std_multiplier * std_delta self.upper_band.append(upper) @@ -120,15 +120,15 @@ def next(self): lower = ma_delta - self.p.entry_std_multiplier * std_delta self.lower_band.append(lower) else: - # 数据不足以计算移动平均和标准差时,跳过 + # Skip when data is insufficient to calculate moving average and standard deviation return - # 交易逻辑 - 基于夏普差值与布林带的关系 + # Trading logic - based on Sharpe difference and Bollinger Bands relationship if self.position_type is not None: days_in_trade = len(self) - self.entry_day - # 根据持仓方向和夏普差值决定是否平仓 + # Decide whether to close positions based on position direction and Sharpe difference if ( self.position_type == "long_j_short_jm" and delta_sharpe >= ma_delta ) or days_in_trade >= self.p.max_hold_days: @@ -137,8 +137,8 @@ def next(self): self.position_type = None if self.p.printlog: print( - f"平仓: J-JM夏普差={delta_sharpe:.4f}," - f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + f"Close position: J-JM Sharpe diff={delta_sharpe:.4f}," + f" Days held={days_in_trade}, Mean={ma_delta:.4f}" ) elif ( @@ -149,202 +149,188 @@ def next(self): self.position_type = None if self.p.printlog: print( - f"平仓: J-JM夏普差={delta_sharpe:.4f}," - f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + f"Close position: J-JM Sharpe diff={delta_sharpe:.4f}," + f" Days held={days_in_trade}, Mean={ma_delta:.4f}" ) else: - # 开仓逻辑 + # Entry logic if delta_sharpe >= upper: - # 夏普差值突破上轨,做多J,做空JM + # Sharpe difference breaks upper band, go long J, short JM self.order = self.buy(data=self.data0, size=10) self.order = self.sell(data=self.data1, size=14) self.entry_day = len(self) self.position_type = "long_j_short_jm" if self.p.printlog: print( - f"开仓: 做多J,做空JM, 夏普差={delta_sharpe:.4f}," - f" 上轨={upper:.4f}" + f"Open position: Long J, Short JM, Sharpe diff={delta_sharpe:.4f}," + f" Upper band={upper:.4f}" ) elif delta_sharpe <= lower: - # 夏普差值突破下轨,做空J,做多JM + # Sharpe difference breaks lower band, go short J, long JM self.order = self.sell(data=self.data0, size=10) self.order = self.buy(data=self.data1, size=14) self.entry_day = len(self) self.position_type = "short_j_long_jm" if self.p.printlog: print( - f"开仓: 做空J,做多JM, 夏普差={delta_sharpe:.4f}," - f" 下轨={lower:.4f}" + f"Open position: Short J, Long JM, Sharpe diff={delta_sharpe:.4f}," + f" Lower band={lower:.4f}" ) def notify_order(self, order): """ + Called when order status changes - :param order: - + Args: + order: The order that has changed status """ if order.status in [order.Completed]: if self.p.printlog: if order.isbuy(): print( - f"买入执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" + f"Buy executed: Price={order.executed.price:.2f}," + f" Cost={order.executed.value:.2f}," + f" Commission={order.executed.comm:.2f}" ) else: print( - f"卖出执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" + f"Sell executed: Price={order.executed.price:.2f}," + f" Cost={order.executed.value:.2f}," + f" Commission={order.executed.comm:.2f}" ) elif order.status in [order.Canceled, order.Margin, order.Rejected]: - print("订单被取消/拒绝") + print("Order canceled/rejected") self.order = None -# 数据加载函数,处理索引问题 +# Data loading function, handling index issues def load_data(symbol1, symbol2, fromdate, todate): """ - - :param symbol1: - :param symbol2: - :param fromdate: - :param todate: - + Load data for two symbols from HDF5 file + + Args: + symbol1: First symbol to load + symbol2: Second symbol to load + fromdate: Start date for data + todate: End date for data + + Returns: + Tuple of two backtrader data feeds """ output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" try: - # 加载数据时不保留原有索引结构 + # Load data without preserving original index structure df0 = pd.read_hdf(output_file, key=symbol1).reset_index() df1 = pd.read_hdf(output_file, key=symbol2).reset_index() - # 查找日期列(兼容不同命名) + # Find date column (compatible with different naming) date_col = [col for col in df0.columns if "date" in col.lower()] if not date_col: - raise ValueError("数据集中未找到日期列") + raise ValueError("Date column not found in dataset") - # 设置日期索引 + # Set date index df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) df0 = df0.sort_index().loc[fromdate:todate] df1 = df1.sort_index().loc[fromdate:todate] - # 创建数据feed - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, # 使用索引 - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) + # Create data feeds + data0 = bt.feeds.PandasData(dataframe=df0) + data1 = bt.feeds.PandasData(dataframe=df1) return data0, data1 except Exception as e: - print(f"加载数据时出错: {e}") + print(f"Error loading data: {e}") return None, None -# 运行网格回测并绘制热力图 +# Run grid search backtest and plot heatmap def run_grid_search(): - """ """ - # 定义参数网格 - ma_periods = [5, 10, 15, 20, 25, 30, 35, 40] # 移动平均周期 - entry_multipliers = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1.0, 1.5] # 标准差乘数 + """ + Run a grid search to optimize strategy parameters and visualize results + + Returns: + Tuple containing results array, ma_periods list, and entry_multipliers list + """ + # Define parameter grid + ma_periods = [5, 10, 15, 20, 25, 30, 35, 40] # Moving average periods + entry_multipliers = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1.0, 1.5] # Standard deviation multipliers - # 存储结果 + # Store results results = np.zeros((len(ma_periods), len(entry_multipliers))) - # 设置初始日期 + # Set initial dates fromdate = datetime.datetime(2017, 1, 1) todate = datetime.datetime(2025, 1, 1) - # 加载数据一次(这些数据可以重复使用) + # Load data once (can be reused) data0, data1 = load_data("/J", "/JM", fromdate, todate) if data0 is None or data1 is None: - print("无法加载数据,请检查文件路径和数据格式") + print("Unable to load data, please check file path and data format") return - print("开始网格回测...") + print("Starting grid search...") print( - f"测试参数组合: {len(ma_periods)} x {len(entry_multipliers)} =" - f" {len(ma_periods) * len(entry_multipliers)}个组合" + f"Testing parameter combinations: {len(ma_periods)} x {len(entry_multipliers)} =" + f" {len(ma_periods) * len(entry_multipliers)} combinations" ) - # 进行网格回测 + # Perform grid search for i, ma_period in enumerate(ma_periods): for j, entry_multiplier in enumerate(entry_multipliers): print( - f"测试参数: ma_period={ma_period}," + f"Testing parameters: ma_period={ma_period}," f" entry_std_multiplier={entry_multiplier}" ) try: - # 创建一个新的cerebro实例 - cerebro = bt.Cerebro(stdstats=False) + # Create a new cerebro instance + cerebro = bt.Cerebro() - # 添加相同的数据 + # Add the same data cerebro.adddata(data0, name="J") cerebro.adddata(data1, name="JM") - # 添加策略,使用当前测试的参数 + # Add strategy with current test parameters cerebro.addstrategy( SharpeDiffStrategy, ma_period=ma_period, entry_std_multiplier=entry_multiplier, printlog=False, - ) # 关闭日志,减少输出 + ) # Turn off logging to reduce output - # 设置资金和佣金 + # Set funds and commission cerebro.broker.setcash(100000) cerebro.broker.setcommission(commission=0.0003) cerebro.broker.set_shortcash(False) - # 添加夏普比率分析器 - cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, - riskfreerate=0, - annualize=True, - ) - - # 运行回测 - strats = cerebro.run() + # Run backtest + strats = cerebro.run() # pylint: disable=no-member - # 获取夏普比率 - 安全处理None值 + # Get Sharpe ratio - safely handle None values sharpe_analysis = strats[0].analyzers.sharperatio.get_analysis() sharpe = sharpe_analysis.get("sharperatio", 0) if sharpe_analysis else 0 - # 存储结果 + # Store results results[i, j] = sharpe - print(f"夏普比率: {sharpe:.2f}") + print(f"Sharpe ratio: {sharpe:.2f}") except Exception as e: print( - f"参数组合 ma_period={ma_period}," - f" entry_std_multiplier={entry_multiplier} 执行出错: {e}" + f"Parameter combination ma_period={ma_period}," + f" entry_std_multiplier={entry_multiplier} execution error: {e}" ) - results[i, j] = -99 # 使用一个明显的负值标记出错项 + results[i, j] = -99 # Use a clearly negative value to mark error items - # 绘制热力图 + # Plot heatmap plt.figure(figsize=(12, 8)) - # 使用Seaborn的热力图 + # Use Seaborn's heatmap ax = sns.heatmap( results, annot=True, @@ -354,23 +340,23 @@ def run_grid_search(): yticklabels=ma_periods, ) - # 设置标题和标签 - plt.title("sharpe_ratio_heatmap - ma_period vs entry_std_multiplier") + # Set title and labels + plt.title("Sharpe Ratio Heatmap - ma_period vs entry_std_multiplier") plt.xlabel("entry_std_multiplier") plt.ylabel("ma_period") - # 显示图形 + # Display figure plt.tight_layout() plt.savefig("sharpe_ratio_heatmap.png") plt.show() - print("热力图已保存为 'sharpe_ratio_heatmap.png'") + print("Heatmap saved as 'sharpe_ratio_heatmap.png'") - # 清除无效值(出错的回测结果) + # Clear invalid values (failed backtest results) results_clean = np.copy(results) results_clean[results_clean == -99] = np.nan - # 找出最佳参数组合(排除无效值) + # Find best parameter combination (excluding invalid values) if np.any(~np.isnan(results_clean)): max_i, max_j = np.unravel_index( np.nanargmax(results_clean), results_clean.shape @@ -379,16 +365,16 @@ def run_grid_search(): best_entry_multiplier = entry_multipliers[max_j] best_sharpe = results_clean[max_i, max_j] - print("\n最佳参数组合:") + print("\nBest parameter combination:") print(f"ma_period: {best_ma_period}") print(f"entry_std_multiplier: {best_entry_multiplier}") - print(f"夏普比率: {best_sharpe:.4f}") + print(f"Sharpe ratio: {best_sharpe:.4f}") else: - print("\n所有参数组合都出现错误,无法确定最佳参数") + print("\nAll parameter combinations had errors, unable to determine best parameters") return results, ma_periods, entry_multipliers -# 修改主函数,调用网格搜索 +# Modified main function to call grid search if __name__ == "__main__": run_grid_search() diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py index c219cce33..715b31151 100644 --- a/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py @@ -5,6 +5,12 @@ import numpy as np import pandas as pd +from arbitrage.common_strategy_utils import ( + init_common_vars, + notify_order_default, + notify_trade_default, +) + # 偏度差均值回归策略(基于历史统计量的版本) class SkewnessArbitrageStrategy(bt.Strategy): @@ -21,21 +27,18 @@ class SkewnessArbitrageStrategy(bt.Strategy): def __init__(self): """ """ - # 存储偏度序列用于绘图 - self.skew_j_values = [] - self.skew_jm_values = [] - self.delta_skew_values = [] - self.dates = [] - - # 存储偏度差的历史统计量 - self.delta_mean = 0 - self.delta_std = 0 - - # 存储开仓和平仓阈值 - self.upper_entry_threshold = 0 - self.lower_entry_threshold = 0 - self.upper_exit_threshold = 0 - self.lower_exit_threshold = 0 + extra_vars = { + 'skew_j_values': [], + 'skew_jm_values': [], + 'delta_skew_values': [], + 'delta_mean': 0, + 'delta_std': 0, + 'upper_entry_threshold': 0, + 'lower_entry_threshold': 0, + 'upper_exit_threshold': 0, + 'lower_exit_threshold': 0, + } + init_common_vars(self, extra_vars) # 为两个数据集创建收益率序列 self.returns_j = [] @@ -177,39 +180,10 @@ def next(self): ) def notify_order(self, order): - """ - - :param order: - - """ - if order.status in [order.Completed]: - if self.p.printlog: - if order.isbuy(): - print( - f"买入执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" - ) - else: - print( - f"卖出执行: 价格={order.executed.price:.2f}," - f" 成本={order.executed.value:.2f}," - f" 手续费={order.executed.comm:.2f}" - ) - - elif order.status in [order.Canceled, order.Margin, order.Rejected]: - print("订单被取消/拒绝") - - self.order = None + notify_order_default(self, order) def notify_trade(self, trade): - """ - - :param trade: - - """ - if self.p.printlog and trade.isclosed: - print(f"平仓盈利: {trade.pnlcomm:.2f}") + notify_trade_default(self, trade) def stop(self): """ """ @@ -330,24 +304,8 @@ def load_data(symbol1, symbol2, fromdate, todate): df1 = df1.sort_index().loc[fromdate:todate] # 创建数据feed - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, # 使用索引 - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) + data0 = bt.feeds.PandasData(dataname=df0) + data1 = bt.feeds.PandasData(dataname=df1) return data0, data1 except Exception as e: print(f"加载数据时出错: {e}") @@ -361,7 +319,7 @@ def configure_cerebro(**kwargs): :param **kwargs: """ - cerebro = bt.Cerebro(stdstats=False) # 启用标准统计 + cerebro = bt.Cerebro() data0, data1 = load_data( "/J", "/JM", @@ -375,31 +333,12 @@ def configure_cerebro(**kwargs): cerebro.adddata(data0, name="J") cerebro.adddata(data1, name="JM") - cerebro.addstrategy(SkewnessArbitrageStrategy, printlog=True) # 启用日志输出 + cerebro.addstrategy(SkewnessArbitrageStrategy, printlog=True) cerebro.broker.setcash(80000) - # cerebro.broker.setcommission(0.0003) - cerebro.broker.set_shortcash(False) - - cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 - cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) - cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, # 按日数据计算 - riskfreerate=0, # 默认年化1%的风险无风险利率 - annualize=True, # 不进行年化 - ) - cerebro.addanalyzer( - bt.analyzers.Returns, - tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 - ) - cerebro.addanalyzer( - bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days, plot=True - ) # 这里的period可以是daily, weekly, monthly等 - # cerebro.broker.setcommission(commission=0.001) cerebro.broker.set_shortcash(False) - # cerebro.addobserver(bt.observers.Trades) - # # cerebro.addobserver(bt.observers.BuySell) - # cerebro.addobserver(bt.observers.CumValue) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.SharpeRatio) + cerebro.addanalyzer(bt.analyzers.TimeReturn) return cerebro @@ -414,22 +353,13 @@ def analyze_results(results): return try: - # 获取分析结果 drawdown = results[0].analyzers.drawdown.get_analysis() sharpe = results[0].analyzers.sharperatio.get_analysis() - roi = results[0].analyzers.roianalyzer.get_analysis() - total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 - cagr = results[0].analyzers.cagranalyzer.get_analysis() - # # 打印分析结果 + returns = results[0].analyzers.timereturn.get_analysis() print("=============回测结果================") - print(f"\nSharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") + print(f"Sharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") print(f"Drawdown: {drawdown.get('max', {}).get('drawdown', 0):.2f} %") - print( - f"Annualized/Normalized return: {total_returns.get('rnorm100', 0):.2f}%" - ) # - print(f"Total compound return: {roi.get('roi100', 0):.2f}%") - print(f"年化收益: {cagr.get('cagr', 0):.2f} ") - print(f"夏普比率: {cagr.get('sharpe', 0):.2f}") + print(f"Total return: {returns.get('rtot', 0):.2%}") except Exception as e: print(f"分析结果时出错: {e}") diff --git a/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py b/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py index c2236da23..518d34597 100644 --- a/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py +++ b/arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py @@ -4,7 +4,7 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pd -import seaborn as sns +import seaborn as sns # pylint: disable=import-error # 偏度差均值回归策略(基于历史统计量的版本) @@ -324,24 +324,8 @@ def load_data(symbol1, symbol2, fromdate, todate): df1 = df1.sort_index().loc[fromdate:todate] # 创建数据feed - data0 = bt.feeds.PandasData( - dataname=df0, - datetime=None, # 使用索引 - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) - data1 = bt.feeds.PandasData( - dataname=df1, - datetime=None, - open="open", - high="high", - low="low", - close="close", - volume="volume", - ) + data0 = bt.feeds.PandasData(dataname=df0) + data1 = bt.feeds.PandasData(dataname=df1) return data0, data1 except Exception as e: print(f"加载数据时出错: {e}") @@ -384,7 +368,7 @@ def run_grid_search(): ) # 创建一个新的cerebro实例 - cerebro = bt.Cerebro(stdstats=False) + cerebro = bt.Cerebro() # 添加相同的数据 cerebro.adddata(data0, name="J") @@ -405,12 +389,15 @@ def run_grid_search(): cerebro.broker.set_shortcash(False) # 添加夏普比率分析器 - cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, - riskfreerate=0, - annualize=True, - ) + try: + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + except AttributeError: + pass # pylint: disable=import-error # 运行回测 strats = cerebro.run() @@ -452,6 +439,8 @@ def run_grid_search(): # 找出最佳参数组合 max_i, max_j = np.unravel_index(results.argmax(), results.shape) + max_i = int(max_i) + max_j = int(max_j) best_skew_period = skew_periods[max_i] best_entry_multiplier = entry_multipliers[max_j] best_sharpe = results[max_i, max_j] diff --git a/arbitrage/different_arbitrage_indicators/README.md b/arbitrage/different_arbitrage_indicators/README.md new file mode 100644 index 000000000..2b1986106 --- /dev/null +++ b/arbitrage/different_arbitrage_indicators/README.md @@ -0,0 +1,42 @@ +# different_arbitrage_indicators + +Contains technical indicator implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (arbitrage)](../README.md) + +## Files + +### JM_J_strategy.py + + + +### JM_J_strategy_CUSUM_GridSearch.py + +Grid search for CUSUM strategy on J/JM pairs. Includes spread calculation with + +### JM_J_strategy_sharpe.py + + + +### JM_J_strategy_sharpe_grid.py + +Strategy based on the difference of Sharpe ratios between two assets with Bollinger Bands + +### JM_J_strategy_skewness.py + + + +### JM_J_strategy_skewness_grid.py + + + + +## Directory Summary + +This directory contains 6 files and 0 subdirectories. + +### File Types + +* .py: 6 files diff --git a/arbitrage/hold_rb.py b/arbitrage/hold_rb.py index 3cecf3deb..a8ea3ec01 100644 --- a/arbitrage/hold_rb.py +++ b/arbitrage/hold_rb.py @@ -44,7 +44,7 @@ def notify_order(self, order): # 确保 'date' 列转换为 datetime 类型 df_RB["date"] = pd.to_datetime(df_RB["date"], errors="coerce") -data1 = bt.feeds.PandasData(dataname=df_RB, datetime="date", nocase=True) +data1 = bt.feeds.PandasData(dataname=df_RB) # 创建回测引擎 cerebro = bt.Cerebro() @@ -58,19 +58,10 @@ def notify_order(self, order): # cerebro.broker.setcash(1000000.0) # 添加分析器:SharpeRatio、DrawDown、AnnualReturn 和 Returns -cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, # 按日数据计算 - riskfreerate=0, # 默认年化1%的风险无风险利率 - annualize=True, # 不进行年化 -) -cerebro.addanalyzer(bt.analyzers.AnnualReturn) -cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 -cerebro.addanalyzer( - bt.analyzers.Returns, - # timeframe=bt.TimeFrame.Days, # 按日数据计算 - tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 -) # 自定义名称 +cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown") +cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharperatio") +cerebro.addanalyzer(bt.analyzers.Returns, _name="returns") +cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name="tradeanalyzer") # 添加CAGR分析器 cerebro.addanalyzer( @@ -82,21 +73,12 @@ def notify_order(self, order): # 获取分析结果 sharpe = results[0].analyzers.sharperatio.get_analysis() drawdown = results[0].analyzers.drawdown.get_analysis() -annual_returns = results[0].analyzers.annualreturn.get_analysis() -total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 -cagr = results[0].analyzers.cagranalyzer.get_analysis() -print(cagr) +total_returns = results[0].analyzers.returns.get_analysis() +trade = results[0].analyzers.tradeanalyzer.get_analysis() # 打印分析结果 print(f"\n夏普比率: {sharpe['sharperatio']}") print(f"最大回撤: {drawdown['max']['drawdown']} %") print(f"总回报率: {total_returns['rnorm100']:.2f}%") # 打印总回报率 -# 打印年度回报率 -print("\n年度回报率:") -print("=" * 80) -print("{:<8} {:<12}".format("年份", "回报率")) -for year, return_rate in annual_returns.items(): - print("{:<8} {:<12.2%}".format(year, return_rate)) - # 绘制结果 # cerebro.plot(volume=False) diff --git a/arbitrage/industry_chain_arbitrage_logic/README.md b/arbitrage/industry_chain_arbitrage_logic/README.md new file mode 100644 index 000000000..5dd991624 --- /dev/null +++ b/arbitrage/industry_chain_arbitrage_logic/README.md @@ -0,0 +1,34 @@ +# industry_chain_arbitrage_logic + +Contains log files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (arbitrage)](../README.md) + +## Files + +### JD_strategy.py + +Python module + +### JM_J_strategy.py + +Python module + +### JM_J_strategy_trailing_stop.py + +Python module + +### MA_PP_strategy.py + +Python module + + +## Directory Summary + +This directory contains 4 files and 0 subdirectories. + +### File Types + +* .py: 4 files diff --git a/arbitrage/test/README.md b/arbitrage/test/README.md new file mode 100644 index 000000000..72084f43f --- /dev/null +++ b/arbitrage/test/README.md @@ -0,0 +1,22 @@ +# test + +Contains test files and test utilities. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (arbitrage)](../README.md) + +## Files + +### hold_rb.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/arbitrage/test/hold_rb.py b/arbitrage/test/hold_rb.py index 8128edaa2..3f145f3bc 100644 --- a/arbitrage/test/hold_rb.py +++ b/arbitrage/test/hold_rb.py @@ -54,13 +54,12 @@ def notify_trade(self, trade): """ if trade.isclosed: print( - "TRADE CLOSED %s, PROFIT: GROSS %.2f, NET %.2f" - % (bt.num2date(trade.dtclose), trade.pnl, trade.pnlcomm) + f"TRADE CLOSED {self.data.datetime.date(0)}, PROFIT: GROSS {trade.pnl:.2f}, NET {trade.pnlcomm:.2f}" ) elif trade.justopened: print( - "TRADE OPENED %s , SIZE %2d" % (bt.num2date(trade.dtopen), trade.size) + f"TRADE OPENED {self.data.datetime.date(0)}, SIZE {trade.size}" ) def notify_order(self, order): @@ -77,9 +76,7 @@ def notify_order(self, order): if order.status in [order.Completed]: if order.isbuy(): print( - f"executed date {bt.num2date(order.executed.dt)},executed price" - f" {order.executed.price}, created date" - f" {bt.num2date(order.created.dt)}" + f"executed date {self.data.datetime.date(0)},executed price {order.executed.price}, created date {self.data.datetime.date(0)}" ) @@ -94,7 +91,7 @@ def notify_order(self, order): print(df_RB.head()) -data1 = bt.feeds.PandasData(dataname=df_RB, datetime="date", nocase=True) +data1 = bt.feeds.PandasData(dataname=df_RB) # 创建回测引擎 cerebro = bt.Cerebro() @@ -108,18 +105,10 @@ def notify_order(self, order): cerebro.broker.setcash(1000.0) cerebro.broker.set_shortcash(False) # 添加分析器:SharpeRatio、DrawDown、AnnualReturn 和 Returns -cerebro.addanalyzer( - bt.analyzers.SharpeRatio, - timeframe=bt.TimeFrame.Days, # 按日数据计算 - riskfreerate=0, # 默认年化1%的风险无风险利率 - annualize=True, # 不进行年化 -) -cerebro.addanalyzer(bt.analyzers.AnnualReturn) -cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 -cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) # 回撤分析器 -# cerebro.addanalyzer(bt.analyzers.Returns, -# tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 -# ) # 自定义名称 +cerebro.addanalyzer(bt.analyzers.DrawDown, _name="drawdown") +cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name="sharperatio") +cerebro.addanalyzer(bt.analyzers.Returns, _name="returns") +cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name="tradeanalyzer") cerebro.addanalyzer( bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days @@ -130,18 +119,14 @@ def notify_order(self, order): # 获取分析结果 sharpe = results[0].analyzers.sharperatio.get_analysis() drawdown = results[0].analyzers.drawdown.get_analysis() -# annual_returns = results[0].analyzers.annualreturn.get_analysis() -# total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 -cagr = results[0].analyzers.cagranalyzer.get_analysis() +total_returns = results[0].analyzers.returns.get_analysis() trade = results[0].analyzers.tradeanalyzer.get_analysis() # 打印分析结果 print("=============回测结果================") print(f"\n夏普比率: {sharpe['sharperatio']:.2f}") print(f"最大回撤: {drawdown['max']['drawdown']:.2f} %") -# print(f"总回报率: {total_returns['rnorm100']:.2f}%") # 打印总回报率 -print(f"年化收益: {cagr['cagr']:.2f} %") -print(f"sharpe: {cagr['sharpe']:.2f} ") +print(f"总回报率: {total_returns['rnorm100']:.2f}%") # 打印总回报率 print(f"交易记录: {trade}") diff --git a/arbitrage/test_feedspread_yearly.py b/arbitrage/test_feedspread_yearly.py index b91104056..db3ea1fd4 100644 --- a/arbitrage/test_feedspread_yearly.py +++ b/arbitrage/test_feedspread_yearly.py @@ -256,9 +256,9 @@ def print_annual_metrics(self): print(df_spread.describe()) # Add data -data0 = bt.feeds.PandasData(dataname=df_I, datetime="date") -data1 = bt.feeds.PandasData(dataname=df_RB, datetime="date") -data2 = bt.feeds.PandasData(dataname=df_spread, datetime="date") +data0 = bt.feeds.PandasData(dataname=df_I) +data1 = bt.feeds.PandasData(dataname=df_RB) +data2 = bt.feeds.PandasData(dataname=df_spread) # Create backtesting engine cerebro = bt.Cerebro() diff --git a/backtest/README.md b/backtest/README.md new file mode 100644 index 000000000..45a138e8f --- /dev/null +++ b/backtest/README.md @@ -0,0 +1,35 @@ +# backtest + +Contains backtesting functionality. Primarily contains Python code and includes documentation. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [analyzers](analyzers/README.md) - Contains analysis tools and metrics +* [feeds](feeds/README.md) - Contains data feed implementations +* [observers](observers/README.md) - Contains observer implementations +* [strategies](strategies/README.md) - Contains trading strategy implementations +* [tool](tool/README.md) - Directory containing tool related files + +## Files + +### __init__.py + +Python module + +### requirements.txt + +Documentation file + + +## Directory Summary + +This directory contains 2 files and 5 subdirectories. + +### File Types + +* .py: 1 files +* .txt: 1 files diff --git a/backtest/analyzers/README.md b/backtest/analyzers/README.md new file mode 100644 index 000000000..e65f8fa09 --- /dev/null +++ b/backtest/analyzers/README.md @@ -0,0 +1,26 @@ +# analyzers + +Contains analysis tools and metrics. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtest)](../README.md) + +### Subdirectories + +* [template](template/README.md) - Contains temporary files + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 1 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/analyzers/template/README.md b/backtest/analyzers/template/README.md new file mode 100644 index 000000000..4fe4c25e5 --- /dev/null +++ b/backtest/analyzers/template/README.md @@ -0,0 +1,22 @@ +# template + +Contains temporary files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (analyzers)](../README.md) + +## Files + +### template.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/feeds/README.md b/backtest/feeds/README.md new file mode 100644 index 000000000..254d0821d --- /dev/null +++ b/backtest/feeds/README.md @@ -0,0 +1,26 @@ +# feeds + +Contains data feed implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtest)](../README.md) + +## Files + +### __init__.py + +Python module + +### datafeeds.py + +Write private data file classes. + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtest/observers/README.md b/backtest/observers/README.md new file mode 100644 index 000000000..8bcf4c793 --- /dev/null +++ b/backtest/observers/README.md @@ -0,0 +1,26 @@ +# observers + +Contains observer implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtest)](../README.md) + +### Subdirectories + +* [order_observer](order_observer/README.md) - Directory containing order_observer related files + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 1 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/observers/order_observer/README.md b/backtest/observers/order_observer/README.md new file mode 100644 index 000000000..0bde7f023 --- /dev/null +++ b/backtest/observers/order_observer/README.md @@ -0,0 +1,22 @@ +# order_observer + +Directory containing order_observer related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (observers)](../README.md) + +## Files + +### order_observer.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/strategies/README.md b/backtest/strategies/README.md new file mode 100644 index 000000000..331208ced --- /dev/null +++ b/backtest/strategies/README.md @@ -0,0 +1,28 @@ +# strategies + +Contains trading strategy implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtest)](../README.md) + +### Subdirectories + +* [g8_strategy](g8_strategy/README.md) - Directory containing g8_strategy related files +* [strategy_template](strategy_template/README.md) - Contains temporary files +* [test_strategy](test_strategy/README.md) - Contains test files and test utilities + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 3 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/strategies/g8_strategy/README.md b/backtest/strategies/g8_strategy/README.md new file mode 100644 index 000000000..e6a043b6b --- /dev/null +++ b/backtest/strategies/g8_strategy/README.md @@ -0,0 +1,31 @@ +# g8_strategy + +Directory containing g8_strategy related files. Primarily contains .csv files code and includes test files. + +## Navigation + +* [↑ Parent Directory (strategies)](../README.md) + +## Files + +### g8_strategy.py + + + +### ma_test_result_trades.csv + +Binary or data file + +### up_stat_week.csv + +Binary or data file + + +## Directory Summary + +This directory contains 3 files and 0 subdirectories. + +### File Types + +* .csv: 2 files +* .py: 1 files diff --git a/backtest/strategies/strategy_template/README.md b/backtest/strategies/strategy_template/README.md new file mode 100644 index 000000000..04ea503aa --- /dev/null +++ b/backtest/strategies/strategy_template/README.md @@ -0,0 +1,22 @@ +# strategy_template + +Contains temporary files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (strategies)](../README.md) + +## Files + +### strategy_template.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/strategies/test_strategy/README.md b/backtest/strategies/test_strategy/README.md new file mode 100644 index 000000000..f69defdf6 --- /dev/null +++ b/backtest/strategies/test_strategy/README.md @@ -0,0 +1,22 @@ +# test_strategy + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (strategies)](../README.md) + +## Files + +### test_strategy.py + +Example Backtrader strategy for demonstration and testing purposes. + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/tool/README.md b/backtest/tool/README.md new file mode 100644 index 000000000..e26a0781b --- /dev/null +++ b/backtest/tool/README.md @@ -0,0 +1,26 @@ +# tool + +Directory containing tool related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtest)](../README.md) + +### Subdirectories + +* [akshare-download](akshare-download/README.md) - Directory containing akshare-download related files + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 1 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtest/tool/akshare-download/README.md b/backtest/tool/akshare-download/README.md new file mode 100644 index 000000000..619410bf3 --- /dev/null +++ b/backtest/tool/akshare-download/README.md @@ -0,0 +1,30 @@ +# akshare-download + +Directory containing akshare-download related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (tool)](../README.md) + +## Files + +### __init__.py + +Python module + +### fund.py + +Get funds datas + +### stock.py + +Download stock datas + + +## Directory Summary + +This directory contains 3 files and 0 subdirectories. + +### File Types + +* .py: 3 files diff --git a/backtrader/README.md b/backtrader/README.md new file mode 100644 index 000000000..a7a9b04c5 --- /dev/null +++ b/backtrader/README.md @@ -0,0 +1,171 @@ +# backtrader + +Directory containing backtrader related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [analyzers](analyzers/README.md) - Contains analysis tools and metrics +* [brokers](brokers/README.md) - Contains broker implementations +* [btrun](btrun/README.md) - Directory containing btrun related files +* [commissions](commissions/README.md) - Contains commission models +* [engine](engine/README.md) - Directory containing engine related files +* [feeds](feeds/README.md) - Contains data feed implementations +* [filters](filters/README.md) - Contains data filtering implementations +* [indicators](indicators/README.md) - Contains technical indicator implementations +* [listeners](listeners/README.md) - Directory containing listeners related files +* [observers](observers/README.md) - Contains observer implementations +* [orders](orders/README.md) - Directory containing orders related files +* [plot](plot/README.md) - Contains plotting functionality +* [signals](signals/README.md) - Directory containing signals related files +* [sizers](sizers/README.md) - Contains position sizing implementations +* [stores](stores/README.md) - Contains store implementations +* [strategies](strategies/README.md) - Contains trading strategy implementations +* [studies](studies/README.md) - Directory containing studies related files +* [utils](utils/README.md) - Contains utility functions and helper code + +## Files + +### __init__.py + +Python module + +### analyzer.py + +Analyzer module for Backtrader. Provides base classes and metaclasses for analyzers, + +### broker.py + + + +### cerebro.py + + + +### comminfo.py + +Base Class for the Commission Schemes. + +### dataseries.py + + + +### errors.py + +Base exception for all other exceptions + +### feed.py + +Metaclass for registering and initializing data feed subclasses. + +### fillers.py + +:returns: volume in a bar. + +### flt.py + + + +### functions.py + + + +### indicator.py + + + +### linebuffer.py + +.. module:: linebuffer + +### lineiterator.py + + + +### lineroot.py + +.. module:: lineroot + +### lineseries.py + +.. module:: lineroot + +### listener.py + + + +### mathsupport.py + +:param x: iterable with len + +### metabase.py + +:param kls: + +### observer.py + + + +### order.py + +Intended to hold information about order execution. A "bit" does not + +### position.py + +Keeps and updates the size and price of a position. The object has no + +### resamplerfilter.py + + + +### signal.py + + + +### sizer.py + +This is the base class for *Sizers*. Any *sizer* should subclass this + +### store.py + +Metaclass to make a metaclassed class a singleton + +### strategy.py + + + +### talib.py + + + +### timer.py + + + +### trade.py + +Represents the status and update event for each update a Trade has + +### tradingcal.py + + + +### version.py + +Python module + +### writer.py + + + + +## Directory Summary + +This directory contains 33 files and 18 subdirectories. + +### File Types + +* .py: 33 files diff --git a/backtrader/analyzer.py b/backtrader/analyzer.py index 87b3f726d..74d99809e 100644 --- a/backtrader/analyzer.py +++ b/backtrader/analyzer.py @@ -445,7 +445,7 @@ def __init__(self, *args, **kwargs): self.data = None def _start(self): - """Inicializa atributos de timeframe e compressão.""" + """Initializes timeframe and compression attributes.""" # Ensure self.p and self.data are set before use if self.p is None: # Convert params tuple to an object with attributes, defaulting to None @@ -503,7 +503,7 @@ def on_dt_over(self): """ """ def _dt_over(self): - """Verifica se houve avanço de período temporal.""" + """Checks if there was a time period advancement.""" if self.timeframe == TimeFrame.NoTimeFrame: dtcmp, dtkey = MAXINT, datetime.datetime.max else: @@ -552,7 +552,7 @@ def _get_dt_cmpkey(self, dt): return dtcmp, dtkey def _get_subday_cmpkey(self, dt): - """Calcula chave de comparação para subperíodos do dia.""" + """Calculates comparison key for day sub-periods.""" # Calculate intraday position ph = 0 pm = 0 diff --git a/backtrader/analyzers/README.md b/backtrader/analyzers/README.md new file mode 100644 index 000000000..a2180346f --- /dev/null +++ b/backtrader/analyzers/README.md @@ -0,0 +1,98 @@ +# analyzers + +Contains analysis tools and metrics. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### annualreturn.py + +This analyzer calculates the AnnualReturns by looking at the beginning + +### caganalyzer.py + +Calculates the Compound Annual Growth Rate (CAGR) and plots cumulative returns. + +### calmar.py + +This analyzer calculates the CalmarRatio + +### drawdown.py + +This analyzer calculates trading system drawdowns stats such as drawdown + +### leverage.py + +This analyzer calculates the Gross Leverage of the current strategy + +### logreturnsrolling.py + +This analyzer calculates rolling returns for a given timeframe and + +### periodstats.py + +Calculates basic statistics for given timeframe + +### positions.py + +This analyzer reports the value of the positions of the current set of + +### pyfolio.py + +This analyzer uses 4 children analyzers to collect data and transforms it + +### returns.py + +Total, Average, Compound and Annualized Returns calculated using a + +### roi.py + +Calculates the Compound Annual Growth Rate (roi) for a strategy. + +### sharpe.py + +This analyzer calculates the SharpeRatio of a strategy using a risk free + +### slippage_impact.py + +Analyzer that measures the impact of slippage on trading performance metrics. + +### sortino.py + +This analyzer calculates the Sortino Ratio of a strategy using a risk free + +### sqn.py + +SQN or SystemQualityNumber. Defined by Van K. Tharp to categorize trading + +### timereturn.py + +This analyzer calculates the Returns by looking at the beginning + +### tradeanalyzer.py + +Provides statistics on closed trades (keeps also the count of open ones) + +### transactions.py + +This analyzer reports the transactions occurred with each an every data in + +### vwr.py + +Variability-Weighted Return: Better SharpeRatio with Log Returns + + +## Directory Summary + +This directory contains 20 files and 0 subdirectories. + +### File Types + +* .py: 20 files diff --git a/backtrader/analyzers/caganalyzer.py b/backtrader/analyzers/caganalyzer.py index c9585a7e2..b7cc7001e 100644 --- a/backtrader/analyzers/caganalyzer.py +++ b/backtrader/analyzers/caganalyzer.py @@ -10,7 +10,7 @@ class CAGRAnalyzer(TimeFrameAnalyzerBase): params = ( ("period", None), ("fund", None), - ("plot", True), # 新增参数:是否自动绘图 + ("plot", True), # New parameter: whether to automatically plot ) _TANN = { diff --git a/backtrader/brokers/README.md b/backtrader/brokers/README.md new file mode 100644 index 000000000..c4f2dc41f --- /dev/null +++ b/backtrader/brokers/README.md @@ -0,0 +1,38 @@ +# brokers + +Contains broker implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### bbroker.py + +Broker Simulator + +### ibbroker.py + + + +### oandabroker.py + + + +### vcbroker.py + +Commissions are calculated by ib, but the trades calculations in the + + +## Directory Summary + +This directory contains 5 files and 0 subdirectories. + +### File Types + +* .py: 5 files diff --git a/backtrader/btrun/README.md b/backtrader/btrun/README.md new file mode 100644 index 000000000..cf7ffc59c --- /dev/null +++ b/backtrader/btrun/README.md @@ -0,0 +1,26 @@ +# btrun + +Directory containing btrun related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### btrun.py + +btrun.py - Backtrader command-line runner for strategies, analyzers, and data feeds. + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/btrun/btrun.py b/backtrader/btrun/btrun.py index dc6b0c7d7..e11519403 100644 --- a/backtrader/btrun/btrun.py +++ b/backtrader/btrun/btrun.py @@ -218,7 +218,7 @@ def btrun(pargs=""): ans = getfunctions(args.hooks, Cerebro) for hook, kwargs in ans: hook(cerebro, **kwargs) - runsts = cerebro.run() + runsts = cerebro.run() # pylint: disable=no-member runst = runsts[0] # single strategy and no optimization if args.pranalyzer or args.ppranalyzer: diff --git a/backtrader/cerebro.py b/backtrader/cerebro.py index 2fc0e0009..cabb793d7 100644 --- a/backtrader/cerebro.py +++ b/backtrader/cerebro.py @@ -116,7 +116,7 @@ def __init__(self): params_iter = list(self.params._getitems()) if self.p is None: self.p = make_params(params_iter) - # Garante que todos os parâmetros esperados existem + # Ensures that all expected parameters exist for pname, pval in params_iter: if not hasattr(self.p, pname): setattr(self.p, pname, pval) @@ -222,7 +222,7 @@ def add_order_history(self, orders, notify=True): self._ohistory.append((orders, notify)) def notify_timer(self, timer, when, *args, **kwargs): - """Delegação para utilitário de notificação de timer.""" + """Delegation to timer notification utility.""" notify_timer(timer, when, *args, **kwargs) def add_timer( @@ -241,7 +241,7 @@ def add_timer( *args, **kwargs, ): - """Agenda um timer usando utilitário.""" + """Schedules a timer using utility.""" return schedule_timer( self, when, @@ -260,11 +260,11 @@ def add_timer( ) def addtz(self, tz): - """Define o timezone global usando utilitário.""" + """Sets the global timezone using utility.""" addtz(self.p, tz) def addcalendar(self, cal): - """Adiciona um calendário global usando utilitário.""" + """Adds a global calendar using utility.""" self._tradingcal = addcalendar(cal) def add_signal(self, sigtype, sigcls, *sigargs, **sigkwargs): @@ -884,7 +884,7 @@ def prerun(self, **kwargs): if not self.datas: return [] # nothing can be run - # Garante que self.params é objeto Params + # Ensures that self.params is a Params object if not hasattr(self, "params") or not hasattr(self.params, "_getkeys"): self.params = self.p pkeys = self.params._getkeys() if hasattr(self.params, "_getkeys") else [] diff --git a/backtrader/comminfo.py b/backtrader/comminfo.py index 807174cfd..6c78dc03e 100644 --- a/backtrader/comminfo.py +++ b/backtrader/comminfo.py @@ -110,6 +110,7 @@ class CommInfoBase(with_metaclass(MetaParams)): """ + # pylint: disable=no-member COMM_PERC, COMM_FIXED = range(2) diff --git a/backtrader/commissions/README.md b/backtrader/commissions/README.md new file mode 100644 index 000000000..a3069c8f1 --- /dev/null +++ b/backtrader/commissions/README.md @@ -0,0 +1,26 @@ +# commissions + +Contains commission models. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +from ..comminfo import CommInfoBase + +### ibcommission.py + +Commissions are calculated by ib, but the trades calculations in the + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/engine/README.md b/backtrader/engine/README.md new file mode 100644 index 000000000..f9865eb3e --- /dev/null +++ b/backtrader/engine/README.md @@ -0,0 +1,22 @@ +# engine + +Directory containing engine related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### runner.py + +Execution logic and orchestration of the main backtrader loop. + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtrader/engine/runner.py b/backtrader/engine/runner.py index 3a4d9e82c..8825e3312 100644 --- a/backtrader/engine/runner.py +++ b/backtrader/engine/runner.py @@ -1,7 +1,7 @@ # Copyright (c) 2025 backtrader contributors """ -Lógica de execução e orquestração do loop principal do backtrader. -Todas as funções e docstrings devem ser line-wrap ≤ 90 caracteres. +Execution logic and orchestration of the main backtrader loop. +All functions and docstrings should be line-wrapped ≤ 90 characters. """ import itertools @@ -15,15 +15,15 @@ def startrun(cerebro): """ - Inicia a execução das estratégias, incluindo otimização se necessário. - :param cerebro: Instância de Cerebro + Starts the execution of strategies, including optimization if necessary. + :param cerebro: Cerebro instance """ iterstrats = itertools.product(*cerebro.strats) dooptimize = getattr(cerebro, "_dooptimize", False) maxcpus = getattr(cerebro.p, "maxcpus", 1) predata = getattr(cerebro.p, "predata", False) if not dooptimize or maxcpus == 1: - # Se não for otimização ou só 1 núcleo, executa sequencial + # If not optimization or only 1 core, execute sequentially for iterstrat in iterstrats: runstrat = cerebro.runstrategies(iterstrat, predata=predata) cerebro.runstrats.append(runstrat) @@ -56,22 +56,22 @@ def startrun(cerebro): def finishrun(cerebro): """ - Finaliza a execução das estratégias, retornando os resultados. - :param cerebro: Instância de Cerebro + Finalizes the execution of strategies, returning the results. + :param cerebro: Cerebro instance """ dooptimize = getattr(cerebro, "_dooptimize", False) if not dooptimize: - # evitar lista de listas para casos regulares + # avoid list of lists for regular cases return cerebro.runstrats[0] return cerebro.runstrats def runstrategies(cerebro, iterstrat, predata=False): """ - Executa o loop principal das estratégias. - :param cerebro: Instância de Cerebro - :param iterstrat: Iterador de estratégias - :param predata: Flag de pré-carregamento + Executes the main loop of strategies. + :param cerebro: Cerebro instance + :param iterstrat: Strategy iterator + :param predata: Pre-loading flag """ cerebro._init_stcount() cerebro.runningstrats = runstrats = list() @@ -208,10 +208,10 @@ def runstrategies(cerebro, iterstrat, predata=False): def prerunstrategies(cerebro, iterstrat, predata=False): """ - Executa o pré-processamento das estratégias antes do loop principal. - :param cerebro: Instância de Cerebro - :param iterstrat: Iterador de estratégias - :param predata: Flag de pré-carregamento + Executes the pre-processing of strategies before the main loop. + :param cerebro: Cerebro instance + :param iterstrat: Strategy iterator + :param predata: Pre-loading flag """ cerebro._init_stcount() cerebro.runningstrats = runstrats = list() @@ -283,20 +283,20 @@ def prerunstrategies(cerebro, iterstrat, predata=False): def runstrategieskenel(cerebro): """ - Executa o kernel principal das estratégias (placeholder para extensões futuras). - :param cerebro: Instância de Cerebro + Executes the main kernel of strategies (placeholder for future extensions). + :param cerebro: Cerebro instance """ - # Placeholder: implementar lógica específica se necessário + # Placeholder: implement specific logic if needed pass def _runnext(cerebro, runstrats): """ - Executa o loop de execução "next" para as estratégias. - :param cerebro: Instância de Cerebro - :param runstrats: Lista de estratégias em execução + Executes the "next" execution loop for strategies. + :param cerebro: Cerebro instance + :param runstrats: List of running strategies """ - # Implementação extraída de cerebro.py + # Implementation extracted from cerebro.py for strat in runstrats: while not strat.stop(): strat.next() @@ -304,10 +304,10 @@ def _runnext(cerebro, runstrats): def _runonce(cerebro, runstrats): """ - Executa o loop de execução "runonce" para as estratégias. - :param cerebro: Instância de Cerebro - :param runstrats: Lista de estratégias em execução + Executes the "runonce" execution loop for strategies. + :param cerebro: Cerebro instance + :param runstrats: List of running strategies """ - # Implementação extraída de cerebro.py + # Implementation extracted from cerebro.py for strat in runstrats: strat.runonce() diff --git a/backtrader/feed.py b/backtrader/feed.py index 6f89a9d03..cf3f424bb 100644 --- a/backtrader/feed.py +++ b/backtrader/feed.py @@ -31,17 +31,13 @@ import io import os.path -import backtrader as bt -from backtrader import ( - TimeFrame, +from . import ( dataseries, - date2num, metabase, - num2date, - time2num, ) -from backtrader.utils import tzparse -from backtrader.utils.py3 import range, string_types, with_metaclass, zip +from .dataseries import TimeFrame +from .utils.date import tzparse, date2num, num2date, time2num, Localizer +from .utils.py3 import range, string_types, with_metaclass, zip from .dataseries import SimpleFilterWrapper from .resamplerfilter import Replayer, Resampler @@ -49,96 +45,50 @@ class MetaAbstractDataBase(dataseries.OHLCDateTime.__class__): - """ """ + """Metaclass for registering and initializing data feed subclasses.""" _indcol = dict() - def __init__(cls, name, bases, dct): - """Class has already been created ... register subclasses - - :param name: - :param bases: - :param dct: - - """ - # Initialize the class - super(MetaAbstractDataBase, cls).__init__(name, bases, dct) - - if not cls.aliased and name != "DataBase" and not name.startswith("_"): - cls._indcol[name] = cls + def __init__(self, name, bases, dct): + super().__init__(name, bases, dct) + if not getattr(self, 'aliased', False) and name != "DataBase" and not name.startswith("_"): + self._indcol[name] = self - def dopreinit(cls, _obj, *args, **kwargs): - """ - - :param _obj: - :param *args: - :param **kwargs: - - """ - _obj, args, kwargs = super(MetaAbstractDataBase, cls).dopreinit( - _obj, *args, **kwargs - ) - - # Find the owner and store it + def dopreinit(self, _obj, *args, **kwargs): + _obj, args, kwargs = super().dopreinit(_obj, *args, **kwargs) _obj._feed = metabase.findowner(_obj, FeedBase) - _obj.notifs = collections.deque() # store notifications for cerebro - _obj._dataname = _obj.p.dataname _obj._name = "" return _obj, args, kwargs - def dopostinit(cls, _obj, *args, **kwargs): - """ - - :param _obj: - :param *args: - :param **kwargs: - - """ - _obj, args, kwargs = super(MetaAbstractDataBase, cls).dopostinit( - _obj, *args, **kwargs - ) - - # Either set by subclass or the parameter or use the dataname (ticker) + def dopostinit(self, _obj, *args, **kwargs): + _obj, args, kwargs = super().dopostinit(_obj, *args, **kwargs) _obj._name = _obj._name or _obj.p.name if not _obj._name and isinstance(_obj.p.dataname, string_types): _obj._name = _obj.p.dataname _obj._compression = _obj.p.compression _obj._timeframe = _obj.p.timeframe - if isinstance(_obj.p.sessionstart, datetime.datetime): _obj.p.sessionstart = _obj.p.sessionstart.time() - elif _obj.p.sessionstart is None: _obj.p.sessionstart = datetime.time.min - if isinstance(_obj.p.sessionend, datetime.datetime): _obj.p.sessionend = _obj.p.sessionend.time() - elif _obj.p.sessionend is None: - # remove 9 to avoid precision rounding errors _obj.p.sessionend = datetime.time(23, 59, 59, 999990) - if isinstance(_obj.p.fromdate, datetime.date): - # push it to the end of the day, or else intraday - # values before the end of the day would be gone if not hasattr(_obj.p.fromdate, "hour"): _obj.p.fromdate = datetime.datetime.combine( _obj.p.fromdate, _obj.p.sessionstart ) - if isinstance(_obj.p.todate, datetime.date): - # push it to the end of the day, or else intraday - # values before the end of the day would be gone if not hasattr(_obj.p.todate, "hour"): _obj.p.todate = datetime.datetime.combine( _obj.p.todate, _obj.p.sessionend ) - _obj._barstack = collections.deque() # for filter operations _obj._barstash = collections.deque() # for filter operations - _obj._filters = list() _obj._ffilters = list() for fp in _obj.p.filters: @@ -146,9 +96,7 @@ def dopostinit(cls, _obj, *args, **kwargs): fp = fp(_obj) if hasattr(fp, "last"): _obj._ffilters.append((fp, [], {})) - _obj._filters.append((fp, [], {})) - return _obj, args, kwargs @@ -228,7 +176,7 @@ def _start_finish(self): self.lines.datetime._settz(self._tz) # This should probably be also called from an override-able method - self._tzinput = bt.utils.date.Localizer(self._gettzinput()) + self._tzinput = Localizer(self._gettzinput()) # Convert user input times to the output timezone (or min/max) if self.p.fromdate == "": @@ -961,7 +909,7 @@ def _getnextline(self): class CSVFeedBase(FeedBase): """ """ - params = (("basepath", ""),) + CSVDataBase.params._gettuple() + params = (("basepath", ""),) + tuple(getattr(CSVDataBase.params, '_gettuple', lambda: CSVDataBase.params)()) def _getdata(self, dataname, **kwargs): """ diff --git a/backtrader/feeds/README.md b/backtrader/feeds/README.md new file mode 100644 index 000000000..0bb39481f --- /dev/null +++ b/backtrader/feeds/README.md @@ -0,0 +1,94 @@ +# feeds + +Contains data feed implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### blaze.py + +Support for `Blaze `_ ``Data`` objects. + +### btcsv.py + +Parses a self-defined CSV Data used for testing. + +### chainer.py + + + +### csvgeneric.py + +Parses a CSV file according to the order and field presence defined by the + +### fakefeed.py + + + +### ibdata.py + + + +### influxfeed.py + + + +### mt4csv.py + +Parses a `Metatrader4 `_ History + +### oanda.py + + + +### pandafeed.py + +Uses a Pandas DataFrame as the feed source, iterating directly over the + +### quandl.py + +Parses pre-downloaded Quandl CSV Data Feeds (or locally generated if they + +### rollover.py + + + +### sierrachart.py + +Parses a `SierraChart `_ CSV exported file. + +### vcdata.py + + + +### vchart.py + +Support for `Visual Chart `_ binary on-disk files for + +### vchartcsv.py + +Parses a `VisualChart `_ CSV exported file. + +### vchartfile.py + + + +### yahoo.py + +Parses pre-downloaded Yahoo CSV Data Feeds (or locally generated if they + + +## Directory Summary + +This directory contains 19 files and 0 subdirectories. + +### File Types + +* .py: 19 files diff --git a/backtrader/filters/README.md b/backtrader/filters/README.md new file mode 100644 index 000000000..554fa7d33 --- /dev/null +++ b/backtrader/filters/README.md @@ -0,0 +1,54 @@ +# filters + +Contains data filtering implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### bsplitter.py + +Splits a daily bar in two parts simulating 2 ticks which will be used to + +### calendardays.py + +Bar Filler to add missing calendar days to trading days + +### datafiller.py + +This class will fill gaps in the source data using the following + +### datafilter.py + +This class filters out bars from a given data source. In addition to the + +### daysteps.py + +This filters splits a bar in two parts: + +### heikinashi.py + +The filter remodels the open, high, low, close to make HeikinAshi + +### renko.py + +Modify the data stream to draw Renko bars (or bricks) + +### session.py + +Bar Filler for a Data Source inside the declared session start/end times. + + +## Directory Summary + +This directory contains 9 files and 0 subdirectories. + +### File Types + +* .py: 9 files diff --git a/backtrader/indicators/README.md b/backtrader/indicators/README.md new file mode 100644 index 000000000..cf128bc04 --- /dev/null +++ b/backtrader/indicators/README.md @@ -0,0 +1,222 @@ +# indicators + +Contains technical indicator implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [contrib](contrib/README.md) - Contains contributed code + +## Files + +### __init__.py + +Python module + +### accdecoscillator.py + +Acceleration/Deceleration Technical Indicator (AC) measures acceleration + +### aroon.py + +Base class which does the calculation of the AroonUp/AroonDown values and + +### atr.py + +Defined by J. Welles Wilder, Jr. in 1978 in his book *"New Concepts in + +### awesomeoscillator.py + +Awesome Oscillator (AO) is a momentum indicator reflecting the precise + +### basicops.py + +Base class for indicators which take a period (__init__ has to be called + +### bollinger.py + +Defined by John Bollinger in the 80s. It measures volatility by defining + +### cci.py + +Introduced by Donald Lambert in 1980 to measure variations of the + +### crossover.py + +Keeps track of the difference between two data inputs skipping, memorizing + +### dema.py + +DEMA was first time introduced in 1994, in the article "Smoothing Data with + +### deviation.py + +Calculates the standard deviation of the passed data for a given period + +### directionalmove.py + +Defined by J. Welles Wilder, Jr. in 1978 in his book *"New Concepts in + +### dma.py + +By Nathan Dickson + +### dpo.py + +Defined by Joe DiNapoli in his book *"Trading with DiNapoli levels"* + +### dv2.py + +RSI(2) alternative + +### ema.py + +A Moving Average that smoothes data exponentially over time. + +### envelope.py + +MixIn class to create a subclass with another indicator. The main line of + +### hadelta.py + +Heikin Ashi Delta. Defined by Dan Valcu in his book "Heikin-Ashi: How to + +### heikinashi.py + +Heikin Ashi candlesticks in the forms of lines + +### hma.py + +By Alan Hull + +### hurst.py + +References: + +### ichimoku.py + +Developed and published in his book in 1969 by journalist Goichi Hosoda + +### kama.py + +Defined by Perry Kaufman in his book `"Smarter Trading"`. + +### kst.py + +It is a "summed" momentum indicator. Developed by Martin Pring and + +### lrsi.py + +Defined by John F. Ehlers in `Cybernetic Analysis for Stock and Futures`, + +### mabase.py + +MovingAverage (alias MovAv) + +### macd.py + +Moving Average Convergence Divergence. Defined by Gerald Appel in the 70s. + +### momentum.py + +Measures the change in price by calculating the difference between the + +### ols.py + +Calculates a linear regression using ``statsmodel.OLS`` (Ordinary least + +### oscillator.py + +MixIn class to create a subclass with another indicator. The main line of + +### percentchange.py + +Measures the perccentage change of the current value with respect to that + +### percentrank.py + +Measures the percent rank of the current value with respect to that of + +### pivotpoint.py + +Defines a level of significance by taking into account the average of price + +### prettygoodoscillator.py + +The "Pretty Good Oscillator" (PGO) by Mark Johnson measures the distance of + +### priceoscillator.py + + + +### psar.py + + + +### rmi.py + +Description: + +### rsi.py + +Defined by J. Welles Wilder, Jr. in 1978 in his book *"New Concepts in + +### sma.py + +Non-weighted average of the last n periods + +### smma.py + +Smoothing Moving Average used by Wilder in his 1978 book `New Concepts in + +### spread.py + +计算两个数据之间的价差并标注买卖信号点 [Contains Chinese characters that should be translated] + +### stochastic.py + + + +### trix.py + +Defined by Jack Hutson in the 80s and shows the Rate of Change (%) or slope + +### tsi.py + +The True Strength Indicators was first introduced in Stocks & Commodities + +### ultimateoscillator.py + +Formula: + +### vortex.py + +See: + +### williams.py + +Developed by Larry Williams to show the relation of closing prices to + +### wma.py + +A Moving Average which gives an arithmetic weighting to values with the + +### zlema.py + +The zero-lag exponential moving average (ZLEMA) is a variation of the EMA + +### zlind.py + +By John Ehlers and Ric Way + + +## Directory Summary + +This directory contains 50 files and 1 subdirectories. + +### File Types + +* .py: 50 files diff --git a/backtrader/indicators/contrib/README.md b/backtrader/indicators/contrib/README.md new file mode 100644 index 000000000..6e5c09787 --- /dev/null +++ b/backtrader/indicators/contrib/README.md @@ -0,0 +1,26 @@ +# contrib + +Contains contributed code. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (indicators)](../README.md) + +## Files + +### __init__.py + +Python module + +### vortex.py + +See: + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/indicators/contrib/vortex.py b/backtrader/indicators/contrib/vortex.py index e4e0cb455..24e12c51d 100644 --- a/backtrader/indicators/contrib/vortex.py +++ b/backtrader/indicators/contrib/vortex.py @@ -26,12 +26,13 @@ unicode_literals, ) -import backtrader as bt +from ...indicator import Indicator +from ..basicops import SumN, Max __all__ = ["Vortex"] -class Vortex(bt.Indicator): +class Vortex(Indicator): """See: - http://www.vortexindicator.com/VFX_VORTEX.PDF @@ -50,16 +51,16 @@ class Vortex(bt.Indicator): def __init__(self): """ """ h0l1 = abs(self.data.high(0) - self.data.low(-1)) - vm_plus = bt.ind.SumN(h0l1, period=self.p.period) + vm_plus = SumN(h0l1, period=self.p.period) l0h1 = abs(self.data.low(0) - self.data.high(-1)) - vm_minus = bt.ind.SumN(l0h1, period=self.p.period) + vm_minus = SumN(l0h1, period=self.p.period) h0c1 = abs(self.data.high(0) - self.data.close(-1)) l0c1 = abs(self.data.low(0) - self.data.close(-1)) h0l0 = abs(self.data.high(0) - self.data.low(0)) - tr = bt.ind.SumN(bt.Max(h0l0, h0c1, l0c1), period=self.p.period) + tr = SumN(Max(h0l0, h0c1, l0c1), period=self.p.period) self.l.vi_plus = vm_plus / tr self.l.vi_minus = vm_minus / tr diff --git a/backtrader/indicators/kama.py b/backtrader/indicators/kama.py index 3d1a141b7..1a67c5631 100644 --- a/backtrader/indicators/kama.py +++ b/backtrader/indicators/kama.py @@ -25,7 +25,8 @@ unicode_literals, ) -from . import ExponentialSmoothingDynamic, MovingAverageBase, SumN +from .basicops import SumN, ExponentialSmoothingDynamic +from .mabase import MovingAverageBase class AdaptiveMovingAverage(MovingAverageBase): @@ -72,8 +73,7 @@ class AdaptiveMovingAverage(MovingAverageBase): def __init__(self): """ """ - # Before super to ensure mixins (right-hand side in subclassing) - # can see the assignment operation and operate on the line + super(AdaptiveMovingAverage, self).__init__() direction = self.data - self.data(-self.p.period) volatility = SumN(abs(self.data - self.data(-1)), period=self.p.period) @@ -84,8 +84,6 @@ def __init__(self): sc = pow((er * (fast - slow)) + slow, 2) # scalable constant - self.lines[0] = ExponentialSmoothingDynamic( - self.data, period=self.p.period, alpha=sc - ) - - super(AdaptiveMovingAverage, self).__init__() + # ExponentialSmoothingDynamic does not accept dynamic alpha directly via constructor + # Therefore, the assignment below is only illustrative and may need adaptation + self.lines.kama = ExponentialSmoothingDynamic(self.data, period=self.p.period) diff --git a/backtrader/listeners/README.md b/backtrader/listeners/README.md new file mode 100644 index 000000000..822e1bfaa --- /dev/null +++ b/backtrader/listeners/README.md @@ -0,0 +1,26 @@ +# listeners + +Directory containing listeners related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### recorder.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/observers/README.md b/backtrader/observers/README.md new file mode 100644 index 000000000..e76f07dd6 --- /dev/null +++ b/backtrader/observers/README.md @@ -0,0 +1,50 @@ +# observers + +Contains observer implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### benchmark.py + +This observer stores the *returns* of the strategy and the *return* of a + +### broker.py + +This observer keeps track of the current amount of cash in the broker + +### buysell.py + +This observer keeps track of the individual buy/sell orders (individual + +### drawdown.py + +This observer keeps track of the current drawdown level (plotted) and + +### logreturns.py + +This observer stores the *log returns* of the strategy or a + +### timereturn.py + +This observer stores the *returns* of the strategy. + +### trades.py + +This observer keeps track of full trades and plot the PnL level achieved + + +## Directory Summary + +This directory contains 8 files and 0 subdirectories. + +### File Types + +* .py: 8 files diff --git a/backtrader/order.py b/backtrader/order.py index af8f9f850..9d6a2db74 100644 --- a/backtrader/order.py +++ b/backtrader/order.py @@ -31,7 +31,7 @@ from copy import copy from .metabase import MetaParams -from .utils import AutoOrderedDict +from .utils.autodict import AutoOrderedDict from .utils.py3 import iteritems, range, with_metaclass @@ -434,7 +434,7 @@ def __getattr__(self, name): # Return attr from params if not found in order return getattr(self.params, name) - def __setattribute__(self, name, value): + def __setattr__(self, name, value): """ :param name: @@ -444,7 +444,7 @@ def __setattribute__(self, name, value): if hasattr(self.params, name): setattr(self.params, name, value) else: - super(Order, self).__setattribute__(name, value) + super(OrderBase, self).__setattr__(name, value) def __str__(self): """ """ @@ -471,6 +471,8 @@ def __str__(self): def __init__(self): """ """ + self.exectype = None + self.valid = None self.ref = next(self.refbasis) self.broker = None self.info = AutoOrderedDict() diff --git a/backtrader/orders/README.md b/backtrader/orders/README.md new file mode 100644 index 000000000..9936af160 --- /dev/null +++ b/backtrader/orders/README.md @@ -0,0 +1,26 @@ +# orders + +Directory containing orders related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### iborder.py + +LimitOrder = ibstore_insync.LimitOrder + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/plot/README.md b/backtrader/plot/README.md new file mode 100644 index 000000000..7ac7a8b94 --- /dev/null +++ b/backtrader/plot/README.md @@ -0,0 +1,50 @@ +# plot + +Contains plotting functionality. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### finance.py + + + +### formatters.py + + + +### locator.py + +Redefine/Override matplotlib locators to make them work with index base x axis + +### multicursor.py + +Abstract base class for GUI neutral widgets + +### plot.py + + + +### scheme.py + + + +### utils.py + +Given the location and size of the box, return the path of + + +## Directory Summary + +This directory contains 8 files and 0 subdirectories. + +### File Types + +* .py: 8 files diff --git a/backtrader/signals/README.md b/backtrader/signals/README.md new file mode 100644 index 000000000..5bbcd0e5f --- /dev/null +++ b/backtrader/signals/README.md @@ -0,0 +1,22 @@ +# signals + +Directory containing signals related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtrader/sizers/README.md b/backtrader/sizers/README.md new file mode 100644 index 000000000..f817071e4 --- /dev/null +++ b/backtrader/sizers/README.md @@ -0,0 +1,30 @@ +# sizers + +Contains position sizing implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### fixedsize.py + +This sizer simply returns a fixed size for any operation. + +### percents_sizer.py + +This sizer return percents of available cash + + +## Directory Summary + +This directory contains 3 files and 0 subdirectories. + +### File Types + +* .py: 3 files diff --git a/backtrader/stores/README.md b/backtrader/stores/README.md new file mode 100644 index 000000000..1e1f5cc05 --- /dev/null +++ b/backtrader/stores/README.md @@ -0,0 +1,46 @@ +# stores + +Contains store implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [ibstores](ibstores/README.md) - Contains store implementations + +## Files + +### __init__.py + +Python module + +### ibstore.py + +:param tstamp: (Default value = None) + +### ibstore_insync.py + + + +### oandastore.py + + + +### vchartfile.py + +Store provider for Visual Chart binary files + +### vcstore.py + + + + +## Directory Summary + +This directory contains 6 files and 1 subdirectories. + +### File Types + +* .py: 6 files diff --git a/backtrader/stores/ibstores/README.md b/backtrader/stores/ibstores/README.md new file mode 100644 index 000000000..ce620cc83 --- /dev/null +++ b/backtrader/stores/ibstores/README.md @@ -0,0 +1,79 @@ +# ibstores + +Contains store implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (stores)](../README.md) + +## Files + +### __init__.py + +Python sync/async framework for Interactive Brokers API + +### client.py + +Socket client for communicating with Interactive Brokers. + +### connection.py + +Event-driven socket connection. + +### contract.py + +Financial instrument types used by Interactive Brokers. + +### decoder.py + +Deserialize and dispatch messages. + +### flexreport.py + +Access to account statement webservice. + +### ib.py + +High-level interface to Interactive Brokers. + +### ibcontroller.py + +Programmatic control over the TWS/gateway client software. + +### objects.py + +Object hierarchy. + +### order.py + +Order types used by Interactive Brokers. + +### py.typed + +Binary or data file + +### ticker.py + +Access to realtime market information. + +### util.py + +Utilities. + +### version.py + +Version info. + +### wrapper.py + +Wrapper to handle incoming messages. + + +## Directory Summary + +This directory contains 15 files and 0 subdirectories. + +### File Types + +* .py: 14 files +* .typed: 1 files diff --git a/backtrader/strategies/README.md b/backtrader/strategies/README.md new file mode 100644 index 000000000..1058151f9 --- /dev/null +++ b/backtrader/strategies/README.md @@ -0,0 +1,30 @@ +# strategies + +Contains trading strategy implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### nullstrategy.py + +Dummy strategy that does nothing. Really nothing. + +### sma_crossover.py + +This is a long-only strategy which operates on a moving average cross + + +## Directory Summary + +This directory contains 3 files and 0 subdirectories. + +### File Types + +* .py: 3 files diff --git a/backtrader/studies/README.md b/backtrader/studies/README.md new file mode 100644 index 000000000..439842dee --- /dev/null +++ b/backtrader/studies/README.md @@ -0,0 +1,26 @@ +# studies + +Directory containing studies related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [contrib](contrib/README.md) - Contains contributed code + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 1 subdirectories. + +### File Types + +* .py: 1 files diff --git a/backtrader/studies/contrib/README.md b/backtrader/studies/contrib/README.md new file mode 100644 index 000000000..b0cc078b2 --- /dev/null +++ b/backtrader/studies/contrib/README.md @@ -0,0 +1,26 @@ +# contrib + +Contains contributed code. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (studies)](../README.md) + +## Files + +### __init__.py + +Python module + +### fractal.py + +References: + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/backtrader/talib.py b/backtrader/talib.py index 942165bc6..296b9c970 100644 --- a/backtrader/talib.py +++ b/backtrader/talib.py @@ -27,8 +27,10 @@ import sys -import backtrader as bt -from backtrader.utils.py3 import with_metaclass +from .indicator import Indicator +from .metabase import findowner +from .cerebro import Cerebro +from .utils.py3 import with_metaclass # The modules below should/must define __all__ with the objects wishes # or prepend an "_" (underscore) to private classes/variables @@ -71,7 +73,7 @@ # Generate all indicators as subclasses - class _MetaTALibIndicator(bt.Indicator.__class__): + class _MetaTALibIndicator(Indicator.__class__): """ """ _refname = "_taindcol" @@ -79,6 +81,7 @@ class _MetaTALibIndicator(bt.Indicator.__class__): _KNOWN_UNSTABLE = ["SAR"] + @classmethod def dopostinit(cls, _obj, *args, **kwargs): """ @@ -88,7 +91,7 @@ def dopostinit(cls, _obj, *args, **kwargs): """ # Go to parent - res = super(_MetaTALibIndicator, cls).dopostinit(_obj, *args, **kwargs) + res = Indicator.__class__.dopostinit(cls, _obj, *args, **kwargs) _obj, args, kwargs = res # Get the minimum period by using the abstract interface and params @@ -101,12 +104,12 @@ def dopostinit(cls, _obj, *args, **kwargs): elif cls.__name__ in cls._KNOWN_UNSTABLE: _obj._lookback = 0 - bt.metabase.findowner(_obj, bt.Cerebro) + findowner(_obj, Cerebro) tafuncinfo = _obj._tabstract.info _obj._tafunc = getattr(talib, tafuncinfo["name"], None) return _obj, args, kwargs # return the object and args - class _TALibIndicator(with_metaclass(_MetaTALibIndicator, bt.Indicator)): + class _TALibIndicator(with_metaclass(_MetaTALibIndicator, Indicator)): """ """ CANDLEOVER = 1.02 # 2% over diff --git a/backtrader/utils/README.md b/backtrader/utils/README.md new file mode 100644 index 000000000..bf230f129 --- /dev/null +++ b/backtrader/utils/README.md @@ -0,0 +1,66 @@ +# utils + +Contains utility functions and helper code. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### autodict.py + + + +### calendar.py + +Utilities for calendar and timezone manipulation in backtrader. + +### date.py + +Python module + +### dateintern.py + +:param tz: + +### flushfile.py + + + +### iter.py + +Iteration utility functions for general use in the backtrader framework. + +### optreturn.py + +OptReturn utility class for encapsulating optimization results. + +### ordereddefaultdict.py + + + +### params.py + +Utility functions for initialization and manipulation of Params objects. + +### py3.py + +:param d: + +### timer.py + +Utilities for timer manipulation in backtrader. + + +## Directory Summary + +This directory contains 12 files and 0 subdirectories. + +### File Types + +* .py: 12 files diff --git a/backtrader/utils/calendar.py b/backtrader/utils/calendar.py index f5f8c717b..be8070aa5 100644 --- a/backtrader/utils/calendar.py +++ b/backtrader/utils/calendar.py @@ -1,7 +1,7 @@ # Copyright (c) 2025 backtrader contributors """ -Utilitários para manipulação de calendário e timezone no backtrader. -Todas as funções e docstrings devem ser line-wrap ≤ 90 caracteres. +Utilities for calendar and timezone manipulation in backtrader. +All functions and docstrings should be line-wrapped ≤ 90 characters. """ from ..tradingcal import PandasMarketCalendar, TradingCalendarBase @@ -10,11 +10,11 @@ def addcalendar(cal): """ - Instancia e retorna um calendário de negociação global a partir de diferentes - tipos de entrada (string, instância, classe, etc). + Instantiates and returns a global trading calendar from different + input types (string, instance, class, etc). - :param cal: String, instância ou classe de calendário - :return: Instância de calendário + :param cal: String, instance or calendar class + :return: Calendar instance """ if isinstance(cal, string_types): calobj = PandasMarketCalendar() @@ -28,16 +28,16 @@ def addcalendar(cal): try: if issubclass(cal, TradingCalendarBase): return cal() - except TypeError: # já é instância + except TypeError: # already an instance pass return cal def addtz(params, tz): """ - Define o timezone global nos parâmetros do sistema. + Sets the global timezone in system parameters. - :param params: Objeto de parâmetros + :param params: Parameters object :param tz: Timezone (None, string, int, pytz) """ params.tz = tz diff --git a/backtrader/utils/iter.py b/backtrader/utils/iter.py index a347ae568..17f92724e 100644 --- a/backtrader/utils/iter.py +++ b/backtrader/utils/iter.py @@ -1,7 +1,7 @@ # Copyright (c) 2025 backtrader contributors """ -Funções utilitárias de iteração para uso geral no framework backtrader. -Todas as funções e docstrings devem ser line-wrap ≤ 90 caracteres. +Iteration utility functions for general use in the backtrader framework. +All functions and docstrings should be line-wrapped ≤ 90 characters. """ from .py3 import string_types @@ -15,12 +15,12 @@ def iterize(iterable): """ - Transforma elementos em iteráveis, exceto strings, para facilitar loops - genéricos. Strings são encapsuladas em tuplas. Outros elementos não - iteráveis também são encapsulados em tuplas. + Transforms elements into iterables, except strings, to facilitate generic loops. + Strings are encapsulated in tuples. Other non-iterable elements are also + encapsulated in tuples. - :param iterable: Objeto iterável ou elemento único - :return: Lista de iteráveis + :param iterable: Iterable object or single element + :return: List of iterables """ niterable = list() for elem in iterable: diff --git a/backtrader/utils/optreturn.py b/backtrader/utils/optreturn.py index f2465e527..2fbb60774 100644 --- a/backtrader/utils/optreturn.py +++ b/backtrader/utils/optreturn.py @@ -1,16 +1,16 @@ # Copyright (c) 2025 backtrader contributors """ -Classe utilitária OptReturn para encapsular resultados de otimização. -Docstrings e comentários devem ser line-wrap ≤ 90 caracteres. +OptReturn utility class for encapsulating optimization results. +Docstrings and comments should be line-wrapped ≤ 90 characters. """ class OptReturn(object): """ - Container para resultados de otimização de estratégias. + Container for strategy optimization results. - :param params: Parâmetros da estratégia - :param **kwargs: Atributos adicionais a serem armazenados + :param params: Strategy parameters + :param **kwargs: Additional attributes to be stored """ def __init__(self, params, **kwargs): diff --git a/backtrader/utils/params.py b/backtrader/utils/params.py index 24924f705..2c4a18c7a 100644 --- a/backtrader/utils/params.py +++ b/backtrader/utils/params.py @@ -1,16 +1,16 @@ # Copyright (c) 2025 backtrader contributors """ -Funções utilitárias para inicialização e manipulação de objetos Params. -Docstrings e comentários devem ser line-wrap ≤ 90 caracteres. +Utility functions for initialization and manipulation of Params objects. +Docstrings and comments should be line-wrapped ≤ 90 characters. """ def make_params(params_tuple): """ - Cria dinamicamente uma classe Params a partir de um tuple de pares (nome, valor). + Dynamically creates a Params class from a tuple of (name, value) pairs. - :param params_tuple: Tupla de pares (nome, valor) de parâmetros - :return: Instância de Params com atributos correspondentes + :param params_tuple: Tuple of parameter (name, value) pairs + :return: Params instance with corresponding attributes """ param_dict = dict((k, v) for k, v in params_tuple) return type("Params", (), param_dict)() diff --git a/backtrader/utils/timer.py b/backtrader/utils/timer.py index 6d68d1e4c..17cbd48db 100644 --- a/backtrader/utils/timer.py +++ b/backtrader/utils/timer.py @@ -1,7 +1,7 @@ # Copyright (c) 2025 backtrader contributors """ -Utilitários para manipulação de timers no backtrader. -Todas as funções e docstrings devem ser line-wrap ≤ 90 caracteres. +Utilities for timer manipulation in backtrader. +All functions and docstrings should be line-wrapped ≤ 90 characters. """ import datetime @@ -26,24 +26,24 @@ def create_timer( **kwargs, ): """ - Cria e adiciona um timer à lista de timers pendentes. + Creates and adds a timer to the list of pending timers. - :param pretimers: Lista de timers pendentes - :param owner: Objeto dono do timer - :param when: Condição de disparo - :param offset: Offset do timer - :param repeat: Repetição - :param weekdays: Dias da semana - :param weekcarry: Carregar semana - :param monthdays: Dias do mês - :param monthcarry: Carregar mês - :param allow: Permissão + :param pretimers: List of pending timers + :param owner: Timer owner object + :param when: Trigger condition + :param offset: Timer offset + :param repeat: Repetition + :param weekdays: Days of the week + :param weekcarry: Week carry + :param monthdays: Days of the month + :param monthcarry: Month carry + :param allow: Permission :param tzdata: Timezone - :param strats: Estratégias + :param strats: Strategies :param cheat: Cheat flag - :param *args: Args adicionais - :param **kwargs: Kwargs adicionais - :return: Instância de Timer + :param *args: Additional args + :param **kwargs: Additional kwargs + :return: Timer instance """ if weekdays is None: weekdays = [] @@ -87,22 +87,22 @@ def schedule_timer( **kwargs, ): """ - Agenda um timer para o objeto cerebro. - :param cerebro: Instância de Cerebro - :param when: Condição de disparo - :param offset: Offset do timer - :param repeat: Repetição - :param weekdays: Dias da semana - :param weekcarry: Carregar semana - :param monthdays: Dias do mês - :param monthcarry: Carregar mês - :param allow: Permissão + Schedules a timer for the cerebro object. + :param cerebro: Cerebro instance + :param when: Trigger condition + :param offset: Timer offset + :param repeat: Repetition + :param weekdays: Days of the week + :param weekcarry: Week carry + :param monthdays: Days of the month + :param monthcarry: Month carry + :param allow: Permission :param tzdata: Timezone - :param strats: Estratégias + :param strats: Strategies :param cheat: Cheat flag - :param *args: Args adicionais - :param **kwargs: Kwargs adicionais - :return: Instância de Timer + :param *args: Additional args + :param **kwargs: Additional kwargs + :return: Timer instance """ return create_timer( cerebro._pretimers, @@ -125,10 +125,10 @@ def schedule_timer( def notify_timer(timer, when, *args, **kwargs): """ - Notificação de timer (stub para interface futura). - :param timer: Instância de Timer - :param when: Momento do timer - :param *args: Args adicionais - :param **kwargs: Kwargs adicionais + Timer notification (stub for future interface). + :param timer: Timer instance + :param when: Timer moment + :param *args: Additional args + :param **kwargs: Additional kwargs """ pass diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 000000000..1e233bd26 --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,18 @@ +# contrib + +Contains contributed code. Contains various files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [datas](datas/README.md) - Contains data files +* [samples](samples/README.md) - Contains sample code and examples +* [utils](utils/README.md) - Contains utility functions and helper code + +## Directory Summary + +This directory contains 0 files and 3 subdirectories. + diff --git a/contrib/datas/README.md b/contrib/datas/README.md new file mode 100644 index 000000000..ecf1caf27 --- /dev/null +++ b/contrib/datas/README.md @@ -0,0 +1,26 @@ +# datas + +Contains data files. Primarily contains .csv files code. + +## Navigation + +* [↑ Parent Directory (contrib)](../README.md) + +## Files + +### daily-KO.csv + +Binary or data file + +### daily-PEP.csv + +Binary or data file + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .csv: 2 files diff --git a/contrib/samples/README.md b/contrib/samples/README.md new file mode 100644 index 000000000..08d805f50 --- /dev/null +++ b/contrib/samples/README.md @@ -0,0 +1,16 @@ +# samples + +Contains sample code and examples. Contains various files. + +## Navigation + +* [↑ Parent Directory (contrib)](../README.md) + +### Subdirectories + +* [pair-trading](pair-trading/README.md) - Directory containing pair-trading related files + +## Directory Summary + +This directory contains 0 files and 1 subdirectories. + diff --git a/contrib/samples/pair-trading/README.md b/contrib/samples/pair-trading/README.md new file mode 100644 index 000000000..156c31a41 --- /dev/null +++ b/contrib/samples/pair-trading/README.md @@ -0,0 +1,22 @@ +# pair-trading + +Directory containing pair-trading related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### pair-trading.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/contrib/utils/README.md b/contrib/utils/README.md new file mode 100644 index 000000000..b776bdf92 --- /dev/null +++ b/contrib/utils/README.md @@ -0,0 +1,26 @@ +# utils + +Contains utility functions and helper code. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (contrib)](../README.md) + +## Files + +### influxdb-import.py + + + +### iqfeed-to-influxdb.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/datas/README.md b/datas/README.md new file mode 100644 index 000000000..a178a945a --- /dev/null +++ b/datas/README.md @@ -0,0 +1,115 @@ +# datas + +Contains data files. Primarily contains Documentation code and includes documentation. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### 2005-2006-day-001.txt + +Documentation file + +### 2006-01-02-volume-min-001.txt + +Large file (1.8 MB) + +### 2006-day-001-optix.txt + +Documentation file + +### 2006-day-001.txt + +Documentation file + +### 2006-day-002.txt + +Documentation file + +### 2006-min-005.txt + +Documentation file + +### 2006-month-001.txt + +Documentation file + +### 2006-volume-day-001.txt + +Documentation file + +### 2006-week-001.txt + +Documentation file + +### 2006-week-002.txt + +Documentation file + +### bbroker_try_exec_limit.txt + +Documentation file + +### bidask.csv + +Binary or data file + +### bidask2.csv + +Binary or data file + +### nvda-1999-2014.txt + +Documentation file + +### nvda-2014.txt + +Documentation file + +### orcl-1995-2014.txt + +Documentation file + +### orcl-2003-2005.txt + +Documentation file + +### orcl-2014.txt + +Documentation file + +### ticksample.csv + +Binary or data file + +### ticksample_more.csv + +Binary or data file + +### yhoo-1996-2014.txt + +Documentation file + +### yhoo-1996-2015.txt + +Documentation file + +### yhoo-2003-2005.txt + +Documentation file + +### yhoo-2014.txt + +Documentation file + + +## Directory Summary + +This directory contains 24 files and 0 subdirectories. + +### File Types + +* .txt: 20 files +* .csv: 4 files diff --git a/logs/README.md b/logs/README.md new file mode 100644 index 000000000..6ebc62282 --- /dev/null +++ b/logs/README.md @@ -0,0 +1,26 @@ +# logs + +Contains log files. Primarily contains .csv files code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### SPY.csv + +Binary or data file + +### TSLA.csv + +Binary or data file + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .csv: 2 files diff --git a/outcome/README.md b/outcome/README.md new file mode 100644 index 000000000..59fc569aa --- /dev/null +++ b/outcome/README.md @@ -0,0 +1,51 @@ +# outcome + +Directory containing outcome related files. Primarily contains .csv files code and includes test files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### CUSUM_backtest_JJM_win20_k0.6_h3.0_20250425_141758.csv + +Binary or data file + +### CUSUM_backtest_LMA_win20_k0.6_h3.0_20250425_141820.csv + +Binary or data file + +### CUSUM_backtest_OIY_win20_k0.6_h3.0_20250425_141810.csv + +Binary or data file + +### CUSUM_backtest_OIY_win20_k0.6_h3.0_20250425_143516.csv + +Binary or data file + +### CUSUM_backtest_OIY_win20_k0.6_h5.0_20250425_143609.csv + +Binary or data file + +### CUSUM_backtest_PY_win20_k0.6_h3.0_20250425_141838.csv + +Binary or data file + +### combined_daily_returns_20250425_141840.csv + +Binary or data file + +### test.ipynb + +Binary or data file + + +## Directory Summary + +This directory contains 8 files and 0 subdirectories. + +### File Types + +* .csv: 7 files +* .ipynb: 1 files diff --git a/poetry.lock b/poetry.lock index a31cafd60..a19e6c012 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "ansicolor" @@ -6,6 +6,7 @@ version = "0.3.2" description = "A library to produce ansi color output and colored highlighting and diffing" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "ansicolor-0.3.2-py2.py3-none-any.whl", hash = "sha256:91e9fccea5cf596c39bc015d423ed2dd74c0104fd520a42d7acccb66cbfc39e9"}, {file = "ansicolor-0.3.2.tar.gz", hash = "sha256:3b840a6b1184b5f1568635b1adab28147947522707d41ceba02d5ed0a0877279"}, @@ -17,6 +18,7 @@ version = "2.4.1" description = "Annotate AST trees with source code positions" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "asttokens-2.4.1-py2.py3-none-any.whl", hash = "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24"}, {file = "asttokens-2.4.1.tar.gz", hash = "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0"}, @@ -26,8 +28,8 @@ files = [ six = ">=1.12.0" [package.extras] -astroid = ["astroid (>=1,<2)", "astroid (>=2,<4)"] -test = ["astroid (>=1,<2)", "astroid (>=2,<4)", "pytest"] +astroid = ["astroid (>=1,<2) ; python_version < \"3\"", "astroid (>=2,<4) ; python_version >= \"3\""] +test = ["astroid (>=1,<2) ; python_version < \"3\"", "astroid (>=2,<4) ; python_version >= \"3\"", "pytest"] [[package]] name = "beautifulsoup4" @@ -35,6 +37,7 @@ version = "4.12.3" description = "Screen-scraping library" optional = false python-versions = ">=3.6.0" +groups = ["main"] files = [ {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, @@ -50,12 +53,59 @@ charset-normalizer = ["charset-normalizer"] html5lib = ["html5lib"] lxml = ["lxml"] +[[package]] +name = "black" +version = "24.10.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"}, + {file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"}, + {file = "black-24.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:649fff99a20bd06c6f727d2a27f401331dc0cc861fb69cde910fe95b01b5928f"}, + {file = "black-24.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:fe4d6476887de70546212c99ac9bd803d90b42fc4767f058a0baa895013fbb3e"}, + {file = "black-24.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5a2221696a8224e335c28816a9d331a6c2ae15a2ee34ec857dcf3e45dbfa99ad"}, + {file = "black-24.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f9da3333530dbcecc1be13e69c250ed8dfa67f43c4005fb537bb426e19200d50"}, + {file = "black-24.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4007b1393d902b48b36958a216c20c4482f601569d19ed1df294a496eb366392"}, + {file = "black-24.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:394d4ddc64782e51153eadcaaca95144ac4c35e27ef9b0a42e121ae7e57a9175"}, + {file = "black-24.10.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b5e39e0fae001df40f95bd8cc36b9165c5e2ea88900167bddf258bacef9bbdc3"}, + {file = "black-24.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d37d422772111794b26757c5b55a3eade028aa3fde43121ab7b673d050949d65"}, + {file = "black-24.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:14b3502784f09ce2443830e3133dacf2c0110d45191ed470ecb04d0f5f6fcb0f"}, + {file = "black-24.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:30d2c30dc5139211dda799758559d1b049f7f14c580c409d6ad925b74a4208a8"}, + {file = "black-24.10.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cbacacb19e922a1d75ef2b6ccaefcd6e93a2c05ede32f06a21386a04cedb981"}, + {file = "black-24.10.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f93102e0c5bb3907451063e08b9876dbeac810e7da5a8bfb7aeb5a9ef89066b"}, + {file = "black-24.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ddacb691cdcdf77b96f549cf9591701d8db36b2f19519373d60d31746068dbf2"}, + {file = "black-24.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:680359d932801c76d2e9c9068d05c6b107f2584b2a5b88831c83962eb9984c1b"}, + {file = "black-24.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:17374989640fbca88b6a448129cd1745c5eb8d9547b464f281b251dd00155ccd"}, + {file = "black-24.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:63f626344343083322233f175aaf372d326de8436f5928c042639a4afbbf1d3f"}, + {file = "black-24.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfa1d0cb6200857f1923b602f978386a3a2758a65b52e0950299ea014be6800"}, + {file = "black-24.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:2cd9c95431d94adc56600710f8813ee27eea544dd118d45896bb734e9d7a0dc7"}, + {file = "black-24.10.0-py3-none-any.whl", hash = "sha256:3bb2b7a1f7b685f85b11fed1ef10f8a9148bceb49853e47a294a3dd963c1dd7d"}, + {file = "black-24.10.0.tar.gz", hash = "sha256:846ea64c97afe3bc677b761787993be4991810ecc7a4a937816dd6bddedc4875"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.10)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + [[package]] name = "certifi" version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -67,6 +117,7 @@ version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" +groups = ["main"] files = [ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, @@ -175,12 +226,29 @@ files = [ {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, ] +[[package]] +name = "click" +version = "8.1.8" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, + {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -192,6 +260,7 @@ version = "1.3.0" description = "Python library for calculating contours of 2D quadrilateral grids" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "contourpy-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:880ea32e5c774634f9fcd46504bf9f080a41ad855f4fef54f5380f5133d343c7"}, {file = "contourpy-1.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:76c905ef940a4474a6289c71d53122a4f77766eef23c03cd57016ce19d0f7b42"}, @@ -276,6 +345,7 @@ version = "0.12.1" description = "Composable style cycles" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "cycler-0.12.1-py3-none-any.whl", hash = "sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30"}, {file = "cycler-0.12.1.tar.gz", hash = "sha256:88bb128f02ba341da8ef447245a9e138fae777f6a23943da4540077d3601eb1c"}, @@ -291,13 +361,14 @@ version = "2.1.0" description = "Get the currently executing AST node of a frame, and other information" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "executing-2.1.0-py2.py3-none-any.whl", hash = "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf"}, {file = "executing-2.1.0.tar.gz", hash = "sha256:8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab"}, ] [package.extras] -tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] +tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich ; python_version >= \"3.11\""] [[package]] name = "fonttools" @@ -305,6 +376,7 @@ version = "4.54.1" description = "Tools to manipulate font files" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "fonttools-4.54.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7ed7ee041ff7b34cc62f07545e55e1468808691dddfd315d51dd82a6b37ddef2"}, {file = "fonttools-4.54.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41bb0b250c8132b2fcac148e2e9198e62ff06f3cc472065dff839327945c5882"}, @@ -357,18 +429,18 @@ files = [ ] [package.extras] -all = ["brotli (>=1.0.1)", "brotlicffi (>=0.8.0)", "fs (>=2.2.0,<3)", "lxml (>=4.0)", "lz4 (>=1.7.4.2)", "matplotlib", "munkres", "pycairo", "scipy", "skia-pathops (>=0.5.0)", "sympy", "uharfbuzz (>=0.23.0)", "unicodedata2 (>=15.1.0)", "xattr", "zopfli (>=0.1.4)"] +all = ["brotli (>=1.0.1) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\"", "fs (>=2.2.0,<3)", "lxml (>=4.0)", "lz4 (>=1.7.4.2)", "matplotlib", "munkres ; platform_python_implementation == \"PyPy\"", "pycairo", "scipy ; platform_python_implementation != \"PyPy\"", "skia-pathops (>=0.5.0)", "sympy", "uharfbuzz (>=0.23.0)", "unicodedata2 (>=15.1.0) ; python_version <= \"3.12\"", "xattr ; sys_platform == \"darwin\"", "zopfli (>=0.1.4)"] graphite = ["lz4 (>=1.7.4.2)"] -interpolatable = ["munkres", "pycairo", "scipy"] +interpolatable = ["munkres ; platform_python_implementation == \"PyPy\"", "pycairo", "scipy ; platform_python_implementation != \"PyPy\""] lxml = ["lxml (>=4.0)"] pathops = ["skia-pathops (>=0.5.0)"] plot = ["matplotlib"] repacker = ["uharfbuzz (>=0.23.0)"] symfont = ["sympy"] -type1 = ["xattr"] +type1 = ["xattr ; sys_platform == \"darwin\""] ufo = ["fs (>=2.2.0,<3)"] -unicode = ["unicodedata2 (>=15.1.0)"] -woff = ["brotli (>=1.0.1)", "brotlicffi (>=0.8.0)", "zopfli (>=0.1.4)"] +unicode = ["unicodedata2 (>=15.1.0) ; python_version <= \"3.12\""] +woff = ["brotli (>=1.0.1) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\"", "zopfli (>=0.1.4)"] [[package]] name = "frozendict" @@ -376,6 +448,7 @@ version = "2.4.6" description = "A simple immutable dictionary" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "frozendict-2.4.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c3a05c0a50cab96b4bb0ea25aa752efbfceed5ccb24c007612bc63e51299336f"}, {file = "frozendict-2.4.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f5b94d5b07c00986f9e37a38dd83c13f5fe3bf3f1ccc8e88edea8fe15d6cd88c"}, @@ -424,6 +497,7 @@ version = "1.1" description = "HTML parser based on the WHATWG HTML specification" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["main"] files = [ {file = "html5lib-1.1-py2.py3-none-any.whl", hash = "sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d"}, {file = "html5lib-1.1.tar.gz", hash = "sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f"}, @@ -434,10 +508,10 @@ six = ">=1.9" webencodings = "*" [package.extras] -all = ["chardet (>=2.2)", "genshi", "lxml"] +all = ["chardet (>=2.2)", "genshi", "lxml ; platform_python_implementation == \"CPython\""] chardet = ["chardet (>=2.2)"] genshi = ["genshi"] -lxml = ["lxml"] +lxml = ["lxml ; platform_python_implementation == \"CPython\""] [[package]] name = "icecream" @@ -445,6 +519,7 @@ version = "2.1.3" description = "Never use print() to debug again; inspect variables, expressions, and program execution with a single, simple function call." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "icecream-2.1.3-py2.py3-none-any.whl", hash = "sha256:757aec31ad4488b949bc4f499d18e6e5973c40cc4d4fc607229e78cfaec94c34"}, {file = "icecream-2.1.3.tar.gz", hash = "sha256:0aa4a7c3374ec36153a1d08f81e3080e83d8ac1eefd97d2f4fe9544e8f9b49de"}, @@ -462,6 +537,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -470,12 +546,42 @@ files = [ [package.extras] all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] +[[package]] +name = "iniconfig" +version = "2.1.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, + {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, +] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + [[package]] name = "kiwisolver" version = "1.4.7" description = "A fast implementation of the Cassowary constraint solver" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "kiwisolver-1.4.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8a9c83f75223d5e48b0bc9cb1bf2776cf01563e00ade8775ffe13b0b6e1af3a6"}, {file = "kiwisolver-1.4.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:58370b1ffbd35407444d57057b57da5d6549d2d854fa30249771775c63b5fe17"}, @@ -599,6 +705,7 @@ version = "0.7.2" description = "Python logging made (stupidly) simple" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "loguru-0.7.2-py3-none-any.whl", hash = "sha256:003d71e3d3ed35f0f8984898359d65b79e5b21943f78af86aa5491210429b8eb"}, {file = "loguru-0.7.2.tar.gz", hash = "sha256:e671a53522515f34fd406340ee968cb9ecafbc4b36c679da03c18fd8d0bd51ac"}, @@ -609,7 +716,7 @@ colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} [package.extras] -dev = ["Sphinx (==7.2.5)", "colorama (==0.4.5)", "colorama (==0.4.6)", "exceptiongroup (==1.1.3)", "freezegun (==1.1.0)", "freezegun (==1.2.2)", "mypy (==v0.910)", "mypy (==v0.971)", "mypy (==v1.4.1)", "mypy (==v1.5.1)", "pre-commit (==3.4.0)", "pytest (==6.1.2)", "pytest (==7.4.0)", "pytest-cov (==2.12.1)", "pytest-cov (==4.1.0)", "pytest-mypy-plugins (==1.9.3)", "pytest-mypy-plugins (==3.0.0)", "sphinx-autobuild (==2021.3.14)", "sphinx-rtd-theme (==1.3.0)", "tox (==3.27.1)", "tox (==4.11.0)"] +dev = ["Sphinx (==7.2.5) ; python_version >= \"3.9\"", "colorama (==0.4.5) ; python_version < \"3.8\"", "colorama (==0.4.6) ; python_version >= \"3.8\"", "exceptiongroup (==1.1.3) ; python_version >= \"3.7\" and python_version < \"3.11\"", "freezegun (==1.1.0) ; python_version < \"3.8\"", "freezegun (==1.2.2) ; python_version >= \"3.8\"", "mypy (==v0.910) ; python_version < \"3.6\"", "mypy (==v0.971) ; python_version == \"3.6\"", "mypy (==v1.4.1) ; python_version == \"3.7\"", "mypy (==v1.5.1) ; python_version >= \"3.8\"", "pre-commit (==3.4.0) ; python_version >= \"3.8\"", "pytest (==6.1.2) ; python_version < \"3.8\"", "pytest (==7.4.0) ; python_version >= \"3.8\"", "pytest-cov (==2.12.1) ; python_version < \"3.8\"", "pytest-cov (==4.1.0) ; python_version >= \"3.8\"", "pytest-mypy-plugins (==1.9.3) ; python_version >= \"3.6\" and python_version < \"3.8\"", "pytest-mypy-plugins (==3.0.0) ; python_version >= \"3.8\"", "sphinx-autobuild (==2021.3.14) ; python_version >= \"3.9\"", "sphinx-rtd-theme (==1.3.0) ; python_version >= \"3.9\"", "tox (==3.27.1) ; python_version < \"3.8\"", "tox (==4.11.0) ; python_version >= \"3.8\""] [[package]] name = "lxml" @@ -617,6 +724,7 @@ version = "5.3.0" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "lxml-5.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:dd36439be765e2dde7660212b5275641edbc813e7b24668831a5c8ac91180656"}, {file = "lxml-5.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ae5fe5c4b525aa82b8076c1a59d642c17b6e8739ecf852522c6321852178119d"}, @@ -771,6 +879,7 @@ version = "3.9.2" description = "Python plotting package" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "matplotlib-3.9.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:9d78bbc0cbc891ad55b4f39a48c22182e9bdaea7fc0e5dbd364f49f729ca1bbb"}, {file = "matplotlib-3.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c375cc72229614632c87355366bdf2570c2dac01ac66b8ad048d2dabadf2d0d4"}, @@ -834,17 +943,86 @@ version = "0.0.11" description = "Non-blocking Python methods using decorators" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "multitasking-0.0.11-py3-none-any.whl", hash = "sha256:1e5b37a5f8fc1e6cfaafd1a82b6b1cc6d2ed20037d3b89c25a84f499bd7b3dd4"}, {file = "multitasking-0.0.11.tar.gz", hash = "sha256:4d6bc3cc65f9b2dca72fb5a787850a88dae8f620c2b36ae9b55248e51bcd6026"}, ] +[[package]] +name = "mypy" +version = "1.15.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, + {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, + {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, + {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, + {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, + {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, + {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, + {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, + {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, + {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, + {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, + {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, + {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, +] + +[package.dependencies] +mypy_extensions = ">=1.0.0" +typing_extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, +] + [[package]] name = "numpy" version = "2.1.3" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" +groups = ["main"] files = [ {file = "numpy-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c894b4305373b9c5576d7a12b473702afdf48ce5369c074ba304cc5ad8730dff"}, {file = "numpy-2.1.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b47fbb433d3260adcd51eb54f92a2ffbc90a4595f8970ee00e064c644ac788f5"}, @@ -909,6 +1087,7 @@ version = "24.1" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, @@ -920,6 +1099,7 @@ version = "2.2.3" description = "Powerful data structures for data analysis, time series, and statistics" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "pandas-2.2.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1948ddde24197a0f7add2bdc4ca83bf2b1ef84a1bc8ccffd95eda17fd836ecb5"}, {file = "pandas-2.2.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:381175499d3802cde0eabbaf6324cce0c4f5d52ca6f8c377c29ad442f50f6348"}, @@ -996,12 +1176,26 @@ sql-other = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-d test = ["hypothesis (>=6.46.1)", "pytest (>=7.3.2)", "pytest-xdist (>=2.2.0)"] xml = ["lxml (>=4.9.2)"] +[[package]] +name = "pathspec" +version = "0.12.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, +] + [[package]] name = "patsy" version = "0.5.6" description = "A Python package for describing statistical models and for building design matrices." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "patsy-0.5.6-py2.py3-none-any.whl", hash = "sha256:19056886fd8fa71863fa32f0eb090267f21fb74be00f19f5c70b2e9d76c883c6"}, {file = "patsy-0.5.6.tar.gz", hash = "sha256:95c6d47a7222535f84bff7f63d7303f2e297747a598db89cf5c67f0c0c7d2cdb"}, @@ -1020,6 +1214,7 @@ version = "3.17.7" description = "a little orm" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "peewee-3.17.7.tar.gz", hash = "sha256:6aefc700bd530fc6ac23fa19c9c5b47041751d92985b799169c8e318e97eabaa"}, ] @@ -1030,6 +1225,7 @@ version = "11.0.0" description = "Python Imaging Library (Fork)" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "pillow-11.0.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:6619654954dc4936fcff82db8eb6401d3159ec6be81e33c6000dfd76ae189947"}, {file = "pillow-11.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b3c5ac4bed7519088103d9450a1107f76308ecf91d6dabc8a33a2fcfb18d0fba"}, @@ -1113,7 +1309,7 @@ docs = ["furo", "olefile", "sphinx (>=8.1)", "sphinx-copybutton", "sphinx-inline fpx = ["olefile"] mic = ["olefile"] tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout"] -typing = ["typing-extensions"] +typing = ["typing-extensions ; python_version < \"3.10\""] xmp = ["defusedxml"] [[package]] @@ -1122,6 +1318,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -1132,12 +1329,30 @@ docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-a test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] type = ["mypy (>=1.11.2)"] +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + [[package]] name = "polars" version = "1.12.0" description = "Blazingly fast DataFrame library" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "polars-1.12.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:8f3c4e4e423c373dda07b4c8a7ff12aa02094b524767d0ca306b1eba67f2d99e"}, {file = "polars-1.12.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:aa6f9862f0cec6353243920d9b8d858c21ec8f25f91af203dea6ff91980e140d"}, @@ -1169,7 +1384,7 @@ pyarrow = ["pyarrow (>=7.0.0)"] pydantic = ["pydantic"] sqlalchemy = ["polars[pandas]", "sqlalchemy"] style = ["great-tables (>=0.8.0)"] -timezone = ["backports-zoneinfo", "tzdata"] +timezone = ["backports-zoneinfo ; python_version < \"3.9\"", "tzdata ; platform_system == \"Windows\""] xlsx2csv = ["xlsx2csv (>=0.8.0)"] xlsxwriter = ["xlsxwriter"] @@ -1179,6 +1394,7 @@ version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, @@ -1193,6 +1409,7 @@ version = "3.2.0" description = "pyparsing module - Classes and methods to define and execute parsing grammars" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "pyparsing-3.2.0-py3-none-any.whl", hash = "sha256:93d9577b88da0bbea8cc8334ee8b918ed014968fd2ec383e868fb8afb1ccef84"}, {file = "pyparsing-3.2.0.tar.gz", hash = "sha256:cbf74e27246d595d9a74b186b810f6fbb86726dbf3b9532efb343f6d7294fe9c"}, @@ -1201,12 +1418,35 @@ files = [ [package.extras] diagrams = ["jinja2", "railroad-diagrams"] +[[package]] +name = "pytest" +version = "8.3.5" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, + {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.5,<2" + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + [[package]] name = "python-dateutil" version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -1221,6 +1461,7 @@ version = "2024.2" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, @@ -1232,6 +1473,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -1253,6 +1495,7 @@ version = "1.14.1" description = "Fundamental algorithms for scientific computing in Python" optional = false python-versions = ">=3.10" +groups = ["main"] files = [ {file = "scipy-1.14.1-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:b28d2ca4add7ac16ae8bb6632a3c86e4b9e4d52d3e34267f6e1b0c1f8d87e389"}, {file = "scipy-1.14.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:d0d2821003174de06b69e58cef2316a6622b60ee613121199cb2852a873f8cf3"}, @@ -1295,7 +1538,7 @@ numpy = ">=1.23.5,<2.3" [package.extras] dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy (==1.10.0)", "pycodestyle", "pydevtool", "rich-click", "ruff (>=0.0.292)", "types-psutil", "typing_extensions"] doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.13.1)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0,<=7.3.7)", "sphinx-design (>=0.4.0)"] -test = ["Cython", "array-api-strict (>=2.0)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +test = ["Cython", "array-api-strict (>=2.0)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja ; sys_platform != \"emscripten\"", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] [[package]] name = "setuptools" @@ -1303,19 +1546,20 @@ version = "75.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd"}, {file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"}, ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] -core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.5.2) ; sys_platform != \"cygwin\""] +core = ["importlib-metadata (>=6) ; python_version < \"3.10\"", "importlib-resources (>=5.10.2) ; python_version < \"3.9\"", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.12.*)", "pytest-mypy"] [[package]] name = "six" @@ -1323,6 +1567,7 @@ version = "1.16.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] files = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, @@ -1334,6 +1579,7 @@ version = "2.6" description = "A modern CSS selector implementation for Beautiful Soup." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"}, {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, @@ -1345,6 +1591,7 @@ version = "0.14.4" description = "Statistical computations and models for Python" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "statsmodels-0.14.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7a62f1fc9086e4b7ee789a6f66b3c0fc82dd8de1edda1522d30901a0aa45e42b"}, {file = "statsmodels-0.14.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:46ac7ddefac0c9b7b607eed1d47d11e26fe92a1bc1f4d9af48aeed4e21e87981"}, @@ -1387,7 +1634,7 @@ scipy = ">=1.8,<1.9.2 || >1.9.2" [package.extras] build = ["cython (>=3.0.10)"] -develop = ["colorama", "cython (>=3.0.10)", "cython (>=3.0.10,<4)", "flake8", "isort", "joblib", "matplotlib (>=3)", "pytest (>=7.3.0,<8)", "pytest-cov", "pytest-randomly", "pytest-xdist", "pywinpty", "setuptools-scm[toml] (>=8.0,<9.0)"] +develop = ["colorama", "cython (>=3.0.10)", "cython (>=3.0.10,<4)", "flake8", "isort", "joblib", "matplotlib (>=3)", "pytest (>=7.3.0,<8)", "pytest-cov", "pytest-randomly", "pytest-xdist", "pywinpty ; os_name == \"nt\"", "setuptools-scm[toml] (>=8.0,<9.0)"] docs = ["ipykernel", "jupyter-client", "matplotlib", "nbconvert", "nbformat", "numpydoc", "pandas-datareader", "sphinx"] [[package]] @@ -1396,17 +1643,32 @@ version = "0.1.0" description = "TensorKit is a deep learning helper between Python and C++." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "tk-0.1.0-py3-none-any.whl", hash = "sha256:703a69ff0d5ba2bd2f7440582ad10160e4a6561595d33457dc6caa79b9bf4930"}, {file = "tk-0.1.0.tar.gz", hash = "sha256:60bc8923d5d35f67f5c6bd93d4f0c49d2048114ec077768f959aef36d4ed97f8"}, ] +[[package]] +name = "typing-extensions" +version = "4.13.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"dev\"" +files = [ + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, +] + [[package]] name = "tzdata" version = "2024.2" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" +groups = ["main"] files = [ {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, @@ -1418,13 +1680,14 @@ version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] @@ -1435,6 +1698,7 @@ version = "0.5.1" description = "Character encoding aliases for legacy web content" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"}, {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"}, @@ -1446,13 +1710,15 @@ version = "1.1.0" description = "A small Python utility to set file creation time on Windows" optional = false python-versions = ">=3.5" +groups = ["main"] +markers = "sys_platform == \"win32\"" files = [ {file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"}, {file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"}, ] [package.extras] -dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] +dev = ["black (>=19.3b0) ; python_version >= \"3.6\"", "pytest (>=4.6.2)"] [[package]] name = "yfinance" @@ -1460,6 +1726,7 @@ version = "0.2.48" description = "Download market data from Yahoo! Finance API" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "yfinance-0.2.48-py2.py3-none-any.whl", hash = "sha256:eda797145faa4536595eb629f869d3616e58ed7e71de36856b19f1abaef71a5b"}, {file = "yfinance-0.2.48.tar.gz", hash = "sha256:1434cd8bf22f345fa27ef1ed82bfdd291c1bb5b6fe3067118a94e256aa90c4eb"}, @@ -1482,7 +1749,10 @@ requests = ">=2.31" nospam = ["requests-cache (>=1.0)", "requests-ratelimiter (>=0.3.1)"] repair = ["scipy (>=1.6.3)"] +[extras] +dev = ["black", "isort", "mypy", "pytest"] + [metadata] -lock-version = "2.0" -python-versions = "^3.12" -content-hash = "1e3baa584fa2fcdef9e859d798db129cd83ebc41cfc268a2644a302ed1ac8510" +lock-version = "2.1" +python-versions = ">=3.12,<3.14" +content-hash = "ad532b76cb09124c1384978b05097f1ebd6621a60065bda9bd9aae4babaea8b9" diff --git a/prompts/README.md b/prompts/README.md new file mode 100644 index 000000000..769b4e8b6 --- /dev/null +++ b/prompts/README.md @@ -0,0 +1,26 @@ +# prompts + +Directory containing prompts related files. Primarily contains Documentation code and includes documentation. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### bb_upper_breakout.md + +Documentation file + +### multi_rsi_divergence.md + +Documentation file + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .md: 2 files diff --git a/pylint_head.txt b/pylint_head.txt new file mode 100644 index 000000000..671938138 --- /dev/null +++ b/pylint_head.txt @@ -0,0 +1,1000 @@ +************* Module backtrader.backtrader.stores.ibstore_insync +backtrader/stores/ibstore_insync.py:509:12: E0001: Parsing failed: 'unexpected indent (backtrader.backtrader.stores.ibstore_insync, line 509)' (syntax-error) +************* Module backtrader.backtrader.commissions.ibcommission +backtrader/commissions/ibcommission.py:76:5: E0001: Parsing failed: 'invalid syntax (backtrader.backtrader.commissions.ibcommission, line 76)' (syntax-error) +************* Module backtrader.backtrader.orders.iborder +backtrader/orders/iborder.py:125:1: E0001: Parsing failed: 'invalid syntax (backtrader.backtrader.orders.iborder, line 125)' (syntax-error) +************* Module backtrader.strategies +strategies/__init__.py:1:0: F0010: error while code parsing: Unable to load file strategies/__init__.py: +[Errno 2] No such file or directory: 'strategies/__init__.py' (parse-error) +************* Module backtrader.backtrader +backtrader/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/__init__.py:36:0: W0406: Module import itself (import-self) +************* Module backtrader.backtrader.version +backtrader/version.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.listener +backtrader/listener.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/listener.py:11:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/listener.py:11:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/listener.py:14:0: C0112: Empty class docstring (empty-docstring) +backtrader/listener.py:14:34: E1101: Module 'backtrader' has no 'MetaParams' member (no-member) +backtrader/listener.py:20:4: C0112: Empty method docstring (empty-docstring) +backtrader/listener.py:30:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.analyzer +backtrader/analyzer.py:46:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:59:8: W0212: Access to a protected member _children of a client class (protected-access) +backtrader/analyzer.py:59:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/analyzer.py:62:8: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:67:12: W0212: Access to a protected member _register_analyzer of a client class (protected-access) +backtrader/analyzer.py:76:28: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/analyzer.py:85:32: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/analyzer.py:105:11: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:106:12: W0212: Access to a protected member _register of a client class (protected-access) +backtrader/analyzer.py:106:12: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:194:12: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/analyzer.py:206:12: W0212: Access to a protected member _notify_cashvalue of a client class (protected-access) +backtrader/analyzer.py:220:12: W0212: Access to a protected member _notify_fund of a client class (protected-access) +backtrader/analyzer.py:231:12: W0212: Access to a protected member _notify_trade of a client class (protected-access) +backtrader/analyzer.py:242:12: W0212: Access to a protected member _notify_order of a client class (protected-access) +backtrader/analyzer.py:249:12: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/analyzer.py:256:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/analyzer.py:263:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/analyzer.py:270:12: W0212: Access to a protected member _stop of a client class (protected-access) +backtrader/analyzer.py:382:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/analyzer.py:353:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:407:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:425:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:425:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/analyzer.py:467:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzer.py:472:12: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/analyzer.py:483:12: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/analyzer.py:495:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/analyzer.py:502:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzer.py:459:8: W0201: Attribute 'timeframe' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:462:8: W0201: Attribute 'compression' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:466:8: W0201: Attribute 'dtcmp' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:516:12: W0201: Attribute 'dtcmp' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:466:20: W0201: Attribute 'dtkey' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:515:12: W0201: Attribute 'dtkey' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:515:24: W0201: Attribute 'dtkey1' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:516:24: W0201: Attribute 'dtcmp1' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.broker +backtrader/broker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/broker.py:33:0: C0112: Empty class docstring (empty-docstring) +backtrader/broker.py:36:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/broker.py:57:0: C0112: Empty class docstring (empty-docstring) +backtrader/broker.py:66:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/broker.py:69:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:75:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:79:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:106:11: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/broker.py:107:33: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/broker.py:111:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:111:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:169:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:187:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:202:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/broker.py:234:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:234:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:268:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:268:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:302:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.cerebro +backtrader/cerebro.py:867:0: C0301: Line too long (114/100) (line-too-long) +backtrader/cerebro.py:1:0: C0302: Too many lines in module (1016/1000) (too-many-lines) +backtrader/cerebro.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/cerebro.py:39:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:41:0: C0413: Import "from . import indicator, linebuffer, observers" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:42:0: C0413: Import "from .brokers.bbroker import BackBroker" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:43:0: C0413: Import "from .metabase import MetaParams" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:44:0: C0413: Import "from .strategy import SignalStrategy, Strategy" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:45:0: C0413: Import "from .timer import Timer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:46:0: C0413: Import "from .tradingcal import PandasMarketCalendar, TradingCalendarBase" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:50:0: C0413: Import "from .utils.date import date2num, num2date, tzparse" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:51:0: C0413: Import "from .utils.py3 import integer_types, map, range, string_types, with_metaclass, zip" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:59:0: C0413: Import "from .writer import WriterFile" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:60:0: C0413: Import "from .feeds.chainer import Chainer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:61:0: C0413: Import "from .feeds.rollover import RollOver" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:62:0: C0413: Import "from .utils.iter import iterize" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:63:0: C0413: Import "from .utils.optreturn import OptReturn" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:64:0: C0413: Import "from .utils.params import make_params" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:65:0: C0413: Import "from .utils.calendar import addcalendar, addtz" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:66:0: C0413: Import "from .utils.timer import create_timer, schedule_timer, notify_timer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:67:0: C0413: Import "from .engine.runner import startrun, finishrun, runstrategies, prerunstrategies, runstrategieskenel, _runnext, _runonce" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:76:0: C0413: Import "from .plot.plot import Plot_OldSync" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:81:0: C0112: Empty class docstring (empty-docstring) +backtrader/cerebro.py:81:0: R0902: Too many instance attributes (39/7) (too-many-instance-attributes) +backtrader/cerebro.py:126:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:127:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:128:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:130:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:131:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:132:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:133:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:134:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:135:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/cerebro.py:136:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:137:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:138:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:139:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:140:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:148:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:149:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:152:29: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:228:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/cerebro.py:228:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/cerebro.py:228:4: W1113: Keyword argument before variable positional arguments list in the definition of add_timer function (keyword-arg-before-vararg) +backtrader/cerebro.py:540:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/cerebro.py:542:8: W0212: Access to a protected member _id of a client class (protected-access) +backtrader/cerebro.py:546:25: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/cerebro.py:570:20: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/cerebro.py:591:20: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/cerebro.py:762:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/cerebro.py:762:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/cerebro.py:762:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/cerebro.py:762:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/cerebro.py:769:8: W0613: Unused argument 'width' (unused-argument) +backtrader/cerebro.py:770:8: W0613: Unused argument 'height' (unused-argument) +backtrader/cerebro.py:771:8: W0613: Unused argument 'dpi' (unused-argument) +backtrader/cerebro.py:772:8: W0613: Unused argument 'tight' (unused-argument) +backtrader/cerebro.py:881:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:890:16: W0212: Access to a protected member _getkeys of a client class (protected-access) +backtrader/cerebro.py:921:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:936:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:954:68: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/cerebro.py:881:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/cerebro.py:881:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/cerebro.py:969:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:972:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:975:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:978:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:981:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:1011:12: W0212: Access to a protected member _addnotification of a client class (protected-access) +backtrader/cerebro.py:1015:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:879:8: W0201: Attribute '_event_stop' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:882:8: W0201: Attribute '_event_stop' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:902:8: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:907:12: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:918:12: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:903:8: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:908:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:914:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:919:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:904:8: W0201: Attribute '_exactbars' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:921:8: W0201: Attribute 'runwriters' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:934:8: W0201: Attribute 'writers_csv' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:936:8: W0201: Attribute 'runstrats' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:991:8: W0201: Attribute 'stcount' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:81:0: R0904: Too many public methods (42/20) (too-many-public-methods) +backtrader/cerebro.py:31:0: W0611: Unused import multiprocessing (unused-import) +backtrader/cerebro.py:39:0: W0611: Unused backtrader imported as bt (unused-import) +backtrader/cerebro.py:41:0: W0611: Unused import observers (unused-import) +backtrader/cerebro.py:45:0: W0611: Unused Timer imported from timer (unused-import) +backtrader/cerebro.py:46:0: W0611: Unused PandasMarketCalendar imported from tradingcal (unused-import) +backtrader/cerebro.py:46:0: W0611: Unused TradingCalendarBase imported from tradingcal (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused date2num imported from utils.date (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused num2date imported from utils.date (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused tzparse imported from utils.date (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused integer_types imported from utils.py3 (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused range imported from utils.py3 (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused string_types imported from utils.py3 (unused-import) +backtrader/cerebro.py:63:0: W0611: Unused OptReturn imported from utils.optreturn (unused-import) +backtrader/cerebro.py:66:0: W0611: Unused create_timer imported from utils.timer (unused-import) +************* Module backtrader.backtrader.dataseries +backtrader/dataseries.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/dataseries.py:33:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/dataseries.py:32:0: E0611: No name 'AutoOrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:32:0: E0611: No name 'OrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:32:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:36:0: R0205: Class 'TimeFrame' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/dataseries.py:82:4: C0103: Method name "TFrame" doesn't conform to snake_case naming style (invalid-name) +backtrader/dataseries.py:91:4: C0103: Method name "TName" doesn't conform to snake_case naming style (invalid-name) +backtrader/dataseries.py:100:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:103:15: R1735: Consider using '{"plot": True, "plotind": True, "plotylimited": True, "plotid": None, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/dataseries.py:120:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:132:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:148:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:159:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:172:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:178:0: R0205: Class 'SimpleFilterWrapper' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/dataseries.py:178:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/dataseries.py:250:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/dataseries.py:277:15: R0124: Redundant comparison - o == o (comparison-with-itself) +backtrader/dataseries.py:303:21: C0117: Consider changing "not o == o" to "o != o" (unnecessary-negation) +backtrader/dataseries.py:303:25: R0124: Redundant comparison - o == o (comparison-with-itself) +backtrader/dataseries.py:297:8: W0201: Attribute 'close' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:296:8: W0201: Attribute 'low' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:295:8: W0201: Attribute 'high' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:304:12: W0201: Attribute 'open' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:300:8: W0201: Attribute 'openinterest' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:293:8: W0201: Attribute 'datetime' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.errors +backtrader/errors.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/errors.py:54:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/errors.py:66:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +backtrader/errors.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +************* Module backtrader.backtrader.feed +backtrader/feed.py:912:0: C0301: Line too long (112/100) (line-too-long) +backtrader/feed.py:995:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/feed.py:1:0: C0302: Too many lines in module (1015/1000) (too-many-lines) +backtrader/feed.py:192:9: W0511: FIXME: These two are never used and could be removed (fixme) +backtrader/feed.py:961:9: W0511: FIXME: if removed from guest, remove here too (fixme) +backtrader/feed.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feed.py:40:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/feed.py:40:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/feed.py:50:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feed.py:52:4: C0203: Metaclass method __init__ should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:57:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/feed.py:57:4: C0203: Metaclass method dopreinit should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:58:29: E1101: Super of 'MetaAbstractDataBase' has no 'dopreinit' member (no-member) +backtrader/feed.py:59:8: W0212: Access to a protected member _feed of a client class (protected-access) +backtrader/feed.py:61:8: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/feed.py:62:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:65:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/feed.py:65:4: C0203: Metaclass method dopostinit should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:66:29: E1101: Super of 'MetaAbstractDataBase' has no 'dopostinit' member (no-member) +backtrader/feed.py:67:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:67:21: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:68:15: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:69:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:70:8: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/feed.py:71:8: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/feed.py:90:8: W0212: Access to a protected member _barstack of a client class (protected-access) +backtrader/feed.py:91:8: W0212: Access to a protected member _barstash of a client class (protected-access) +backtrader/feed.py:92:8: W0212: Access to a protected member _filters of a client class (protected-access) +backtrader/feed.py:92:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:93:8: W0212: Access to a protected member _ffilters of a client class (protected-access) +backtrader/feed.py:93:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:98:20: W0212: Access to a protected member _ffilters of a client class (protected-access) +backtrader/feed.py:99:12: W0212: Access to a protected member _filters of a client class (protected-access) +backtrader/feed.py:103:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:103:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +backtrader/feed.py:176:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/feed.py:176:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:198:29: W0212: Access to a protected member _tradingcal of a client class (protected-access) +backtrader/feed.py:200:29: E1123: Unexpected keyword argument 'calendar' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:218:19: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/feed.py:220:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/feed.py:223:13: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:272:28: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:276:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:314:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:319:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:328:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:341:12: E1101: Instance of 'str' has no 'qbuffer' member (no-member) +backtrader/feed.py:343:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:355:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:364:15: E1123: Unexpected keyword argument 'dataname' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:373:12: E1123: Unexpected keyword argument 'dataname' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:374:8: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/feed.py:375:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:386:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:456:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:459:19: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:476:8: E1101: Instance of 'tuple' has no 'advance' member (no-member) +backtrader/feed.py:482:16: E1101: Instance of 'tuple' has no 'forward' member (no-member) +backtrader/feed.py:485:15: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:486:16: E1101: Instance of 'tuple' has no 'rewind' member (no-member) +backtrader/feed.py:524:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/feed.py:524:15: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:539:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:582:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:606:17: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:617:16: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:582:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/feed.py:634:24: W0612: Unused variable 'i' (unused-variable) +backtrader/feed.py:656:25: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:678:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:687:25: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:174:8: W0201: Attribute '_tz' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:179:8: W0201: Attribute '_tzinput' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:183:12: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:185:12: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:188:12: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:190:12: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:193:8: W0201: Attribute 'sessionstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:194:8: W0201: Attribute 'sessionend' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:196:8: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:198:12: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:200:12: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:312:12: W0201: Attribute '_laststatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:347:8: W0201: Attribute '_laststatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:345:8: W0201: Attribute '_barstack' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:346:8: W0201: Attribute '_barstash' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:384:8: W0201: Attribute '_env' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:439:8: W0201: Attribute 'tick_last' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:454:12: W0201: Attribute 'tick_last' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:103:0: R0904: Too many public methods (25/20) (too-many-public-methods) +backtrader/feed.py:743:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:747:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:750:18: W0212: Access to a protected member _gettuple of a client class (protected-access) +backtrader/feed.py:750:18: E1101: Instance of 'tuple' has no '_gettuple' member (no-member) +backtrader/feed.py:754:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:756:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:761:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:774:29: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/feed.py:774:29: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:775:45: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:780:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:774:19: W0612: Unused variable 'pvalue' (unused-variable) +backtrader/feed.py:792:29: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/feed.py:792:29: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:793:45: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:796:15: E1101: Instance of 'FeedBase' has no 'DataCls' member (no-member) +backtrader/feed.py:792:19: W0612: Unused variable 'pvalue' (unused-variable) +backtrader/feed.py:799:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:811:35: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:814:29: E1101: Super of 'MetaCSVDataBase' has no 'dopostinit' member (no-member) +backtrader/feed.py:843:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:845:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:852:25: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +backtrader/feed.py:852:25: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/feed.py:859:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:861:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:866:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:857:8: W0201: Attribute 'separator' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:909:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:921:15: E1101: Instance of 'CSVFeedBase' has no 'DataCls' member (no-member) +backtrader/feed.py:921:37: E1101: Instance of 'CSVFeedBase' has no 'p' member (no-member) +backtrader/feed.py:921:67: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/feed.py:921:67: E1101: Instance of 'CSVFeedBase' has no 'p' member (no-member) +backtrader/feed.py:924:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:924:0: R0902: Too many instance attributes (12/7) (too-many-instance-attributes) +backtrader/feed.py:929:4: W0231: __init__ method from base class 'AbstractDataBase' is not called (super-init-not-called) +backtrader/feed.py:949:19: W0212: Access to a protected member _tz of a client class (protected-access) +backtrader/feed.py:950:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/feed.py:950:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:952:25: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/feed.py:965:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:967:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:971:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:974:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:1015:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:949:8: W0201: Attribute '_tz' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:952:8: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:955:8: W0201: Attribute '_tzinput' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:958:8: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:959:8: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:962:8: W0201: Attribute 'sessionstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:963:8: W0201: Attribute 'sessionend' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:968:8: W0201: Attribute '_dlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:969:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:973:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:976:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.fillers +backtrader/fillers.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/fillers.py:28:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/fillers.py:28:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/fillers.py:29:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/fillers.py:29:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/fillers.py:32:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/fillers.py:56:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/fillers.py:82:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.flt +backtrader/flt.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/flt.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/flt.py:38:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.functions +backtrader/functions.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/functions.py:32:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/functions.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:48:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:57:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:77:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:82:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:123:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:129:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:161:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:171:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:175:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:195:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:198:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/functions.py:198:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/functions.py:208:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:215:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:246:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:257:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:262:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:283:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:286:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:288:18: E1101: Instance of 'MultiLogic' has no 'flogic' member (no-member) +backtrader/functions.py:300:17: E1101: Instance of 'MultiLogic' has no 'flogic' member (no-member) +backtrader/functions.py:306:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:309:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:311:18: E1101: Instance of 'SingleLogic' has no 'flogic' member (no-member) +backtrader/functions.py:322:17: E1101: Instance of 'SingleLogic' has no 'flogic' member (no-member) +backtrader/functions.py:328:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:338:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:347:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:359:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:374:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:390:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:396:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:402:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:408:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:414:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:420:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:426:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:432:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:438:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:444:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.indicator +backtrader/indicator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicator.py:31:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/indicator.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:38:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:40:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:44:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicator.py:44:4: C0204: Metaclass class method cleancache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/indicator.py:46:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:49:4: C0204: Metaclass class method usecache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/indicator.py:109:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:135:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:154:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:172:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:183:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:196:20: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/indicator.py:199:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:200:39: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:201:24: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/indicator.py:204:29: E1101: Super of 'MtLinePlotterIndicator' has no 'donew' member (no-member) +backtrader/indicator.py:206:21: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/indicator.py:213:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.linebuffer +backtrader/linebuffer.py:1:0: C0302: Too many lines in module (1127/1000) (too-many-lines) +backtrader/linebuffer.py:47:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/linebuffer.py:46:0: E0611: No name 'num2date' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/linebuffer.py:46:0: E0611: No name 'time2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/linebuffer.py:52:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes) +backtrader/linebuffer.py:82:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/linebuffer.py:86:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:144:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:304:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:321:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:362:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:424:27: E1101: Instance of 'LineBuffer' has no '_owner' member (no-member) +backtrader/linebuffer.py:426:19: E1101: Instance of 'LineBuffer' has no '_owner' member (no-member) +backtrader/linebuffer.py:447:8: C0415: Import outside toplevel (lineiterator.LineCoupler) (import-outside-toplevel) +backtrader/linebuffer.py:463:15: E1123: Unexpected keyword argument '_ownerskip' in constructor call (unexpected-keyword-arg) +backtrader/linebuffer.py:472:15: E1123: Unexpected keyword argument '_ownerskip' in constructor call (unexpected-keyword-arg) +backtrader/linebuffer.py:557:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:572:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:587:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:602:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:617:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:106:24: E0203: Access to member '_idx' before its definition line 107 (access-member-before-definition) +backtrader/linebuffer.py:107:16: W0201: Attribute '_idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:109:12: W0201: Attribute '_idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:288:8: W0201: Attribute 'lencount' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:139:8: W0201: Attribute 'maxlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:165:8: W0201: Attribute 'maxlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:140:8: W0201: Attribute 'extrasize' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:141:8: W0201: Attribute 'lenmark' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:166:8: W0201: Attribute 'lenmark' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:52:0: R0904: Too many public methods (35/20) (too-many-public-methods) +backtrader/linebuffer.py:656:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/linebuffer.py:660:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:660:4: C0204: Metaclass class method cleancache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/linebuffer.py:662:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/linebuffer.py:665:4: C0204: Metaclass class method usecache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/linebuffer.py:703:29: E1101: Super of 'MetaLineActions' has no 'dopreinit' member (no-member) +backtrader/linebuffer.py:707:8: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/linebuffer.py:707:22: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/linebuffer.py:710:12: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/linebuffer.py:713:8: W0212: Access to a protected member _datas of a client class (protected-access) +backtrader/linebuffer.py:716:23: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/linebuffer.py:719:24: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/linebuffer.py:736:29: E1101: Super of 'MetaLineActions' has no 'dopostinit' member (no-member) +backtrader/linebuffer.py:741:8: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/linebuffer.py:746:0: C0112: Empty class docstring (empty-docstring) +backtrader/linebuffer.py:746:0: R0205: Class 'PseudoArray' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/linebuffer.py:766:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:783:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:787:4: W0221: Number of parameters was 3 in 'LineBuffer.qbuffer' and is now 2 in overriding 'LineActions.qbuffer' method (arguments-differ) +backtrader/linebuffer.py:793:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:794:20: E1101: Instance of 'LineActions' has no '_datas' member (no-member) +backtrader/linebuffer.py:814:24: E1101: Instance of 'LineActions' has no '_clock' member (no-member) +backtrader/linebuffer.py:828:26: E1101: Instance of 'LineActions' has no '_clock' member (no-member) +backtrader/linebuffer.py:838:0: C0103: Function name "LineDelay" doesn't conform to snake_case naming style (invalid-name) +backtrader/linebuffer.py:852:0: C0103: Function name "LineNum" doesn't conform to snake_case naming style (invalid-name) +backtrader/linebuffer.py:875:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:884:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:918:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:929:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:980:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:994:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:1105:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:1110:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.lineiterator +backtrader/lineiterator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/lineiterator.py:36:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineiterator.py:36:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/lineiterator.py:35:0: E0611: No name 'DotDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/lineiterator.py:39:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:53:8: W0212: Access to a protected member _lineiterators of a client class (protected-access) +backtrader/lineiterator.py:57:19: W0212: Access to a protected member _mindatas of a client class (protected-access) +backtrader/lineiterator.py:69:23: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/lineiterator.py:84:25: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:98:28: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineiterator.py:100:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:101:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:104:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:107:32: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineiterator.py:109:38: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:110:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:114:14: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/lineiterator.py:127:29: E1101: Super of 'MetaLineIterator' has no 'dopreinit' member (no-member) +backtrader/lineiterator.py:132:36: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:135:8: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/lineiterator.py:141:8: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:141:31: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:141:69: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:146:30: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:158:29: E1101: Super of 'MetaLineIterator' has no 'dopostinit' member (no-member) +backtrader/lineiterator.py:163:8: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:163:26: R1728: Consider using a generator instead 'max(x._minperiod for x in _obj.lines)' (consider-using-generator) +backtrader/lineiterator.py:163:31: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:166:8: W0212: Access to a protected member _periodrecalc of a client class (protected-access) +backtrader/lineiterator.py:170:11: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:171:12: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:176:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:184:15: R1735: Consider using '{"plot": True, "subplot": True, "plotname": '', "plotskip": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineiterator.py:210:22: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:216:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:219:12: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineiterator.py:223:16: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineiterator.py:227:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:230:12: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineiterator.py:234:16: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineiterator.py:236:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:240:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:248:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:259:28: W0212: Access to a protected member _ltype of a client class (protected-access) +backtrader/lineiterator.py:266:19: W0212: Access to a protected member _ltype of a client class (protected-access) +backtrader/lineiterator.py:267:20: W0212: Access to a protected member _disable_runonce of a client class (protected-access) +backtrader/lineiterator.py:270:20: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:284:35: E1101: Module 'collections' has no 'Iterable' member (no-member) +backtrader/lineiterator.py:292:33: E1101: Module 'collections' has no 'Iterable' member (no-member) +backtrader/lineiterator.py:319:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/lineiterator.py:355:12: W0212: Access to a protected member _once of a client class (protected-access) +backtrader/lineiterator.py:469:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:481:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:485:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:489:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:497:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:507:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:508:54: E1101: Instance of 'SingleCoupler' has no '_owner' member (no-member) +backtrader/lineiterator.py:514:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:523:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:530:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:535:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:547:0: C0103: Function name "LinesCoupler" doesn't conform to snake_case naming style (invalid-name) +backtrader/lineiterator.py:565:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:575:10: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/lineiterator.py:590:20: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:592:4: W0212: Access to a protected member _clock of a client class (protected-access) +************* Module backtrader.backtrader.lineroot +backtrader/lineroot.py:42:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineroot.py:64:8: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineroot.py:65:18: W0212: Access to a protected member _OwnerCls of a client class (protected-access) +backtrader/lineroot.py:258:59: W0613: Unused argument 'intify' (unused-argument) +backtrader/lineroot.py:353:38: E1101: Module 'operator' has no '__div__' member (no-member) +backtrader/lineroot.py:361:39: E1101: Module 'operator' has no '__div__' member (no-member) +backtrader/lineroot.py:481:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineroot.py:484:8: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:488:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineroot.py:489:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:490:12: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineroot.py:494:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineroot.py:495:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:496:12: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineroot.py:505:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:515:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:527:15: W0212: Access to a protected member _makeoperation of a client class (protected-access) +backtrader/lineroot.py:527:15: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:536:15: W0212: Access to a protected member _makeoperationown of a client class (protected-access) +backtrader/lineroot.py:536:15: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:544:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:553:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:557:0: W0223: Method '_makeoperation' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method '_makeoperationown' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method 'minbuffer' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method 'qbuffer' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +************* Module backtrader.backtrader.lineseries +backtrader/lineseries.py:44:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/lineseries.py:44:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineseries.py:47:0: R0205: Class 'LineAlias' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/lineseries.py:102:0: R0205: Class 'Lines' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/lineseries.py:120:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/lineseries.py:120:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/lineseries.py:142:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/lineseries.py:142:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/lineseries.py:142:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/lineseries.py:176:31: W0212: Access to a protected member _getlines of a client class (protected-access) +backtrader/lineseries.py:177:36: W0212: Access to a protected member _getlinesextra of a client class (protected-access) +backtrader/lineseries.py:210:44: W0212: Access to a protected member _getkwargsdefault of a client class (protected-access) +backtrader/lineseries.py:223:41: W0212: Access to a protected member _getlines of a client class (protected-access) +backtrader/lineseries.py:263:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:267:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:278:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/lineseries.py:280:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:279:12: W0612: Unused variable 'line' (unused-variable) +backtrader/lineseries.py:279:18: W0612: Unused variable 'linealias' (unused-variable) +backtrader/lineseries.py:294:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:298:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:302:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:422:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/lineseries.py:422:4: R0914: Too many local variables (27/15) (too-many-locals) +backtrader/lineseries.py:480:42: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:499:37: R1735: Consider using '{"plotname": aliasplotname}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:520:27: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/lineseries.py:524:29: E1101: Super of 'MetaLineSeries' has no 'donew' member (no-member) +backtrader/lineseries.py:541:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:541:41: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineseries.py:542:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:543:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:549:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineseries.py:552:15: R1735: Consider using '{"plot": True, "plotmaster": None, "legendloc": None}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:561:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:608:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:597:0: W0613: Unused argument 'args' (unused-argument) +backtrader/lineseries.py:597:0: W0613: Unused argument 'kwargs' (unused-argument) +backtrader/lineseries.py:610:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:612:16: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/lineseries.py:620:27: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/lineseries.py:625:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:630:15: W0212: Access to a protected member _getvalues of a client class (protected-access) +backtrader/lineseries.py:677:8: C0415: Import outside toplevel (lineiterator.LinesCoupler) (import-outside-toplevel) +backtrader/lineseries.py:728:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:732:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:767:4: W0231: __init__ method from base class 'LineSeries' is not called (super-init-not-called) +backtrader/lineseries.py:789:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:799:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:808:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:818:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:820:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:823:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:825:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:828:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:837:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:839:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:839:4: W0221: Number of parameters was 2 in 'LineMultiple.qbuffer' and is now 1 in overriding 'LineSeriesStub.qbuffer' method (arguments-differ) +backtrader/lineseries.py:842:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:851:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:854:0: C0103: Function name "LineSeriesMaker" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtrader.observer +backtrader/observer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observer.py:28:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/observer.py:28:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/observer.py:33:0: C0112: Empty class docstring (empty-docstring) +backtrader/observer.py:43:29: E1101: Super of 'MetaObserver' has no 'donew' member (no-member) +backtrader/observer.py:44:8: W0212: Access to a protected member _analyzers of a client class (protected-access) +backtrader/observer.py:44:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/observer.py:56:29: E1101: Super of 'MetaObserver' has no 'dopreinit' member (no-member) +backtrader/observer.py:58:11: W0212: Access to a protected member _stclock of a client class (protected-access) +backtrader/observer.py:59:12: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/observer.py:59:26: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/observer.py:64:0: C0112: Empty class docstring (empty-docstring) +backtrader/observer.py:74:15: R1735: Consider using '{"plot": False, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observer.py:78:4: C0112: Empty method docstring (empty-docstring) +backtrader/observer.py:94:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.order +backtrader/order.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/order.py:35:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/order.py:38:0: R0205: Class 'OrderExecutionBit' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/order.py:38:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes) +backtrader/order.py:65:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/order.py:65:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/order.py:38:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/order.py:116:0: R0205: Class 'OrderData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/order.py:116:0: R0902: Too many instance attributes (19/7) (too-many-instance-attributes) +backtrader/order.py:159:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/order.py:159:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/order.py:239:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/order.py:239:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/order.py:310:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:314:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:318:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:323:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:223:8: W0201: Attribute '_plimit' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:330:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:330:0: R0902: Too many instance attributes (18/7) (too-many-instance-attributes) +backtrader/order.py:447:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/order.py:451:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/order.py:452:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:453:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:454:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:455:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:456:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:457:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:458:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:459:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:460:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:461:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:462:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:463:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:464:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:465:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:466:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:467:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:468:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:472:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/order.py:564:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:590:4: C0103: Method name "ExecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/order.py:606:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:610:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:744:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/order.py:744:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/order.py:808:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/order.py:424:8: W0201: Attribute '_plimit' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:686:8: W0201: Attribute 'plen' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:330:0: R0904: Too many public methods (24/20) (too-many-public-methods) +backtrader/order.py:850:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/order.py:850:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/order.py:884:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/order.py:907:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:949:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:955:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:959:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:963:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:969:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:973:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.position +backtrader/position.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/position.py:29:0: R0205: Class 'Position' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/position.py:29:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/position.py:45:16: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/position.py:47:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:48:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:49:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:50:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:51:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:52:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:78:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:92:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:169:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:207:8: W0201: Attribute 'datetime' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.resamplerfilter +backtrader/resamplerfilter.py:245:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/resamplerfilter.py:478:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/resamplerfilter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/resamplerfilter.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:36:0: R0205: Class 'DTFaker' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/resamplerfilter.py:87:4: E0202: An attribute defined in backtrader.backtrader.resamplerfilter line 62 hides this method (method-hidden) +backtrader/resamplerfilter.py:87:23: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:95:19: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:103:19: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:114:15: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:144:15: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/resamplerfilter.py:178:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/resamplerfilter.py:147:0: R0902: Too many instance attributes (12/7) (too-many-instance-attributes) +backtrader/resamplerfilter.py:168:34: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:169:41: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:170:24: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:173:35: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:174:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:183:28: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:183:48: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:189:25: E1101: Instance of '_BaseResampler' has no 'replaying' member (no-member) +backtrader/resamplerfilter.py:190:45: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:191:49: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:195:4: C0112: Empty method docstring (empty-docstring) +backtrader/resamplerfilter.py:241:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/resamplerfilter.py:241:28: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:245:12: R1703: The if statement can be replaced with 'return bool(test)' (simplifiable-if-statement) +backtrader/resamplerfilter.py:245:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/resamplerfilter.py:245:37: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:259:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:261:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/resamplerfilter.py:253:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/resamplerfilter.py:283:45: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/resamplerfilter.py:280:4: R1711: Useless return at end of function or method (useless-return) +backtrader/resamplerfilter.py:338:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/resamplerfilter.py:338:11: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:347:19: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:384:11: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:387:15: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:394:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:420:19: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:423:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:427:38: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:428:44: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:451:15: E1102: self is not callable (not-callable) +backtrader/resamplerfilter.py:436:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/resamplerfilter.py:460:15: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:463:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:466:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:468:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:470:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:478:44: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:493:41: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:496:53: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:499:11: R1727: Boolean condition 'False and self.p.sessionend' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/resamplerfilter.py:499:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:453:4: R0911: Too many return statements (7/6) (too-many-return-statements) +backtrader/resamplerfilter.py:527:25: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:530:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:533:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:537:11: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:541:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:545:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:549:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:557:11: E0601: Using variable 'ph' before assignment (used-before-assignment) +backtrader/resamplerfilter.py:563:53: E0606: Possibly using variable 'ps' before assignment (possibly-used-before-assignment) +backtrader/resamplerfilter.py:563:74: E0606: Possibly using variable 'pus' before assignment (possibly-used-before-assignment) +backtrader/resamplerfilter.py:508:27: W0613: Unused argument 'greater' (unused-argument) +backtrader/resamplerfilter.py:570:41: W0613: Unused argument 'forcedata' (unused-argument) +backtrader/resamplerfilter.py:283:27: W0201: Attribute '_nextdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:320:12: W0201: Attribute '_nextdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:317:12: W0201: Attribute '_lasteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:318:12: W0201: Attribute '_lastdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:615:12: W0212: Access to a protected member _add2stack of a client class (protected-access) +backtrader/resamplerfilter.py:634:23: E1101: Instance of 'Resampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:673:25: E1101: Instance of 'Resampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:621:4: R0912: Too many branches (20/12) (too-many-branches) +backtrader/resamplerfilter.py:646:19: W0201: Attribute '_lastdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:735:23: E1101: Instance of 'Replayer' has no 'p' member (no-member) +backtrader/resamplerfilter.py:720:4: R0912: Too many branches (24/12) (too-many-branches) +backtrader/resamplerfilter.py:720:4: R0915: Too many statements (60/50) (too-many-statements) +backtrader/resamplerfilter.py:819:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:825:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:831:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:837:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:843:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:849:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:855:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:861:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:867:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:873:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:879:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:885:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:891:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.signal +backtrader/signal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/signal.py:65:0: C0112: Empty class docstring (empty-docstring) +backtrader/signal.py:65:13: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/signal.py:65:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.sizer +backtrader/sizer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/sizer.py:56:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +************* Module backtrader.backtrader.store +backtrader/store.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/store.py:30:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/store.py:30:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/store.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/store.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/store.py:37:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/store.py:48:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/store.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/store.py:75:15: E1102: self.DataCls is not callable (not-callable) +backtrader/store.py:76:8: W0212: Access to a protected member _store of a client class (protected-access) +backtrader/store.py:87:17: E1102: cls.BrokerCls is not callable (not-callable) +backtrader/store.py:88:8: W0212: Access to a protected member _store of a client class (protected-access) +backtrader/store.py:104:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/store.py:108:40: W0212: Access to a protected member _env of a client class (protected-access) +backtrader/store.py:118:4: C0112: Empty method docstring (empty-docstring) +backtrader/store.py:131:4: C0112: Empty method docstring (empty-docstring) +backtrader/store.py:134:15: R1721: Unnecessary use of a comprehension, use list(iter(self.notifs.popleft, None)) instead. (unnecessary-comprehension) +backtrader/store.py:103:12: W0201: Attribute 'notifs' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:104:12: W0201: Attribute 'datas' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:105:12: W0201: Attribute 'broker' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:116:12: W0201: Attribute 'broker' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:108:12: W0201: Attribute '_cerebro' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:108:28: W0201: Attribute '_env' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.strategy +backtrader/strategy.py:1:0: C0302: Too many lines in module (1982/1000) (too-many-lines) +backtrader/strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/strategy.py:42:0: W0622: Redefining built-in 'filter' (redefined-builtin) +backtrader/strategy.py:42:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/strategy.py:41:0: E0611: No name 'AutoDictList' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/strategy.py:41:0: E0611: No name 'AutoOrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/strategy.py:54:0: C0112: Empty class docstring (empty-docstring) +backtrader/strategy.py:57:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:59:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/strategy.py:99:29: E1101: Super of 'MetaStrategy' has no 'donew' member (no-member) +backtrader/strategy.py:102:60: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +backtrader/strategy.py:103:8: W0212: Access to a protected member _id of a client class (protected-access) +backtrader/strategy.py:103:19: W0212: Access to a protected member _next_stid of a client class (protected-access) +backtrader/strategy.py:115:29: E1101: Super of 'MetaStrategy' has no 'dopreinit' member (no-member) +backtrader/strategy.py:117:8: W0212: Access to a protected member _sizer of a client class (protected-access) +backtrader/strategy.py:117:22: E1101: Module 'backtrader' has no 'sizers' member (no-member) +backtrader/strategy.py:118:8: W0212: Access to a protected member _orders of a client class (protected-access) +backtrader/strategy.py:118:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:119:8: W0212: Access to a protected member _orderspending of a client class (protected-access) +backtrader/strategy.py:119:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:120:8: W0212: Access to a protected member _trades of a client class (protected-access) +backtrader/strategy.py:121:8: W0212: Access to a protected member _tradespending of a client class (protected-access) +backtrader/strategy.py:121:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:125:8: W0212: Access to a protected member _alnames of a client class (protected-access) +backtrader/strategy.py:126:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:128:8: W0212: Access to a protected member _slave_analyzers of a client class (protected-access) +backtrader/strategy.py:128:32: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:130:8: W0212: Access to a protected member _tradehistoryon of a client class (protected-access) +backtrader/strategy.py:142:29: E1101: Super of 'MetaStrategy' has no 'dopostinit' member (no-member) +backtrader/strategy.py:144:8: W0212: Access to a protected member _sizer of a client class (protected-access) +backtrader/strategy.py:149:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/strategy.py:192:16: E1101: Instance of 'str' has no 'qbuffer' member (no-member) +backtrader/strategy.py:209:30: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/strategy.py:220:35: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/strategy.py:235:37: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:237:27: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:253:52: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:257:22: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:338:37: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:352:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:355:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:359:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:379:19: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/strategy.py:389:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:408:22: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:416:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:433:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:449:28: W0212: Access to a protected member _analyzers of a client class (protected-access) +backtrader/strategy.py:451:20: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:453:20: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/strategy.py:455:20: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/strategy.py:471:16: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:441:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/strategy.py:482:16: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:484:16: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/strategy.py:486:16: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/strategy.py:473:44: W0613: Unused argument 'once' (unused-argument) +backtrader/strategy.py:494:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/strategy.py:494:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:501:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/strategy.py:508:16: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/strategy.py:522:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:529:18: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:533:19: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/strategy.py:540:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:542:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:545:19: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/strategy.py:550:50: E1101: Instance of 'tuple' has no 'itersize' member (no-member) +backtrader/strategy.py:552:37: E1101: Instance of 'tuple' has no 'size' member (no-member) +backtrader/strategy.py:556:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:560:27: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:572:39: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:582:34: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:592:12: W0212: Access to a protected member _stop of a client class (protected-access) +backtrader/strategy.py:608:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:611:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:612:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:614:4: W0221: Number of parameters was 3 in 'LineIterator._addnotification' and is now 3 in overriding 'Strategy._addnotification' method (arguments-differ) +backtrader/strategy.py:614:4: W0221: Variadics removed in overriding 'Strategy._addnotification' method (arguments-differ) +backtrader/strategy.py:633:20: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/strategy.py:614:4: R0912: Too many branches (19/12) (too-many-branches) +backtrader/strategy.py:704:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:704:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:725:16: W0212: Access to a protected member _notify_order of a client class (protected-access) +backtrader/strategy.py:730:16: W0212: Access to a protected member _notify_trade of a client class (protected-access) +backtrader/strategy.py:743:12: W0212: Access to a protected member _notify_cashvalue of a client class (protected-access) +backtrader/strategy.py:744:12: W0212: Access to a protected member _notify_fund of a client class (protected-access) +backtrader/strategy.py:746:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:746:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:746:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/strategy.py:746:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/strategy.py:746:4: W1113: Keyword argument before variable positional arguments list in the definition of add_timer function (keyword-arg-before-vararg) +backtrader/strategy.py:781:15: W0212: Access to a protected member _add_timer of a client class (protected-access) +backtrader/strategy.py:884:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/strategy.py:884:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/strategy.py:1072:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/strategy.py:1072:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/strategy.py:1160:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: R0913: Too many arguments (17/5) (too-many-arguments) +backtrader/strategy.py:1167:4: R0917: Too many positional arguments (17/5) (too-many-positional-arguments) +backtrader/strategy.py:1167:4: R0914: Too many local variables (22/15) (too-many-locals) +backtrader/strategy.py:1173:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1180:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1183:18: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1291:16: R1735: Consider using '{"size": size, "data": data, "price": price, "plimit": plimit, "exectype": exectype, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1309:20: R1735: Consider using '{"data": data, "price": stopprice, "exectype": stopexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1327:20: R1735: Consider using '{"data": data, "price": limitprice, "exectype": limitexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1345:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1345:4: W0102: Dangerous default value {} as argument (dangerous-default-value) diff --git a/pylint_report.txt b/pylint_report.txt new file mode 100644 index 000000000..9ce241f5e --- /dev/null +++ b/pylint_report.txt @@ -0,0 +1,36866 @@ +************* Module backtrader.backtrader.stores.ibstore_insync +backtrader/stores/ibstore_insync.py:509:12: E0001: Parsing failed: 'unexpected indent (backtrader.backtrader.stores.ibstore_insync, line 509)' (syntax-error) +************* Module backtrader.backtrader.commissions.ibcommission +backtrader/commissions/ibcommission.py:76:5: E0001: Parsing failed: 'invalid syntax (backtrader.backtrader.commissions.ibcommission, line 76)' (syntax-error) +************* Module backtrader.backtrader.orders.iborder +backtrader/orders/iborder.py:125:1: E0001: Parsing failed: 'invalid syntax (backtrader.backtrader.orders.iborder, line 125)' (syntax-error) +************* Module backtrader.strategies +strategies/__init__.py:1:0: F0010: error while code parsing: Unable to load file strategies/__init__.py: +[Errno 2] No such file or directory: 'strategies/__init__.py' (parse-error) +************* Module backtrader.backtrader +backtrader/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/__init__.py:36:0: W0406: Module import itself (import-self) +************* Module backtrader.backtrader.version +backtrader/version.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.listener +backtrader/listener.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/listener.py:11:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/listener.py:11:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/listener.py:14:0: C0112: Empty class docstring (empty-docstring) +backtrader/listener.py:14:34: E1101: Module 'backtrader' has no 'MetaParams' member (no-member) +backtrader/listener.py:20:4: C0112: Empty method docstring (empty-docstring) +backtrader/listener.py:30:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.analyzer +backtrader/analyzer.py:46:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:59:8: W0212: Access to a protected member _children of a client class (protected-access) +backtrader/analyzer.py:59:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/analyzer.py:62:8: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:67:12: W0212: Access to a protected member _register_analyzer of a client class (protected-access) +backtrader/analyzer.py:76:28: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/analyzer.py:85:32: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/analyzer.py:105:11: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:106:12: W0212: Access to a protected member _register of a client class (protected-access) +backtrader/analyzer.py:106:12: W0212: Access to a protected member _parent of a client class (protected-access) +backtrader/analyzer.py:194:12: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/analyzer.py:206:12: W0212: Access to a protected member _notify_cashvalue of a client class (protected-access) +backtrader/analyzer.py:220:12: W0212: Access to a protected member _notify_fund of a client class (protected-access) +backtrader/analyzer.py:231:12: W0212: Access to a protected member _notify_trade of a client class (protected-access) +backtrader/analyzer.py:242:12: W0212: Access to a protected member _notify_order of a client class (protected-access) +backtrader/analyzer.py:249:12: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/analyzer.py:256:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/analyzer.py:263:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/analyzer.py:270:12: W0212: Access to a protected member _stop of a client class (protected-access) +backtrader/analyzer.py:382:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/analyzer.py:353:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:407:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:425:0: C0112: Empty class docstring (empty-docstring) +backtrader/analyzer.py:425:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/analyzer.py:467:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzer.py:472:12: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/analyzer.py:483:12: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/analyzer.py:495:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/analyzer.py:502:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzer.py:459:8: W0201: Attribute 'timeframe' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:462:8: W0201: Attribute 'compression' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:466:8: W0201: Attribute 'dtcmp' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:516:12: W0201: Attribute 'dtcmp' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:466:20: W0201: Attribute 'dtkey' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:515:12: W0201: Attribute 'dtkey' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:515:24: W0201: Attribute 'dtkey1' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzer.py:516:24: W0201: Attribute 'dtcmp1' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.broker +backtrader/broker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/broker.py:33:0: C0112: Empty class docstring (empty-docstring) +backtrader/broker.py:36:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/broker.py:57:0: C0112: Empty class docstring (empty-docstring) +backtrader/broker.py:66:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/broker.py:69:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:75:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:79:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:106:11: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/broker.py:107:33: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/broker.py:111:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:111:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:169:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:187:4: C0112: Empty method docstring (empty-docstring) +backtrader/broker.py:202:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/broker.py:234:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:234:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:268:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/broker.py:268:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/broker.py:302:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.cerebro +backtrader/cerebro.py:867:0: C0301: Line too long (114/100) (line-too-long) +backtrader/cerebro.py:1:0: C0302: Too many lines in module (1016/1000) (too-many-lines) +backtrader/cerebro.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/cerebro.py:51:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/cerebro.py:39:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:41:0: C0413: Import "from . import indicator, linebuffer, observers" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:42:0: C0413: Import "from .brokers.bbroker import BackBroker" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:43:0: C0413: Import "from .metabase import MetaParams" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:44:0: C0413: Import "from .strategy import SignalStrategy, Strategy" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:45:0: C0413: Import "from .timer import Timer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:46:0: C0413: Import "from .tradingcal import PandasMarketCalendar, TradingCalendarBase" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:50:0: C0413: Import "from .utils.date import date2num, num2date, tzparse" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:51:0: C0413: Import "from .utils.py3 import integer_types, map, range, string_types, with_metaclass, zip" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:59:0: C0413: Import "from .writer import WriterFile" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:60:0: C0413: Import "from .feeds.chainer import Chainer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:61:0: C0413: Import "from .feeds.rollover import RollOver" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:62:0: C0413: Import "from .utils.iter import iterize" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:63:0: C0413: Import "from .utils.optreturn import OptReturn" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:64:0: C0413: Import "from .utils.params import make_params" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:65:0: C0413: Import "from .utils.calendar import addcalendar, addtz" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:66:0: C0413: Import "from .utils.timer import create_timer, schedule_timer, notify_timer" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:67:0: C0413: Import "from .engine.runner import startrun, finishrun, runstrategies, prerunstrategies, runstrategieskenel, _runnext, _runonce" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:76:0: C0413: Import "from .plot.plot import Plot_OldSync" should be placed at the top of the module (wrong-import-position) +backtrader/cerebro.py:81:0: C0112: Empty class docstring (empty-docstring) +backtrader/cerebro.py:81:0: R0902: Too many instance attributes (39/7) (too-many-instance-attributes) +backtrader/cerebro.py:126:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:127:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:128:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:130:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:131:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:132:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:133:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:134:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:135:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/cerebro.py:136:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:137:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:138:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:139:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:140:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:148:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:149:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:152:29: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:228:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/cerebro.py:228:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/cerebro.py:228:4: W1113: Keyword argument before variable positional arguments list in the definition of add_timer function (keyword-arg-before-vararg) +backtrader/cerebro.py:540:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/cerebro.py:542:8: W0212: Access to a protected member _id of a client class (protected-access) +backtrader/cerebro.py:546:25: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/cerebro.py:570:20: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/cerebro.py:591:20: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/cerebro.py:762:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/cerebro.py:762:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/cerebro.py:762:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/cerebro.py:762:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/cerebro.py:769:8: W0613: Unused argument 'width' (unused-argument) +backtrader/cerebro.py:770:8: W0613: Unused argument 'height' (unused-argument) +backtrader/cerebro.py:771:8: W0613: Unused argument 'dpi' (unused-argument) +backtrader/cerebro.py:772:8: W0613: Unused argument 'tight' (unused-argument) +backtrader/cerebro.py:881:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:890:16: W0212: Access to a protected member _getkeys of a client class (protected-access) +backtrader/cerebro.py:921:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:936:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/cerebro.py:954:68: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/cerebro.py:881:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/cerebro.py:881:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/cerebro.py:969:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:972:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:975:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:978:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:981:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:1011:12: W0212: Access to a protected member _addnotification of a client class (protected-access) +backtrader/cerebro.py:1015:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/cerebro.py:879:8: W0201: Attribute '_event_stop' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:882:8: W0201: Attribute '_event_stop' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:902:8: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:907:12: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:918:12: W0201: Attribute '_dorunonce' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:903:8: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:908:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:914:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:919:12: W0201: Attribute '_dopreload' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:904:8: W0201: Attribute '_exactbars' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:921:8: W0201: Attribute 'runwriters' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:934:8: W0201: Attribute 'writers_csv' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:936:8: W0201: Attribute 'runstrats' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:991:8: W0201: Attribute 'stcount' defined outside __init__ (attribute-defined-outside-init) +backtrader/cerebro.py:81:0: R0904: Too many public methods (42/20) (too-many-public-methods) +backtrader/cerebro.py:31:0: W0611: Unused import multiprocessing (unused-import) +backtrader/cerebro.py:39:0: W0611: Unused backtrader imported as bt (unused-import) +backtrader/cerebro.py:41:0: W0611: Unused import observers (unused-import) +backtrader/cerebro.py:45:0: W0611: Unused Timer imported from timer (unused-import) +backtrader/cerebro.py:46:0: W0611: Unused PandasMarketCalendar imported from tradingcal (unused-import) +backtrader/cerebro.py:46:0: W0611: Unused TradingCalendarBase imported from tradingcal (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused date2num imported from utils.date (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused num2date imported from utils.date (unused-import) +backtrader/cerebro.py:50:0: W0611: Unused tzparse imported from utils.date (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused integer_types imported from utils.py3 (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused range imported from utils.py3 (unused-import) +backtrader/cerebro.py:51:0: W0611: Unused string_types imported from utils.py3 (unused-import) +backtrader/cerebro.py:63:0: W0611: Unused OptReturn imported from utils.optreturn (unused-import) +backtrader/cerebro.py:66:0: W0611: Unused create_timer imported from utils.timer (unused-import) +************* Module backtrader.backtrader.dataseries +backtrader/dataseries.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/dataseries.py:33:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/dataseries.py:32:0: E0611: No name 'AutoOrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:32:0: E0611: No name 'OrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:32:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/dataseries.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:36:0: R0205: Class 'TimeFrame' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/dataseries.py:82:4: C0103: Method name "TFrame" doesn't conform to snake_case naming style (invalid-name) +backtrader/dataseries.py:91:4: C0103: Method name "TName" doesn't conform to snake_case naming style (invalid-name) +backtrader/dataseries.py:100:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:103:15: R1735: Consider using '{"plot": True, "plotind": True, "plotylimited": True, "plotid": None, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/dataseries.py:120:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:132:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:148:4: C0112: Empty method docstring (empty-docstring) +backtrader/dataseries.py:159:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:172:0: C0112: Empty class docstring (empty-docstring) +backtrader/dataseries.py:178:0: R0205: Class 'SimpleFilterWrapper' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/dataseries.py:178:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/dataseries.py:250:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/dataseries.py:277:15: R0124: Redundant comparison - o == o (comparison-with-itself) +backtrader/dataseries.py:303:21: C0117: Consider changing "not o == o" to "o != o" (unnecessary-negation) +backtrader/dataseries.py:303:25: R0124: Redundant comparison - o == o (comparison-with-itself) +backtrader/dataseries.py:297:8: W0201: Attribute 'close' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:296:8: W0201: Attribute 'low' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:295:8: W0201: Attribute 'high' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:304:12: W0201: Attribute 'open' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:300:8: W0201: Attribute 'openinterest' defined outside __init__ (attribute-defined-outside-init) +backtrader/dataseries.py:293:8: W0201: Attribute 'datetime' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.errors +backtrader/errors.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/errors.py:54:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/errors.py:66:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +backtrader/errors.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +************* Module backtrader.backtrader.feed +backtrader/feed.py:912:0: C0301: Line too long (112/100) (line-too-long) +backtrader/feed.py:995:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/feed.py:1:0: C0302: Too many lines in module (1015/1000) (too-many-lines) +backtrader/feed.py:192:9: W0511: FIXME: These two are never used and could be removed (fixme) +backtrader/feed.py:961:9: W0511: FIXME: if removed from guest, remove here too (fixme) +backtrader/feed.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feed.py:40:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/feed.py:40:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/feed.py:50:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feed.py:52:4: C0203: Metaclass method __init__ should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:57:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/feed.py:57:4: C0203: Metaclass method dopreinit should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:58:29: E1101: Super of 'MetaAbstractDataBase' has no 'dopreinit' member (no-member) +backtrader/feed.py:59:8: W0212: Access to a protected member _feed of a client class (protected-access) +backtrader/feed.py:61:8: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/feed.py:62:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:65:4: C0116: Missing function or method docstring (missing-function-docstring) +backtrader/feed.py:65:4: C0203: Metaclass method dopostinit should have 'cls' as first argument (bad-mcs-method-argument) +backtrader/feed.py:66:29: E1101: Super of 'MetaAbstractDataBase' has no 'dopostinit' member (no-member) +backtrader/feed.py:67:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:67:21: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:68:15: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:69:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:70:8: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/feed.py:71:8: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/feed.py:90:8: W0212: Access to a protected member _barstack of a client class (protected-access) +backtrader/feed.py:91:8: W0212: Access to a protected member _barstash of a client class (protected-access) +backtrader/feed.py:92:8: W0212: Access to a protected member _filters of a client class (protected-access) +backtrader/feed.py:92:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:93:8: W0212: Access to a protected member _ffilters of a client class (protected-access) +backtrader/feed.py:93:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:98:20: W0212: Access to a protected member _ffilters of a client class (protected-access) +backtrader/feed.py:99:12: W0212: Access to a protected member _filters of a client class (protected-access) +backtrader/feed.py:103:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:103:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +backtrader/feed.py:176:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/feed.py:176:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:198:29: W0212: Access to a protected member _tradingcal of a client class (protected-access) +backtrader/feed.py:200:29: E1123: Unexpected keyword argument 'calendar' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:218:19: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/feed.py:220:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/feed.py:223:13: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:272:28: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:276:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:314:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:319:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:328:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:341:12: E1101: Instance of 'str' has no 'qbuffer' member (no-member) +backtrader/feed.py:343:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:355:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:364:15: E1123: Unexpected keyword argument 'dataname' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:373:12: E1123: Unexpected keyword argument 'dataname' in constructor call (unexpected-keyword-arg) +backtrader/feed.py:374:8: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/feed.py:375:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:386:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:456:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:459:19: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:476:8: E1101: Instance of 'tuple' has no 'advance' member (no-member) +backtrader/feed.py:482:16: E1101: Instance of 'tuple' has no 'forward' member (no-member) +backtrader/feed.py:485:15: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:486:16: E1101: Instance of 'tuple' has no 'rewind' member (no-member) +backtrader/feed.py:524:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/feed.py:524:15: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:539:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:582:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:606:17: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:617:16: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:582:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/feed.py:634:24: W0612: Unused variable 'i' (unused-variable) +backtrader/feed.py:656:25: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:678:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:687:25: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feed.py:174:8: W0201: Attribute '_tz' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:179:8: W0201: Attribute '_tzinput' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:183:12: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:185:12: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:188:12: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:190:12: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:193:8: W0201: Attribute 'sessionstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:194:8: W0201: Attribute 'sessionend' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:196:8: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:198:12: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:200:12: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:312:12: W0201: Attribute '_laststatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:347:8: W0201: Attribute '_laststatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:345:8: W0201: Attribute '_barstack' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:346:8: W0201: Attribute '_barstash' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:384:8: W0201: Attribute '_env' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:439:8: W0201: Attribute 'tick_last' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:454:12: W0201: Attribute 'tick_last' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:103:0: R0904: Too many public methods (25/20) (too-many-public-methods) +backtrader/feed.py:743:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:747:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:750:18: W0212: Access to a protected member _gettuple of a client class (protected-access) +backtrader/feed.py:750:18: E1101: Instance of 'tuple' has no '_gettuple' member (no-member) +backtrader/feed.py:754:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/feed.py:756:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:761:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:774:29: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/feed.py:774:29: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:775:45: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:780:8: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:774:19: W0612: Unused variable 'pvalue' (unused-variable) +backtrader/feed.py:792:29: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/feed.py:792:29: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:793:45: E1101: Instance of 'FeedBase' has no 'p' member (no-member) +backtrader/feed.py:796:15: E1101: Instance of 'FeedBase' has no 'DataCls' member (no-member) +backtrader/feed.py:792:19: W0612: Unused variable 'pvalue' (unused-variable) +backtrader/feed.py:799:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:811:35: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/feed.py:814:29: E1101: Super of 'MetaCSVDataBase' has no 'dopostinit' member (no-member) +backtrader/feed.py:843:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:845:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:852:25: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +backtrader/feed.py:852:25: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/feed.py:859:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:861:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:866:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:857:8: W0201: Attribute 'separator' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:909:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:921:15: E1101: Instance of 'CSVFeedBase' has no 'DataCls' member (no-member) +backtrader/feed.py:921:37: E1101: Instance of 'CSVFeedBase' has no 'p' member (no-member) +backtrader/feed.py:921:67: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/feed.py:921:67: E1101: Instance of 'CSVFeedBase' has no 'p' member (no-member) +backtrader/feed.py:924:0: C0112: Empty class docstring (empty-docstring) +backtrader/feed.py:924:0: R0902: Too many instance attributes (12/7) (too-many-instance-attributes) +backtrader/feed.py:929:4: W0231: __init__ method from base class 'AbstractDataBase' is not called (super-init-not-called) +backtrader/feed.py:949:19: W0212: Access to a protected member _tz of a client class (protected-access) +backtrader/feed.py:950:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/feed.py:950:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feed.py:952:25: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/feed.py:965:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:967:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:971:4: C0112: Empty method docstring (empty-docstring) +backtrader/feed.py:974:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:1015:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feed.py:949:8: W0201: Attribute '_tz' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:952:8: W0201: Attribute '_calendar' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:955:8: W0201: Attribute '_tzinput' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:958:8: W0201: Attribute 'fromdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:959:8: W0201: Attribute 'todate' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:962:8: W0201: Attribute 'sessionstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:963:8: W0201: Attribute 'sessionend' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:968:8: W0201: Attribute '_dlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:969:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:973:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +backtrader/feed.py:976:8: W0201: Attribute '_preloading' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.fillers +backtrader/fillers.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/fillers.py:28:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/fillers.py:28:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/fillers.py:29:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/fillers.py:29:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/fillers.py:32:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/fillers.py:56:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/fillers.py:82:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.flt +backtrader/flt.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/flt.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/flt.py:38:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.functions +backtrader/functions.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/functions.py:32:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/functions.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:48:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:57:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:77:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:82:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:123:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:129:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:161:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:171:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:175:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:195:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:198:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/functions.py:198:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/functions.py:208:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:215:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:246:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:257:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:262:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:283:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:286:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:288:18: E1101: Instance of 'MultiLogic' has no 'flogic' member (no-member) +backtrader/functions.py:300:17: E1101: Instance of 'MultiLogic' has no 'flogic' member (no-member) +backtrader/functions.py:306:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:309:4: C0112: Empty method docstring (empty-docstring) +backtrader/functions.py:311:18: E1101: Instance of 'SingleLogic' has no 'flogic' member (no-member) +backtrader/functions.py:322:17: E1101: Instance of 'SingleLogic' has no 'flogic' member (no-member) +backtrader/functions.py:328:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:338:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:347:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:359:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/functions.py:374:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:390:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:396:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:402:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:408:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:414:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:420:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:426:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:432:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:438:0: C0112: Empty class docstring (empty-docstring) +backtrader/functions.py:444:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.indicator +backtrader/indicator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicator.py:31:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/indicator.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:38:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:40:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:44:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicator.py:44:4: C0204: Metaclass class method cleancache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/indicator.py:46:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:49:4: C0204: Metaclass class method usecache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/indicator.py:109:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:135:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:154:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:172:12: W0612: Unused variable 'i' (unused-variable) +backtrader/indicator.py:183:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicator.py:196:20: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/indicator.py:199:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:200:39: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicator.py:201:24: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/indicator.py:204:29: E1101: Super of 'MtLinePlotterIndicator' has no 'donew' member (no-member) +backtrader/indicator.py:206:21: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/indicator.py:213:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.linebuffer +backtrader/linebuffer.py:1:0: C0302: Too many lines in module (1127/1000) (too-many-lines) +backtrader/linebuffer.py:47:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/linebuffer.py:46:0: E0611: No name 'num2date' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/linebuffer.py:46:0: E0611: No name 'time2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/linebuffer.py:52:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes) +backtrader/linebuffer.py:82:24: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/linebuffer.py:86:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:144:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:304:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:321:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:362:12: W0612: Unused variable 'i' (unused-variable) +backtrader/linebuffer.py:424:27: E1101: Instance of 'LineBuffer' has no '_owner' member (no-member) +backtrader/linebuffer.py:426:19: E1101: Instance of 'LineBuffer' has no '_owner' member (no-member) +backtrader/linebuffer.py:447:8: C0415: Import outside toplevel (lineiterator.LineCoupler) (import-outside-toplevel) +backtrader/linebuffer.py:463:15: E1123: Unexpected keyword argument '_ownerskip' in constructor call (unexpected-keyword-arg) +backtrader/linebuffer.py:472:15: E1123: Unexpected keyword argument '_ownerskip' in constructor call (unexpected-keyword-arg) +backtrader/linebuffer.py:557:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:572:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:587:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:602:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:617:8: W0612: Unused variable 'tm' (unused-variable) +backtrader/linebuffer.py:106:24: E0203: Access to member '_idx' before its definition line 107 (access-member-before-definition) +backtrader/linebuffer.py:107:16: W0201: Attribute '_idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:109:12: W0201: Attribute '_idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:288:8: W0201: Attribute 'lencount' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:139:8: W0201: Attribute 'maxlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:165:8: W0201: Attribute 'maxlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:140:8: W0201: Attribute 'extrasize' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:141:8: W0201: Attribute 'lenmark' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:166:8: W0201: Attribute 'lenmark' defined outside __init__ (attribute-defined-outside-init) +backtrader/linebuffer.py:52:0: R0904: Too many public methods (35/20) (too-many-public-methods) +backtrader/linebuffer.py:656:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/linebuffer.py:660:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:660:4: C0204: Metaclass class method cleancache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/linebuffer.py:662:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/linebuffer.py:665:4: C0204: Metaclass class method usecache should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/linebuffer.py:703:29: E1101: Super of 'MetaLineActions' has no 'dopreinit' member (no-member) +backtrader/linebuffer.py:707:8: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/linebuffer.py:707:22: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/linebuffer.py:710:12: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/linebuffer.py:713:8: W0212: Access to a protected member _datas of a client class (protected-access) +backtrader/linebuffer.py:716:23: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/linebuffer.py:719:24: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/linebuffer.py:736:29: E1101: Super of 'MetaLineActions' has no 'dopostinit' member (no-member) +backtrader/linebuffer.py:741:8: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/linebuffer.py:746:0: C0112: Empty class docstring (empty-docstring) +backtrader/linebuffer.py:746:0: R0205: Class 'PseudoArray' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/linebuffer.py:766:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:783:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:787:4: W0221: Number of parameters was 3 in 'LineBuffer.qbuffer' and is now 2 in overriding 'LineActions.qbuffer' method (arguments-differ) +backtrader/linebuffer.py:793:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:794:20: E1101: Instance of 'LineActions' has no '_datas' member (no-member) +backtrader/linebuffer.py:814:24: E1101: Instance of 'LineActions' has no '_clock' member (no-member) +backtrader/linebuffer.py:828:26: E1101: Instance of 'LineActions' has no '_clock' member (no-member) +backtrader/linebuffer.py:838:0: C0103: Function name "LineDelay" doesn't conform to snake_case naming style (invalid-name) +backtrader/linebuffer.py:852:0: C0103: Function name "LineNum" doesn't conform to snake_case naming style (invalid-name) +backtrader/linebuffer.py:875:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:884:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:918:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:929:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:980:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:994:4: C0112: Empty method docstring (empty-docstring) +backtrader/linebuffer.py:1105:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/linebuffer.py:1110:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.lineiterator +backtrader/lineiterator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/lineiterator.py:36:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineiterator.py:36:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/lineiterator.py:35:0: E0611: No name 'DotDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/lineiterator.py:39:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:53:8: W0212: Access to a protected member _lineiterators of a client class (protected-access) +backtrader/lineiterator.py:57:19: W0212: Access to a protected member _mindatas of a client class (protected-access) +backtrader/lineiterator.py:69:23: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/lineiterator.py:84:25: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:98:28: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineiterator.py:100:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:101:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:104:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:107:32: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineiterator.py:109:38: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:110:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:114:14: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/lineiterator.py:127:29: E1101: Super of 'MetaLineIterator' has no 'dopreinit' member (no-member) +backtrader/lineiterator.py:132:36: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:135:8: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/lineiterator.py:141:8: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:141:31: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:141:69: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:146:30: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:158:29: E1101: Super of 'MetaLineIterator' has no 'dopostinit' member (no-member) +backtrader/lineiterator.py:163:8: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:163:26: R1728: Consider using a generator instead 'max(x._minperiod for x in _obj.lines)' (consider-using-generator) +backtrader/lineiterator.py:163:31: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:166:8: W0212: Access to a protected member _periodrecalc of a client class (protected-access) +backtrader/lineiterator.py:170:11: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:171:12: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:176:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:184:15: R1735: Consider using '{"plot": True, "subplot": True, "plotname": '', "plotskip": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineiterator.py:210:22: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/lineiterator.py:216:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:219:12: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineiterator.py:223:16: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineiterator.py:227:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:230:12: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineiterator.py:234:16: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineiterator.py:236:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:240:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:248:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:259:28: W0212: Access to a protected member _ltype of a client class (protected-access) +backtrader/lineiterator.py:266:19: W0212: Access to a protected member _ltype of a client class (protected-access) +backtrader/lineiterator.py:267:20: W0212: Access to a protected member _disable_runonce of a client class (protected-access) +backtrader/lineiterator.py:270:20: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:284:35: E1101: Module 'collections' has no 'Iterable' member (no-member) +backtrader/lineiterator.py:292:33: E1101: Module 'collections' has no 'Iterable' member (no-member) +backtrader/lineiterator.py:319:12: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/lineiterator.py:355:12: W0212: Access to a protected member _once of a client class (protected-access) +backtrader/lineiterator.py:469:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:481:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:485:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:489:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:497:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:507:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:508:54: E1101: Instance of 'SingleCoupler' has no '_owner' member (no-member) +backtrader/lineiterator.py:514:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:523:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineiterator.py:530:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineiterator.py:535:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineiterator.py:547:0: C0103: Function name "LinesCoupler" doesn't conform to snake_case naming style (invalid-name) +backtrader/lineiterator.py:565:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineiterator.py:575:10: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/lineiterator.py:590:20: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineiterator.py:592:4: W0212: Access to a protected member _clock of a client class (protected-access) +************* Module backtrader.backtrader.lineroot +backtrader/lineroot.py:42:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineroot.py:64:8: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/lineroot.py:65:18: W0212: Access to a protected member _OwnerCls of a client class (protected-access) +backtrader/lineroot.py:258:59: W0613: Unused argument 'intify' (unused-argument) +backtrader/lineroot.py:353:38: E1101: Module 'operator' has no '__div__' member (no-member) +backtrader/lineroot.py:361:39: E1101: Module 'operator' has no '__div__' member (no-member) +backtrader/lineroot.py:481:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineroot.py:484:8: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:488:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineroot.py:489:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:490:12: W0212: Access to a protected member _stage1 of a client class (protected-access) +backtrader/lineroot.py:494:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineroot.py:495:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:496:12: W0212: Access to a protected member _stage2 of a client class (protected-access) +backtrader/lineroot.py:505:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:515:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:527:15: W0212: Access to a protected member _makeoperation of a client class (protected-access) +backtrader/lineroot.py:527:15: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:536:15: W0212: Access to a protected member _makeoperationown of a client class (protected-access) +backtrader/lineroot.py:536:15: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:544:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:553:20: E1101: Instance of 'LineMultiple' has no 'lines' member (no-member) +backtrader/lineroot.py:557:0: W0223: Method '_makeoperation' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method '_makeoperationown' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method 'minbuffer' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +backtrader/lineroot.py:557:0: W0223: Method 'qbuffer' is abstract in class 'LineRoot' but is not overridden in child class 'LineSingle' (abstract-method) +************* Module backtrader.backtrader.lineseries +backtrader/lineseries.py:44:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/lineseries.py:44:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/lineseries.py:47:0: R0205: Class 'LineAlias' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/lineseries.py:102:0: R0205: Class 'Lines' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/lineseries.py:120:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/lineseries.py:120:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/lineseries.py:142:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/lineseries.py:142:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/lineseries.py:142:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/lineseries.py:176:31: W0212: Access to a protected member _getlines of a client class (protected-access) +backtrader/lineseries.py:177:36: W0212: Access to a protected member _getlinesextra of a client class (protected-access) +backtrader/lineseries.py:210:44: W0212: Access to a protected member _getkwargsdefault of a client class (protected-access) +backtrader/lineseries.py:223:41: W0212: Access to a protected member _getlines of a client class (protected-access) +backtrader/lineseries.py:263:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:267:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:278:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/lineseries.py:280:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:279:12: W0612: Unused variable 'line' (unused-variable) +backtrader/lineseries.py:279:18: W0612: Unused variable 'linealias' (unused-variable) +backtrader/lineseries.py:294:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:298:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:302:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:422:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/lineseries.py:422:4: R0914: Too many local variables (27/15) (too-many-locals) +backtrader/lineseries.py:480:42: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:499:37: R1735: Consider using '{"plotname": aliasplotname}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:520:27: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/lineseries.py:524:29: E1101: Super of 'MetaLineSeries' has no 'donew' member (no-member) +backtrader/lineseries.py:541:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:541:41: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/lineseries.py:542:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:543:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:549:0: C0112: Empty class docstring (empty-docstring) +backtrader/lineseries.py:552:15: R1735: Consider using '{"plot": True, "plotmaster": None, "legendloc": None}' instead of a call to 'dict'. (use-dict-literal) +backtrader/lineseries.py:561:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:608:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:597:0: W0613: Unused argument 'args' (unused-argument) +backtrader/lineseries.py:597:0: W0613: Unused argument 'kwargs' (unused-argument) +backtrader/lineseries.py:610:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:612:16: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/lineseries.py:620:27: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/lineseries.py:625:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/lineseries.py:630:15: W0212: Access to a protected member _getvalues of a client class (protected-access) +backtrader/lineseries.py:677:8: C0415: Import outside toplevel (lineiterator.LinesCoupler) (import-outside-toplevel) +backtrader/lineseries.py:728:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:732:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:767:4: W0231: __init__ method from base class 'LineSeries' is not called (super-init-not-called) +backtrader/lineseries.py:789:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:799:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:808:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:818:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:820:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:823:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:825:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:828:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:837:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:839:4: C0112: Empty method docstring (empty-docstring) +backtrader/lineseries.py:839:4: W0221: Number of parameters was 2 in 'LineMultiple.qbuffer' and is now 1 in overriding 'LineSeriesStub.qbuffer' method (arguments-differ) +backtrader/lineseries.py:842:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:851:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/lineseries.py:854:0: C0103: Function name "LineSeriesMaker" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtrader.observer +backtrader/observer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observer.py:28:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/observer.py:28:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/observer.py:33:0: C0112: Empty class docstring (empty-docstring) +backtrader/observer.py:43:29: E1101: Super of 'MetaObserver' has no 'donew' member (no-member) +backtrader/observer.py:44:8: W0212: Access to a protected member _analyzers of a client class (protected-access) +backtrader/observer.py:44:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/observer.py:56:29: E1101: Super of 'MetaObserver' has no 'dopreinit' member (no-member) +backtrader/observer.py:58:11: W0212: Access to a protected member _stclock of a client class (protected-access) +backtrader/observer.py:59:12: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/observer.py:59:26: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/observer.py:64:0: C0112: Empty class docstring (empty-docstring) +backtrader/observer.py:74:15: R1735: Consider using '{"plot": False, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observer.py:78:4: C0112: Empty method docstring (empty-docstring) +backtrader/observer.py:94:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.order +backtrader/order.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/order.py:35:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/order.py:38:0: R0205: Class 'OrderExecutionBit' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/order.py:38:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes) +backtrader/order.py:65:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/order.py:65:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/order.py:38:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/order.py:116:0: R0205: Class 'OrderData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/order.py:116:0: R0902: Too many instance attributes (19/7) (too-many-instance-attributes) +backtrader/order.py:159:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/order.py:159:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/order.py:239:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/order.py:239:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/order.py:310:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:314:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:318:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:323:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:223:8: W0201: Attribute '_plimit' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:330:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:330:0: R0902: Too many instance attributes (18/7) (too-many-instance-attributes) +backtrader/order.py:447:12: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/order.py:451:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/order.py:452:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:453:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:454:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:455:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:456:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:457:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:458:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:459:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:460:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:461:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:462:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:463:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:464:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:465:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:466:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:467:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:468:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/order.py:472:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/order.py:564:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:590:4: C0103: Method name "ExecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/order.py:606:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:610:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:744:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/order.py:744:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/order.py:808:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/order.py:424:8: W0201: Attribute '_plimit' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:686:8: W0201: Attribute 'plen' defined outside __init__ (attribute-defined-outside-init) +backtrader/order.py:330:0: R0904: Too many public methods (24/20) (too-many-public-methods) +backtrader/order.py:850:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/order.py:850:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/order.py:884:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/order.py:907:4: C0112: Empty method docstring (empty-docstring) +backtrader/order.py:949:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:955:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:959:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:963:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:969:0: C0112: Empty class docstring (empty-docstring) +backtrader/order.py:973:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.position +backtrader/position.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/position.py:29:0: R0205: Class 'Position' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/position.py:29:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/position.py:45:16: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/position.py:47:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:48:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:49:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:50:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:51:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:52:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/position.py:78:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:92:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:169:4: C0112: Empty method docstring (empty-docstring) +backtrader/position.py:207:8: W0201: Attribute 'datetime' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.resamplerfilter +backtrader/resamplerfilter.py:245:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/resamplerfilter.py:478:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/resamplerfilter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/resamplerfilter.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:36:0: R0205: Class 'DTFaker' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/resamplerfilter.py:87:4: E0202: An attribute defined in backtrader.backtrader.resamplerfilter line 62 hides this method (method-hidden) +backtrader/resamplerfilter.py:87:23: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:95:19: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:103:19: W0613: Unused argument 'idx' (unused-argument) +backtrader/resamplerfilter.py:114:15: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:144:15: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/resamplerfilter.py:178:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/resamplerfilter.py:147:0: R0902: Too many instance attributes (12/7) (too-many-instance-attributes) +backtrader/resamplerfilter.py:168:34: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:169:41: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:170:24: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:173:35: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:174:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:183:28: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:183:48: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:189:25: E1101: Instance of '_BaseResampler' has no 'replaying' member (no-member) +backtrader/resamplerfilter.py:190:45: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:191:49: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:195:4: C0112: Empty method docstring (empty-docstring) +backtrader/resamplerfilter.py:241:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/resamplerfilter.py:241:28: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:245:12: R1703: The if statement can be replaced with 'return bool(test)' (simplifiable-if-statement) +backtrader/resamplerfilter.py:245:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/resamplerfilter.py:245:37: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:259:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:261:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/resamplerfilter.py:253:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/resamplerfilter.py:283:45: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/resamplerfilter.py:280:4: R1711: Useless return at end of function or method (useless-return) +backtrader/resamplerfilter.py:338:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/resamplerfilter.py:338:11: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:347:19: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:384:11: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:387:15: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:394:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:420:19: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:423:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:427:38: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:428:44: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:451:15: E1102: self is not callable (not-callable) +backtrader/resamplerfilter.py:436:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/resamplerfilter.py:460:15: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:463:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:466:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:468:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:470:22: W0212: Access to a protected member _calendar of a client class (protected-access) +backtrader/resamplerfilter.py:478:44: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:493:41: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:496:53: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:499:11: R1727: Boolean condition 'False and self.p.sessionend' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/resamplerfilter.py:499:21: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:453:4: R0911: Too many return statements (7/6) (too-many-return-statements) +backtrader/resamplerfilter.py:527:25: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:530:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:533:17: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:537:11: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:541:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:545:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:549:13: E1101: Instance of '_BaseResampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:557:11: E0601: Using variable 'ph' before assignment (used-before-assignment) +backtrader/resamplerfilter.py:563:53: E0606: Possibly using variable 'ps' before assignment (possibly-used-before-assignment) +backtrader/resamplerfilter.py:563:74: E0606: Possibly using variable 'pus' before assignment (possibly-used-before-assignment) +backtrader/resamplerfilter.py:508:27: W0613: Unused argument 'greater' (unused-argument) +backtrader/resamplerfilter.py:570:41: W0613: Unused argument 'forcedata' (unused-argument) +backtrader/resamplerfilter.py:283:27: W0201: Attribute '_nextdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:320:12: W0201: Attribute '_nextdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:317:12: W0201: Attribute '_lasteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:318:12: W0201: Attribute '_lastdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:615:12: W0212: Access to a protected member _add2stack of a client class (protected-access) +backtrader/resamplerfilter.py:634:23: E1101: Instance of 'Resampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:673:25: E1101: Instance of 'Resampler' has no 'p' member (no-member) +backtrader/resamplerfilter.py:621:4: R0912: Too many branches (20/12) (too-many-branches) +backtrader/resamplerfilter.py:646:19: W0201: Attribute '_lastdteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/resamplerfilter.py:735:23: E1101: Instance of 'Replayer' has no 'p' member (no-member) +backtrader/resamplerfilter.py:720:4: R0912: Too many branches (24/12) (too-many-branches) +backtrader/resamplerfilter.py:720:4: R0915: Too many statements (60/50) (too-many-statements) +backtrader/resamplerfilter.py:819:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:825:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:831:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:837:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:843:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:849:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:855:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:861:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:867:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:873:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:879:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:885:0: C0112: Empty class docstring (empty-docstring) +backtrader/resamplerfilter.py:891:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.signal +backtrader/signal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/signal.py:65:0: C0112: Empty class docstring (empty-docstring) +backtrader/signal.py:65:13: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/signal.py:65:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.sizer +backtrader/sizer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/sizer.py:56:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +************* Module backtrader.backtrader.store +backtrader/store.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/store.py:30:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/store.py:30:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/store.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/store.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/store.py:37:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/store.py:48:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/store.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/store.py:75:15: E1102: self.DataCls is not callable (not-callable) +backtrader/store.py:76:8: W0212: Access to a protected member _store of a client class (protected-access) +backtrader/store.py:87:17: E1102: cls.BrokerCls is not callable (not-callable) +backtrader/store.py:88:8: W0212: Access to a protected member _store of a client class (protected-access) +backtrader/store.py:104:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/store.py:108:40: W0212: Access to a protected member _env of a client class (protected-access) +backtrader/store.py:118:4: C0112: Empty method docstring (empty-docstring) +backtrader/store.py:131:4: C0112: Empty method docstring (empty-docstring) +backtrader/store.py:134:15: R1721: Unnecessary use of a comprehension, use list(iter(self.notifs.popleft, None)) instead. (unnecessary-comprehension) +backtrader/store.py:103:12: W0201: Attribute 'notifs' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:104:12: W0201: Attribute 'datas' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:105:12: W0201: Attribute 'broker' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:116:12: W0201: Attribute 'broker' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:108:12: W0201: Attribute '_cerebro' defined outside __init__ (attribute-defined-outside-init) +backtrader/store.py:108:28: W0201: Attribute '_env' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.strategy +backtrader/strategy.py:1:0: C0302: Too many lines in module (1982/1000) (too-many-lines) +backtrader/strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/strategy.py:42:0: W0622: Redefining built-in 'filter' (redefined-builtin) +backtrader/strategy.py:42:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/strategy.py:41:0: E0611: No name 'AutoDictList' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/strategy.py:41:0: E0611: No name 'AutoOrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/strategy.py:54:0: C0112: Empty class docstring (empty-docstring) +backtrader/strategy.py:57:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:59:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/strategy.py:99:29: E1101: Super of 'MetaStrategy' has no 'donew' member (no-member) +backtrader/strategy.py:102:60: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +backtrader/strategy.py:103:8: W0212: Access to a protected member _id of a client class (protected-access) +backtrader/strategy.py:103:19: W0212: Access to a protected member _next_stid of a client class (protected-access) +backtrader/strategy.py:115:29: E1101: Super of 'MetaStrategy' has no 'dopreinit' member (no-member) +backtrader/strategy.py:117:8: W0212: Access to a protected member _sizer of a client class (protected-access) +backtrader/strategy.py:117:22: E1101: Module 'backtrader' has no 'sizers' member (no-member) +backtrader/strategy.py:118:8: W0212: Access to a protected member _orders of a client class (protected-access) +backtrader/strategy.py:118:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:119:8: W0212: Access to a protected member _orderspending of a client class (protected-access) +backtrader/strategy.py:119:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:120:8: W0212: Access to a protected member _trades of a client class (protected-access) +backtrader/strategy.py:121:8: W0212: Access to a protected member _tradespending of a client class (protected-access) +backtrader/strategy.py:121:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:125:8: W0212: Access to a protected member _alnames of a client class (protected-access) +backtrader/strategy.py:126:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:128:8: W0212: Access to a protected member _slave_analyzers of a client class (protected-access) +backtrader/strategy.py:128:32: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:130:8: W0212: Access to a protected member _tradehistoryon of a client class (protected-access) +backtrader/strategy.py:142:29: E1101: Super of 'MetaStrategy' has no 'dopostinit' member (no-member) +backtrader/strategy.py:144:8: W0212: Access to a protected member _sizer of a client class (protected-access) +backtrader/strategy.py:149:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/strategy.py:192:16: E1101: Instance of 'str' has no 'qbuffer' member (no-member) +backtrader/strategy.py:209:30: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/strategy.py:220:35: W0212: Access to a protected member _owner of a client class (protected-access) +backtrader/strategy.py:235:37: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:237:27: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:253:52: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:257:22: W0212: Access to a protected member _minperiod of a client class (protected-access) +backtrader/strategy.py:338:37: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:352:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:355:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:359:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:379:19: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/strategy.py:389:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:408:22: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:416:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:433:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:449:28: W0212: Access to a protected member _analyzers of a client class (protected-access) +backtrader/strategy.py:451:20: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:453:20: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/strategy.py:455:20: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/strategy.py:471:16: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:441:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/strategy.py:482:16: W0212: Access to a protected member _next of a client class (protected-access) +backtrader/strategy.py:484:16: W0212: Access to a protected member _nextstart of a client class (protected-access) +backtrader/strategy.py:486:16: W0212: Access to a protected member _prenext of a client class (protected-access) +backtrader/strategy.py:473:44: W0613: Unused argument 'once' (unused-argument) +backtrader/strategy.py:494:8: W0212: Access to a protected member _settz of a client class (protected-access) +backtrader/strategy.py:494:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/strategy.py:501:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/strategy.py:508:16: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/strategy.py:522:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:529:18: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:533:19: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/strategy.py:540:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:542:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:545:19: E1101: Instance of 'dict' has no 'plotname' member (no-member) +backtrader/strategy.py:550:50: E1101: Instance of 'tuple' has no 'itersize' member (no-member) +backtrader/strategy.py:552:37: E1101: Instance of 'tuple' has no 'size' member (no-member) +backtrader/strategy.py:556:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:560:27: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:572:39: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:582:34: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/strategy.py:592:12: W0212: Access to a protected member _stop of a client class (protected-access) +backtrader/strategy.py:608:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategy.py:611:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:612:30: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/strategy.py:614:4: W0221: Number of parameters was 3 in 'LineIterator._addnotification' and is now 3 in overriding 'Strategy._addnotification' method (arguments-differ) +backtrader/strategy.py:614:4: W0221: Variadics removed in overriding 'Strategy._addnotification' method (arguments-differ) +backtrader/strategy.py:633:20: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/strategy.py:614:4: R0912: Too many branches (19/12) (too-many-branches) +backtrader/strategy.py:704:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:704:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:725:16: W0212: Access to a protected member _notify_order of a client class (protected-access) +backtrader/strategy.py:730:16: W0212: Access to a protected member _notify_trade of a client class (protected-access) +backtrader/strategy.py:743:12: W0212: Access to a protected member _notify_cashvalue of a client class (protected-access) +backtrader/strategy.py:744:12: W0212: Access to a protected member _notify_fund of a client class (protected-access) +backtrader/strategy.py:746:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:746:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:746:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/strategy.py:746:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/strategy.py:746:4: W1113: Keyword argument before variable positional arguments list in the definition of add_timer function (keyword-arg-before-vararg) +backtrader/strategy.py:781:15: W0212: Access to a protected member _add_timer of a client class (protected-access) +backtrader/strategy.py:884:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/strategy.py:884:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/strategy.py:1072:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/strategy.py:1072:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/strategy.py:1160:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1167:4: R0913: Too many arguments (17/5) (too-many-arguments) +backtrader/strategy.py:1167:4: R0917: Too many positional arguments (17/5) (too-many-positional-arguments) +backtrader/strategy.py:1167:4: R0914: Too many local variables (22/15) (too-many-locals) +backtrader/strategy.py:1173:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1180:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1183:18: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1291:16: R1735: Consider using '{"size": size, "data": data, "price": price, "plimit": plimit, "exectype": exectype, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1309:20: R1735: Consider using '{"data": data, "price": stopprice, "exectype": stopexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1327:20: R1735: Consider using '{"data": data, "price": limitprice, "exectype": limitexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1345:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1345:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1345:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +backtrader/strategy.py:1345:4: R0913: Too many arguments (17/5) (too-many-arguments) +backtrader/strategy.py:1345:4: R0917: Too many positional arguments (17/5) (too-many-positional-arguments) +backtrader/strategy.py:1345:4: R0914: Too many local variables (22/15) (too-many-locals) +backtrader/strategy.py:1351:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1358:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1361:18: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/strategy.py:1406:16: R1735: Consider using '{"size": size, "data": data, "price": price, "plimit": plimit, "exectype": exectype, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1424:20: R1735: Consider using '{"data": data, "price": stopprice, "exectype": stopexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1442:20: R1735: Consider using '{"data": data, "price": limitprice, "exectype": limitexec, "valid": valid, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/strategy.py:1489:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/strategy.py:1532:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/strategy.py:1542:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/strategy.py:1599:8: W0106: Expression "self.getposition(data, self.broker).size" is assigned to nothing (expression-not-assigned) +backtrader/strategy.py:1683:26: E1101: Module 'backtrader' has no 'sizers' member (no-member) +backtrader/strategy.py:610:28: E0203: Access to member '_orderspending' before its definition line 611 (access-member-before-definition) +backtrader/strategy.py:237:8: W0201: Attribute '_minperiods' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:349:8: W0201: Attribute '_minperstatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:515:8: W0201: Attribute '_minperstatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:417:8: W0201: Attribute '_dlens' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:513:8: W0201: Attribute '_dlens' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:524:8: W0201: Attribute 'indobscsv' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:606:8: W0201: Attribute '_tradehistoryon' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:611:8: W0201: Attribute '_orderspending' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:612:8: W0201: Attribute '_tradespending' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1693:8: W0201: Attribute '_sizer' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:149:0: R0904: Too many public methods (37/20) (too-many-public-methods) +backtrader/strategy.py:1721:0: C0112: Empty class docstring (empty-docstring) +backtrader/strategy.py:1724:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/strategy.py:1755:8: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1757:16: W0212: Access to a protected member _data of a client class (protected-access) +backtrader/strategy.py:1759:12: W0212: Access to a protected member _dtarget of a client class (protected-access) +backtrader/strategy.py:1761:12: W0212: Access to a protected member _dtarget of a client class (protected-access) +backtrader/strategy.py:1763:12: W0212: Access to a protected member _dtarget of a client class (protected-access) +backtrader/strategy.py:1764:31: E1101: Module 'backtrader' has no 'LineRoot' member (no-member) +backtrader/strategy.py:1765:12: W0212: Access to a protected member _dtarget of a client class (protected-access) +backtrader/strategy.py:1767:12: W0212: Access to a protected member _dtarget of a client class (protected-access) +backtrader/strategy.py:1784:12: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1787:8: W0212: Access to a protected member _longshort of a client class (protected-access) +backtrader/strategy.py:1787:31: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1787:45: E1101: Module 'backtrader' has no 'SIGNAL_LONGSHORT' member (no-member) +backtrader/strategy.py:1789:8: W0212: Access to a protected member _long of a client class (protected-access) +backtrader/strategy.py:1789:26: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1789:40: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +backtrader/strategy.py:1790:8: W0212: Access to a protected member _short of a client class (protected-access) +backtrader/strategy.py:1790:27: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1790:41: E1101: Module 'backtrader' has no 'SIGNAL_SHORT' member (no-member) +backtrader/strategy.py:1792:8: W0212: Access to a protected member _longexit of a client class (protected-access) +backtrader/strategy.py:1792:30: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1792:44: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT' member (no-member) +backtrader/strategy.py:1793:8: W0212: Access to a protected member _shortexit of a client class (protected-access) +backtrader/strategy.py:1793:31: W0212: Access to a protected member _signals of a client class (protected-access) +backtrader/strategy.py:1793:45: E1101: Module 'backtrader' has no 'SIGNAL_SHORTEXIT' member (no-member) +backtrader/strategy.py:1864:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:1875:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:1875:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/strategy.py:1890:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/strategy.py:1898:4: R0914: Too many local variables (32/15) (too-many-locals) +backtrader/strategy.py:1900:46: W0212: Access to a protected member _concurrent of a client class (protected-access) +backtrader/strategy.py:1907:47: E1101: Module 'backtrader' has no 'SIGNAL_LONGSHORT' member (no-member) +backtrader/strategy.py:1908:48: E1101: Module 'backtrader' has no 'SIGNAL_LONGSHORT' member (no-member) +backtrader/strategy.py:1910:48: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +backtrader/strategy.py:1911:48: E1101: Module 'backtrader' has no 'SIGNAL_LONG_INV' member (no-member) +backtrader/strategy.py:1912:42: E1101: Module 'backtrader' has no 'SIGNAL_LONG_ANY' member (no-member) +backtrader/strategy.py:1915:48: E1101: Module 'backtrader' has no 'SIGNAL_SHORT' member (no-member) +backtrader/strategy.py:1916:48: E1101: Module 'backtrader' has no 'SIGNAL_SHORT_INV' member (no-member) +backtrader/strategy.py:1917:42: E1101: Module 'backtrader' has no 'SIGNAL_SHORT_ANY' member (no-member) +backtrader/strategy.py:1920:45: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT' member (no-member) +backtrader/strategy.py:1921:45: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT_INV' member (no-member) +backtrader/strategy.py:1922:39: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT_ANY' member (no-member) +backtrader/strategy.py:1925:45: E1101: Module 'backtrader' has no 'SIGNAL_SHORTEXIT' member (no-member) +backtrader/strategy.py:1926:45: E1101: Module 'backtrader' has no 'SIGNAL_SHORTEXIT_INV' member (no-member) +backtrader/strategy.py:1927:39: E1101: Module 'backtrader' has no 'SIGNAL_SHORTEXIT_ANY' member (no-member) +backtrader/strategy.py:1936:47: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +backtrader/strategy.py:1937:47: E1101: Module 'backtrader' has no 'SIGNAL_LONG_INV' member (no-member) +backtrader/strategy.py:1938:41: E1101: Module 'backtrader' has no 'SIGNAL_LONG_ANY' member (no-member) +backtrader/strategy.py:1941:47: E1101: Module 'backtrader' has no 'SIGNAL_SHORT' member (no-member) +backtrader/strategy.py:1942:47: E1101: Module 'backtrader' has no 'SIGNAL_SHORT_INV' member (no-member) +backtrader/strategy.py:1943:41: E1101: Module 'backtrader' has no 'SIGNAL_SHORT_ANY' member (no-member) +backtrader/strategy.py:1969:19: W0212: Access to a protected member _accumulate of a client class (protected-access) +backtrader/strategy.py:1981:19: W0212: Access to a protected member _accumulate of a client class (protected-access) +backtrader/strategy.py:1898:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/strategy.py:1898:4: R0915: Too many statements (56/50) (too-many-statements) +backtrader/strategy.py:1863:8: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1887:20: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1955:16: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1958:16: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1966:16: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1970:20: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1978:16: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +backtrader/strategy.py:1982:20: W0201: Attribute '_sentinel' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.talib +backtrader/talib.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/talib.py:46:14: I1101: Module 'talib' has no 'MA_Type' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:51:12: I1101: Module 'talib' has no 'abstract' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:52:12: I1101: Module 'talib' has no 'abstract' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:62:12: I1101: Module 'talib' has no 'abstract' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:63:12: I1101: Module 'talib' has no 'abstract' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:80:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/talib.py:85:8: C0204: Metaclass class method dopostinit should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/talib.py:98:12: W0212: Access to a protected member _tabstract of a client class (protected-access) +backtrader/talib.py:98:48: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/talib.py:99:12: W0212: Access to a protected member _lookback of a client class (protected-access) +backtrader/talib.py:99:40: W0212: Access to a protected member _tabstract of a client class (protected-access) +backtrader/talib.py:101:15: W0212: Access to a protected member _unstable of a client class (protected-access) +backtrader/talib.py:102:16: W0212: Access to a protected member _lookback of a client class (protected-access) +backtrader/talib.py:105:16: W0212: Access to a protected member _lookback of a client class (protected-access) +backtrader/talib.py:108:25: W0212: Access to a protected member _tabstract of a client class (protected-access) +backtrader/talib.py:109:12: W0212: Access to a protected member _tafunc of a client class (protected-access) +backtrader/talib.py:119:8: R0914: Too many local variables (21/15) (too-many-locals) +backtrader/talib.py:129:25: I1101: Module 'talib' has no 'abstract' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:136:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/talib.py:152:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/talib.py:156:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/talib.py:189:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/talib.py:119:8: R0912: Too many branches (17/12) (too-many-branches) +backtrader/talib.py:119:8: R0915: Too many statements (55/50) (too-many-statements) +backtrader/talib.py:221:12: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/talib.py:230:12: C0415: Import outside toplevel (array) (import-outside-toplevel) +backtrader/talib.py:235:46: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/talib.py:251:8: C0112: Empty method docstring (empty-docstring) +backtrader/talib.py:257:43: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/talib.py:274:18: I1101: Module 'talib' has no 'get_functions' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) +backtrader/talib.py:276:8: W0212: Access to a protected member _subclass of a client class (protected-access) +backtrader/talib.py:44:4: C0412: Imports from package talib are not grouped (ungrouped-imports) +************* Module backtrader.backtrader.timer +backtrader/timer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/timer.py:35:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/timer.py:34:0: E0611: No name 'TIME_MAX' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/timer.py:34:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/timer.py:34:0: E0611: No name 'num2date' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/timer.py:42:0: C0112: Empty class docstring (empty-docstring) +backtrader/timer.py:42:0: R0902: Too many instance attributes (16/7) (too-many-instance-attributes) +backtrader/timer.py:80:26: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:81:28: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:82:27: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:84:35: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:84:62: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:86:15: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:88:17: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:120:15: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:128:23: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:129:55: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:133:32: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:152:15: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:161:23: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:162:54: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:165:32: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:191:29: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/timer.py:202:23: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:203:22: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:214:15: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:215:25: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:229:15: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:234:33: W0212: Access to a protected member _getnexteos of a client class (protected-access) +backtrader/timer.py:243:25: E1101: Instance of 'Timer' has no 'p' member (no-member) +backtrader/timer.py:178:4: R0912: Too many branches (24/12) (too-many-branches) +backtrader/timer.py:178:4: R0915: Too many statements (55/50) (too-many-statements) +backtrader/timer.py:81:12: W0201: Attribute '_rstwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:87:16: W0201: Attribute '_rstwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:89:16: W0201: Attribute '_rstwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:82:12: W0201: Attribute '_tzdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:84:12: W0201: Attribute '_tzdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:91:8: W0201: Attribute '_isdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:94:8: W0201: Attribute '_nexteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:194:12: W0201: Attribute '_nexteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:238:16: W0201: Attribute '_nexteos' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:95:8: W0201: Attribute '_curdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:198:12: W0201: Attribute '_curdate' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:97:8: W0201: Attribute '_curmonth' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:127:12: W0201: Attribute '_curmonth' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:98:8: W0201: Attribute '_monthmask' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:129:12: W0201: Attribute '_monthmask' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:100:8: W0201: Attribute '_curweek' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:160:12: W0201: Attribute '_curweek' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:101:8: W0201: Attribute '_weekmask' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:162:12: W0201: Attribute '_weekmask' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:109:8: W0201: Attribute '_when' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:110:8: W0201: Attribute '_dtwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:220:16: W0201: Attribute '_dtwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:222:16: W0201: Attribute '_dtwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:249:20: W0201: Attribute '_dtwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:110:23: W0201: Attribute '_dwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:217:12: W0201: Attribute '_dwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:252:24: W0201: Attribute '_dwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:254:24: W0201: Attribute '_dwhen' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:112:8: W0201: Attribute '_lastcall' defined outside __init__ (attribute-defined-outside-init) +backtrader/timer.py:227:8: W0201: Attribute 'lastwhen' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.trade +backtrader/trade.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/trade.py:32:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/trade.py:30:0: E0611: No name 'AutoOrderedDict' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/trade.py:43:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/trade.py:43:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/trade.py:70:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/trade.py:128:0: R0205: Class 'Trade' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/trade.py:128:0: R0902: Too many instance attributes (23/7) (too-many-instance-attributes) +backtrader/trade.py:215:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/trade.py:215:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/trade.py:261:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/trade.py:277:15: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/trade.py:299:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/trade.py:299:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/trade.py:399:16: W0212: Access to a protected member _tz of a client class (protected-access) +backtrader/trade.py:299:41: W0613: Unused argument 'value' (unused-argument) +backtrader/trade.py:349:12: W0201: Attribute 'long' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.tradingcal +backtrader/tradingcal.py:180:0: C0301: Line too long (104/100) (line-too-long) +backtrader/tradingcal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/tradingcal.py:30:0: E0401: Unable to import 'backtrader.utils' (import-error) +backtrader/tradingcal.py:30:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/tradingcal.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/tradingcal.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/tradingcal.py:58:0: C0112: Empty class docstring (empty-docstring) +backtrader/tradingcal.py:97:8: W0106: Expression "self._nextday(day)[1][1]" is assigned to nothing (expression-not-assigned) +backtrader/tradingcal.py:148:4: W0231: __init__ method from base class 'TradingCalendarBase' is not called (super-init-not-called) +backtrader/tradingcal.py:169:4: W0237: Parameter 'day' has been renamed to 'ts' in overriding 'TradingCalendar.schedule' method (arguments-renamed) +backtrader/tradingcal.py:234:4: W0231: __init__ method from base class 'TradingCalendarBase' is not called (super-init-not-called) +backtrader/tradingcal.py:239:12: C0415: Import outside toplevel (pandas_market_calendars) (import-outside-toplevel) +backtrader/tradingcal.py:239:12: E0401: Unable to import 'pandas_market_calendars' (import-error) +backtrader/tradingcal.py:243:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +backtrader/tradingcal.py:269:28: W0613: Unused argument 'tz' (unused-argument) +************* Module backtrader.backtrader.writer +backtrader/writer.py:86:0: C0301: Line too long (118/100) (line-too-long) +backtrader/writer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/writer.py:40:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/writer.py:39:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +backtrader/writer.py:40:0: C0413: Import "from .utils.py3 import integer_types, map, string_types, with_metaclass, MAXINT" should be placed at the top of the module (wrong-import-position) +backtrader/writer.py:47:0: C0413: Import "from .lineseries import LineSeries" should be placed at the top of the module (wrong-import-position) +backtrader/writer.py:48:0: C0413: Import "from .metabase import MetaParams" should be placed at the top of the module (wrong-import-position) +backtrader/writer.py:49:0: C0413: Import "from .strategy import Strategy" should be placed at the top of the module (wrong-import-position) +backtrader/writer.py:52:0: C0112: Empty class docstring (empty-docstring) +backtrader/writer.py:57:37: E0203: Access to member 'p' before its definition line 72 (access-member-before-definition) +backtrader/writer.py:52:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/writer.py:161:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/writer.py:162:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/writer.py:176:27: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +backtrader/writer.py:176:27: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/writer.py:182:4: C0112: Empty method docstring (empty-docstring) +backtrader/writer.py:190:4: C0112: Empty method docstring (empty-docstring) +backtrader/writer.py:195:4: C0112: Empty method docstring (empty-docstring) +backtrader/writer.py:199:26: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/writer.py:218:44: R0124: Redundant comparison - x == x (comparison-with-itself) +backtrader/writer.py:233:27: W0108: Lambda may not be necessary (unnecessary-lambda) +backtrader/writer.py:273:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/writer.py:174:16: W0201: Attribute 'close_out' defined outside __init__ (attribute-defined-outside-init) +backtrader/writer.py:177:16: W0201: Attribute 'close_out' defined outside __init__ (attribute-defined-outside-init) +backtrader/writer.py:180:16: W0201: Attribute 'close_out' defined outside __init__ (attribute-defined-outside-init) +backtrader/writer.py:326:0: C0112: Empty class docstring (empty-docstring) +backtrader/writer.py:354:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/writer.py:357:4: C0112: Empty method docstring (empty-docstring) +backtrader/writer.py:359:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/writer.py:39:0: W0611: Unused backtrader imported as bt (unused-import) +backtrader/writer.py:40:0: W0611: Unused MAXINT imported from utils.py3 (unused-import) +backtrader/writer.py:49:0: W0611: Unused Strategy imported from strategy (unused-import) +************* Module backtrader.backtrader.comminfo +backtrader/comminfo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/comminfo.py:132:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/comminfo.py:160:4: C0112: Empty method docstring (empty-docstring) +backtrader/comminfo.py:165:4: C0112: Empty method docstring (empty-docstring) +backtrader/comminfo.py:182:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/comminfo.py:251:42: W0613: Unused argument 'pseudoexec' (unused-argument) +backtrader/comminfo.py:328:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/comminfo.py:328:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/comminfo.py:328:35: W0613: Unused argument 'data' (unused-argument) +backtrader/comminfo.py:328:60: W0613: Unused argument 'dt0' (unused-argument) +backtrader/comminfo.py:328:65: W0613: Unused argument 'dt1' (unused-argument) +************* Module backtrader.backtrader.metabase +backtrader/metabase.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/metabase.py:32:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/metabase.py:42:13: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/metabase.py:62:20: W0212: Access to a protected member _getframe of a client class (protected-access) +backtrader/metabase.py:82:0: C0112: Empty class docstring (empty-docstring) +backtrader/metabase.py:122:8: C2801: Unnecessarily calls dunder method __init__. Instantiate class directly. (unnecessary-dunder-call) +backtrader/metabase.py:142:8: W0642: Invalid assignment to cls in method (self-cls-assignment) +backtrader/metabase.py:150:0: C0112: Empty class docstring (empty-docstring) +backtrader/metabase.py:150:0: R0205: Class 'AutoInfoClass' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/metabase.py:170:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/metabase.py:187:34: W0212: Access to a protected member _getpairs of a client class (protected-access) +backtrader/metabase.py:224:26: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/metabase.py:324:0: C0112: Empty class docstring (empty-docstring) +backtrader/metabase.py:327:4: C0204: Metaclass class method __new__ should have 'mcs' as first argument (bad-mcs-classmethod-argument) +backtrader/metabase.py:374:4: R0914: Too many local variables (18/15) (too-many-locals) +backtrader/metabase.py:410:20: W0127: Assigning the same variable 'fp' to itself (self-assigning-variable) +backtrader/metabase.py:421:27: W0212: Access to a protected member _getitems of a client class (protected-access) +backtrader/metabase.py:374:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/metabase.py:433:0: C0112: Empty class docstring (empty-docstring) +backtrader/metabase.py:436:4: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/metabase.py:433:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/metabase.py:439:0: R0205: Class 'ItemCollection' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/metabase.py:450:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/metabase.py:451:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/metabase.py:477:4: C0112: Empty method docstring (empty-docstring) +backtrader/metabase.py:481:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.mathsupport +backtrader/mathsupport.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.analyzers +backtrader/analyzers/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.analyzers.slippage_impact +backtrader/analyzers/slippage_impact.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/slippage_impact.py:4:0: R0902: Too many instance attributes (11/7) (too-many-instance-attributes) +backtrader/analyzers/slippage_impact.py:4:29: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/slippage_impact.py:39:26: E1101: Module 'backtrader' has no 'num2date' member (no-member) +backtrader/analyzers/slippage_impact.py:44:28: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/analyzers/slippage_impact.py:48:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/slippage_impact.py:80:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/slippage_impact.py:51:8: W0201: Attribute 'total_traded_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:54:8: W0201: Attribute 'total_slip_cost' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:57:8: W0201: Attribute 'initial_equity' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:60:8: W0201: Attribute 'final_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:63:8: W0201: Attribute 'actual_return' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:66:8: W0201: Attribute 'hypo_final' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:67:8: W0201: Attribute 'hypo_return' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:74:12: W0201: Attribute 'actual_cagr' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:77:12: W0201: Attribute 'actual_cagr' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:75:12: W0201: Attribute 'hypo_cagr' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/slippage_impact.py:78:12: W0201: Attribute 'hypo_cagr' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.caganalyzer +backtrader/analyzers/caganalyzer.py:76:0: C0301: Line too long (115/100) (line-too-long) +backtrader/analyzers/caganalyzer.py:94:0: C0301: Line too long (140/100) (line-too-long) +backtrader/analyzers/caganalyzer.py:97:0: C0301: Line too long (119/100) (line-too-long) +backtrader/analyzers/caganalyzer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/caganalyzer.py:4:0: E0611: No name 'TimeFrameAnalyzerBase' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/caganalyzer.py:17:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/caganalyzer.py:18:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/caganalyzer.py:19:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/caganalyzer.py:20:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/caganalyzer.py:29:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/caganalyzer.py:31:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/caganalyzer.py:33:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/caganalyzer.py:45:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/caganalyzer.py:37:8: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/caganalyzer.py:98:8: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/caganalyzer.py:40:8: W0201: Attribute '_cum_return' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/caganalyzer.py:2:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +backtrader/analyzers/caganalyzer.py:3:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.backtrader.analyzers.roi +backtrader/analyzers/roi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/roi.py:2:0: E0611: No name 'TimeFrameAnalyzerBase' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/roi.py:14:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/roi.py:15:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/roi.py:16:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/roi.py:17:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/roi.py:22:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/roi.py:44:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/roi.py:26:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:28:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:32:12: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:34:12: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:86:8: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:37:8: W0201: Attribute '_cum_return' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:40:8: W0201: Attribute '_returns' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:48:12: W0201: Attribute '_value_end' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/roi.py:50:12: W0201: Attribute '_value_end' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.annualreturn +backtrader/analyzers/annualreturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/annualreturn.py:31:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/analyzers/annualreturn.py:30:0: E0611: No name 'Analyzer' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/annualreturn.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/annualreturn.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/annualreturn.py:41:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/annualreturn.py:50:20: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/analyzers/annualreturn.py:84:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/annualreturn.py:50:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/annualreturn.py:51:8: W0201: Attribute 'ret' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.drawdown +backtrader/analyzers/drawdown.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/drawdown.py:29:0: E0401: Unable to import 'backtrader.utils' (import-error) +backtrader/analyzers/drawdown.py:29:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/drawdown.py:34:15: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/drawdown.py:54:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:56:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/drawdown.py:62:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:76:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:78:8: W0212: Access to a protected member _close of a client class (protected-access) +backtrader/analyzers/drawdown.py:80:26: W0613: Unused argument 'cash' (unused-argument) +backtrader/analyzers/drawdown.py:80:50: W0613: Unused argument 'shares' (unused-argument) +backtrader/analyzers/drawdown.py:96:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:106:25: W0612: Unused variable 'maxdrawdown' (unused-variable) +backtrader/analyzers/drawdown.py:58:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:60:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:64:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:74:8: W0201: Attribute '_maxvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:91:12: W0201: Attribute '_maxvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:94:12: W0201: Attribute '_maxvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:90:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:93:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:112:19: E1101: Module 'backtrader' has no 'TimeFrameAnalyzerBase' member (no-member) +backtrader/analyzers/drawdown.py:132:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:134:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/drawdown.py:145:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:165:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/drawdown.py:136:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:138:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:139:8: W0201: Attribute 'dd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:158:8: W0201: Attribute 'dd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:140:8: W0201: Attribute 'maxdd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:162:8: W0201: Attribute 'maxdd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:141:8: W0201: Attribute 'maxddlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:163:8: W0201: Attribute 'maxddlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:142:8: W0201: Attribute 'peak' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:154:12: W0201: Attribute 'peak' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:143:8: W0201: Attribute 'ddlen' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/drawdown.py:155:12: W0201: Attribute 'ddlen' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.leverage +backtrader/analyzers/leverage.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/leverage.py:31:20: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/leverage.py:42:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/leverage.py:49:50: W0613: Unused argument 'shares' (unused-argument) +backtrader/analyzers/leverage.py:64:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/leverage.py:45:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/leverage.py:47:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/leverage.py:58:8: W0201: Attribute '_cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/leverage.py:60:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/leverage.py:62:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.logreturnsrolling +backtrader/analyzers/logreturnsrolling.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/logreturnsrolling.py:36:24: E1101: Module 'backtrader' has no 'TimeFrameAnalyzerBase' member (no-member) +backtrader/analyzers/logreturnsrolling.py:51:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/logreturnsrolling.py:53:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/logreturnsrolling.py:70:26: W0613: Unused argument 'cash' (unused-argument) +backtrader/analyzers/logreturnsrolling.py:70:50: W0613: Unused argument 'shares' (unused-argument) +backtrader/analyzers/logreturnsrolling.py:96:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/logreturnsrolling.py:99:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/logreturnsrolling.py:55:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:57:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:59:8: W0201: Attribute '_values' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:66:16: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:68:16: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:101:8: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:80:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/logreturnsrolling.py:82:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.periodstats +backtrader/analyzers/periodstats.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/periodstats.py:29:0: E0401: Unable to import 'backtrader.mathsupport' (import-error) +backtrader/analyzers/periodstats.py:29:0: E0611: No name 'mathsupport' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/periodstats.py:30:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/periodstats.py:30:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/periodstats.py:32:0: E0611: No name 'TimeReturn' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/periodstats.py:37:18: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/periodstats.py:41:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/periodstats.py:55:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/periodstats.py:37:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.analyzers.positions +backtrader/analyzers/positions.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/positions.py:31:21: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/positions.py:45:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/positions.py:48:23: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/analyzers/positions.py:48:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/analyzers/positions.py:51:17: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/analyzers/positions.py:52:30: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/positions.py:54:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/positions.py:52:8: W0201: Attribute '_usedate' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.sqn +backtrader/analyzers/sqn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/sqn.py:30:0: E0611: No name 'Analyzer' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sqn.py:31:0: E0401: Unable to import 'backtrader.mathsupport' (import-error) +backtrader/analyzers/sqn.py:31:0: E0611: No name 'mathsupport' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sqn.py:32:0: E0401: Unable to import 'backtrader.utils' (import-error) +backtrader/analyzers/sqn.py:32:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sqn.py:72:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/sqn.py:74:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/sqn.py:75:19: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/analyzers/sqn.py:88:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/analyzers/sqn.py:114:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/sqn.py:70:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/sqn.py:75:8: W0201: Attribute 'pnl' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/sqn.py:76:8: W0201: Attribute 'count' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.timereturn +backtrader/analyzers/timereturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/timereturn.py:28:0: E0611: No name 'TimeFrameAnalyzerBase' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/timereturn.py:46:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/timereturn.py:48:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/timereturn.py:63:26: W0613: Unused argument 'cash' (unused-argument) +backtrader/analyzers/timereturn.py:63:50: W0613: Unused argument 'shares' (unused-argument) +backtrader/analyzers/timereturn.py:84:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/timereturn.py:98:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/timereturn.py:101:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/timereturn.py:50:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:52:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:54:8: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:89:12: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:94:16: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:96:16: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:55:8: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:59:16: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:61:16: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:103:8: W0201: Attribute '_lastvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:75:16: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:77:16: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:80:16: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:82:16: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/timereturn.py:109:8: W0201: Attribute 'strategy' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.transactions +backtrader/analyzers/transactions.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/transactions.py:31:0: E0611: No name 'Order' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/transactions.py:31:0: E0611: No name 'Position' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/transactions.py:34:19: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/transactions.py:53:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/transactions.py:55:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/transactions.py:57:22: W0212: Access to a protected member _pfheaders of a client class (protected-access) +backtrader/analyzers/transactions.py:57:52: W0212: Access to a protected member _pfheaders of a client class (protected-access) +backtrader/analyzers/transactions.py:77:30: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/analyzers/transactions.py:84:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/transactions.py:59:8: W0201: Attribute '_positions' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/transactions.py:60:8: W0201: Attribute '_idnames' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.vwr +backtrader/analyzers/vwr.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/vwr.py:31:0: E0611: No name 'TimeFrameAnalyzerBase' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/vwr.py:34:0: E0611: No name 'Returns' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/vwr.py:58:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:69:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:70:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:71:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:72:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:84:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/vwr.py:86:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/vwr.py:100:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/vwr.py:100:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/analyzers/vwr.py:102:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/vwr.py:111:8: W0104: Statement seems to have no effect (pointless-statement) +backtrader/analyzers/vwr.py:121:25: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/vwr.py:164:26: W0613: Unused argument 'cash' (unused-argument) +backtrader/analyzers/vwr.py:164:50: W0613: Unused argument 'shares' (unused-argument) +backtrader/analyzers/vwr.py:89:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/vwr.py:91:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/vwr.py:94:12: W0201: Attribute '_pis' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/vwr.py:96:12: W0201: Attribute '_pis' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/vwr.py:98:8: W0201: Attribute '_pns' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.tradeanalyzer +backtrader/analyzers/tradeanalyzer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/tradeanalyzer.py:28:0: E0611: No name 'Analyzer' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/tradeanalyzer.py:29:0: E0401: Unable to import 'backtrader.utils' (import-error) +backtrader/analyzers/tradeanalyzer.py:29:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/tradeanalyzer.py:30:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/tradeanalyzer.py:30:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/tradeanalyzer.py:71:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/tradeanalyzer.py:202:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/tradeanalyzer.py:204:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/tradeanalyzer.py:205:8: W0212: Access to a protected member _close of a client class (protected-access) +backtrader/analyzers/tradeanalyzer.py:207:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/analyzers/tradeanalyzer.py:207:4: R0915: Too many statements (89/50) (too-many-statements) +backtrader/analyzers/tradeanalyzer.py:225:12: W0612: Unused variable 'lost' (unused-variable) +backtrader/analyzers/tradeanalyzer.py:226:12: W0612: Unused variable 'tlong' (unused-variable) +backtrader/analyzers/tradeanalyzer.py:227:12: W0612: Unused variable 'tshort' (unused-variable) +backtrader/analyzers/tradeanalyzer.py:73:8: W0201: Attribute 'rets' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.calmar +backtrader/analyzers/calmar.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/calmar.py:30:0: E0611: No name 'TimeDrawDown' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/calmar.py:35:13: E1101: Module 'backtrader' has no 'TimeFrameAnalyzerBase' member (no-member) +backtrader/analyzers/calmar.py:50:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/calmar.py:61:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/calmar.py:64:23: E0602: Undefined variable 'collections' (undefined-variable) +backtrader/analyzers/calmar.py:77:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/calmar.py:84:15: E0602: Undefined variable 'math' (undefined-variable) +backtrader/analyzers/calmar.py:89:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/calmar.py:63:8: W0201: Attribute '_mdd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/calmar.py:79:8: W0201: Attribute '_mdd' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/calmar.py:64:8: W0201: Attribute '_values' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/calmar.py:68:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/calmar.py:70:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/calmar.py:85:8: W0201: Attribute 'calmar' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.sortino +backtrader/analyzers/sortino.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/sortino.py:30:0: E0611: No name 'Analyzer' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sortino.py:30:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sortino.py:31:0: E0401: Unable to import 'backtrader.analyzers' (import-error) +backtrader/analyzers/sortino.py:31:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sortino.py:32:0: E0401: Unable to import 'backtrader.mathsupport' (import-error) +backtrader/analyzers/sortino.py:32:0: E0611: No name 'mathsupport' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sortino.py:33:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/sortino.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sortino.py:75:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/sortino.py:77:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/sortino.py:129:8: W0201: Attribute 'ratio' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/sortino.py:36:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.analyzers.returns +backtrader/analyzers/returns.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/returns.py:31:0: E0611: No name 'TimeFrameAnalyzerBase' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/returns.py:60:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/returns.py:61:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/returns.py:62:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/returns.py:63:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/returns.py:66:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/returns.py:68:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/returns.py:81:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/returns.py:83:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/returns.py:113:34: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/analyzers/returns.py:70:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:72:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:75:12: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:77:12: W0201: Attribute '_value_start' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:79:8: W0201: Attribute '_tcount' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:86:12: W0201: Attribute '_value_end' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/returns.py:88:12: W0201: Attribute '_value_end' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.analyzers.sharpe +backtrader/analyzers/sharpe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/sharpe.py:30:0: E0611: No name 'Analyzer' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sharpe.py:30:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sharpe.py:31:0: E0401: Unable to import 'backtrader.analyzers' (import-error) +backtrader/analyzers/sharpe.py:31:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sharpe.py:32:0: E0401: Unable to import 'backtrader.mathsupport' (import-error) +backtrader/analyzers/sharpe.py:32:0: E0611: No name 'mathsupport' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sharpe.py:33:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/sharpe.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/sharpe.py:79:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/sharpe.py:81:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/sharpe.py:90:12: W0201: Attribute 'ratio' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/sharpe.py:141:12: W0201: Attribute 'ratio' defined outside __init__ (attribute-defined-outside-init) +backtrader/analyzers/sharpe.py:156:0: C0103: Class name "SharpeRatio_A" doesn't conform to PascalCase naming style (invalid-name) +************* Module backtrader.backtrader.analyzers.pyfolio +backtrader/analyzers/pyfolio.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/analyzers/pyfolio.py:29:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/analyzers/pyfolio.py:29:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/analyzers/pyfolio.py:31:0: E0611: No name 'GrossLeverage' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/pyfolio.py:31:0: E0611: No name 'PositionsValue' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/pyfolio.py:31:0: E0611: No name 'TimeReturn' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/pyfolio.py:31:0: E0611: No name 'Transactions' in module 'backtrader.backtrader.analyzers' (no-name-in-module) +backtrader/analyzers/pyfolio.py:34:14: E1101: Module 'backtrader' has no 'Analyzer' member (no-member) +backtrader/analyzers/pyfolio.py:63:28: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/analyzers/pyfolio.py:67:18: R1735: Consider using '{"timeframe": self.p.timeframe, "compression": self.p.compression}' instead of a call to 'dict'. (use-dict-literal) +backtrader/analyzers/pyfolio.py:74:4: C0112: Empty method docstring (empty-docstring) +backtrader/analyzers/pyfolio.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/analyzers/pyfolio.py:82:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/analyzers/pyfolio.py:98:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +backtrader/analyzers/pyfolio.py:99:8: C0415: Import outside toplevel (pandas.DataFrame) (import-outside-toplevel) +backtrader/analyzers/pyfolio.py:122:14: R1734: Consider using [] instead of list() (use-list-literal) +************* Module backtrader.backtrader.brokers +backtrader/brokers/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.brokers.bbroker +backtrader/brokers/bbroker.py:1:0: C0302: Too many lines in module (1440/1000) (too-many-lines) +backtrader/brokers/bbroker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/brokers/bbroker.py:32:0: E0401: Unable to import 'backtrader.order' (import-error) +backtrader/brokers/bbroker.py:32:0: E0611: No name 'order' in module 'backtrader' (no-name-in-module) +backtrader/brokers/bbroker.py:33:0: E0401: Unable to import 'backtrader.position' (import-error) +backtrader/brokers/bbroker.py:33:0: E0611: No name 'position' in module 'backtrader' (no-name-in-module) +backtrader/brokers/bbroker.py:34:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/brokers/bbroker.py:34:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/brokers/bbroker.py:39:0: R0902: Too many instance attributes (24/7) (too-many-instance-attributes) +backtrader/brokers/bbroker.py:39:17: E1101: Module 'backtrader' has no 'BrokerBase' member (no-member) +backtrader/brokers/bbroker.py:109:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/bbroker.py:115:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/bbroker.py:117:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/bbroker.py:128:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/brokers/bbroker.py:141:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/bbroker.py:148:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/bbroker.py:216:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/bbroker.py:216:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:240:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/bbroker.py:240:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:375:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/brokers/bbroker.py:423:26: W0612: Unused variable 'v' (unused-variable) +backtrader/brokers/bbroker.py:449:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/bbroker.py:467:17: R1721: Unnecessary use of a comprehension, use list(self.pending) instead. (unnecessary-comprehension) +backtrader/brokers/bbroker.py:548:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/bbroker.py:551:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/bbroker.py:672:4: R0913: Too many arguments (16/5) (too-many-arguments) +backtrader/brokers/bbroker.py:672:4: R0917: Too many positional arguments (15/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:672:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/brokers/bbroker.py:733:4: R0913: Too many arguments (16/5) (too-many-arguments) +backtrader/brokers/bbroker.py:733:4: R0917: Too many positional arguments (15/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:733:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/brokers/bbroker.py:794:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/brokers/bbroker.py:794:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:794:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/brokers/bbroker.py:824:11: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/brokers/bbroker.py:825:19: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/brokers/bbroker.py:794:4: R0912: Too many branches (29/12) (too-many-branches) +backtrader/brokers/bbroker.py:794:4: R0915: Too many statements (85/50) (too-many-statements) +backtrader/brokers/bbroker.py:794:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/brokers/bbroker.py:1045:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/bbroker.py:1045:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:1075:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/brokers/bbroker.py:1075:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:1110:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/brokers/bbroker.py:1110:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/brokers/bbroker.py:1110:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/brokers/bbroker.py:1188:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/brokers/bbroker.py:1219:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/brokers/bbroker.py:1282:8: W0632: Possible unbalanced tuple unpacking with sequence defined at line 111: left side has 2 labels, right side has 0 values (unbalanced-tuple-unpacking) +backtrader/brokers/bbroker.py:1307:17: W0212: Access to a protected member _dtmaster of a client class (protected-access) +backtrader/brokers/bbroker.py:1331:19: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/brokers/bbroker.py:1313:4: R0912: Too many branches (15/12) (too-many-branches) +backtrader/brokers/bbroker.py:1356:20: W0612: Unused variable 'o' (unused-variable) +backtrader/brokers/bbroker.py:1380:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/bbroker.py:1380:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/brokers/bbroker.py:118:8: W0201: Attribute 'startingcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:302:8: W0201: Attribute 'startingcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:118:28: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:302:28: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:430:12: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:881:16: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:922:16: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:119:8: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:303:8: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:423:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:429:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:120:8: W0201: Attribute '_valuemkt' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:439:8: W0201: Attribute '_valuemkt' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:122:8: W0201: Attribute '_valuelever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:441:8: W0201: Attribute '_valuelever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:123:8: W0201: Attribute '_valuemktlever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:442:8: W0201: Attribute '_valuemktlever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:125:8: W0201: Attribute '_leverage' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:444:8: W0201: Attribute '_leverage' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:126:8: W0201: Attribute '_unrealized' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:445:8: W0201: Attribute '_unrealized' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:128:8: W0201: Attribute 'orders' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:129:8: W0201: Attribute 'pending' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:130:8: W0201: Attribute '_toactivate' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:132:8: W0201: Attribute 'positions' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:133:8: W0201: Attribute 'd_credit' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:134:8: W0201: Attribute 'notifs' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:136:8: W0201: Attribute 'submitted' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:139:8: W0201: Attribute '_pchildren' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:141:8: W0201: Attribute '_ocos' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:142:8: W0201: Attribute '_ocol' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:144:8: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:424:12: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:431:12: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:145:8: W0201: Attribute '_fundshares' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:432:12: W0201: Attribute '_fundshares' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:146:8: W0201: Attribute '_cash_addition' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/bbroker.py:39:0: R0904: Too many public methods (36/20) (too-many-public-methods) +************* Module backtrader.backtrader.brokers.ibbroker +backtrader/brokers/ibbroker.py:1:0: C0302: Too many lines in module (1608/1000) (too-many-lines) +backtrader/brokers/ibbroker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/brokers/ibbroker.py:32:0: E0611: No name 'BrokerBase' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:32:0: E0611: No name 'Order' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:32:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:33:0: E0401: Unable to import 'backtrader.orders.iborder' (import-error) +backtrader/brokers/ibbroker.py:33:0: E0611: No name 'orders' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:34:0: E0401: Unable to import 'backtrader.position' (import-error) +backtrader/brokers/ibbroker.py:34:0: E0611: No name 'position' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:35:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/brokers/ibbroker.py:35:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:36:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/brokers/ibbroker.py:36:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/brokers/ibbroker.py:43:0: C0112: Empty class docstring (empty-docstring) +backtrader/brokers/ibbroker.py:46:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/brokers/ibbroker.py:60:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/brokers/ibbroker.py:43:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/brokers/ibbroker.py:73:0: R0902: Too many instance attributes (34/7) (too-many-instance-attributes) +backtrader/brokers/ibbroker.py:125:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/ibbroker.py:119:0: W0613: Unused argument 'kwargs' (unused-argument) +backtrader/brokers/ibbroker.py:144:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/ibbroker.py:154:22: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/brokers/ibbroker.py:167:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/ibbroker.py:175:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/ibbroker.py:176:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/ibbroker.py:181:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:195:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:201:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:269:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:269:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:293:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:293:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:333:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:336:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:344:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:347:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:392:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:385:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/brokers/ibbroker.py:425:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:439:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/brokers/ibbroker.py:487:26: W0612: Unused variable 'v' (unused-variable) +backtrader/brokers/ibbroker.py:520:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:513:32: W0613: Unused argument 'clone' (unused-argument) +backtrader/brokers/ibbroker.py:593:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:596:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/ibbroker.py:717:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:737:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/ibbroker.py:747:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:747:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:747:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/brokers/ibbroker.py:777:11: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/brokers/ibbroker.py:778:19: W0212: Access to a protected member _compensate of a client class (protected-access) +backtrader/brokers/ibbroker.py:747:4: R0912: Too many branches (29/12) (too-many-branches) +backtrader/brokers/ibbroker.py:747:4: R0915: Too many statements (85/50) (too-many-statements) +backtrader/brokers/ibbroker.py:747:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/brokers/ibbroker.py:998:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:998:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:1028:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:1028:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:1063:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/brokers/ibbroker.py:1063:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/brokers/ibbroker.py:1063:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/brokers/ibbroker.py:1141:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/brokers/ibbroker.py:1172:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/brokers/ibbroker.py:1235:8: W0632: Possible unbalanced tuple unpacking with sequence defined at line 127: left side has 2 labels, right side has 0 values (unbalanced-tuple-unpacking) +backtrader/brokers/ibbroker.py:1246:17: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1249:28: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1251:13: W1116: Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type) +backtrader/brokers/ibbroker.py:1252:17: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1260:17: W0212: Access to a protected member _dtmaster of a client class (protected-access) +backtrader/brokers/ibbroker.py:1284:19: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/brokers/ibbroker.py:1294:25: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1296:36: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1298:21: W1116: Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type) +backtrader/brokers/ibbroker.py:1299:25: E1101: Class 'datetime' has no 'datetime' member (no-member) +backtrader/brokers/ibbroker.py:1266:4: R0912: Too many branches (15/12) (too-many-branches) +backtrader/brokers/ibbroker.py:1309:20: W0612: Unused variable 'o' (unused-variable) +backtrader/brokers/ibbroker.py:1333:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:1333:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/brokers/ibbroker.py:1420:15: W0212: Access to a protected member _willexpire of a client class (protected-access) +backtrader/brokers/ibbroker.py:1396:4: R0912: Too many branches (15/12) (too-many-branches) +backtrader/brokers/ibbroker.py:1473:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/brokers/ibbroker.py:1548:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/brokers/ibbroker.py:1486:27: E1123: Unexpected keyword argument 'contract' in method call (unexpected-keyword-arg) +backtrader/brokers/ibbroker.py:1486:27: E1120: No value for argument 'data' in method call (no-value-for-parameter) +backtrader/brokers/ibbroker.py:1549:16: W0212: Access to a protected member _logger of a client class (protected-access) +backtrader/brokers/ibbroker.py:1551:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/ibbroker.py:1608:16: W0212: Access to a protected member _willexpire of a client class (protected-access) +backtrader/brokers/ibbroker.py:145:8: W0201: Attribute 'startingcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:360:12: W0201: Attribute 'startingcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:145:28: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:339:12: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:360:32: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:494:12: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:834:16: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:875:16: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:145:40: W0201: Attribute 'validcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:350:12: W0201: Attribute 'validcash' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:146:8: W0201: Attribute 'startingvalue' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:146:29: W0201: Attribute 'value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:434:12: W0201: Attribute 'value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:148:8: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:361:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:487:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:493:12: W0201: Attribute '_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:149:8: W0201: Attribute '_valuemkt' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:503:8: W0201: Attribute '_valuemkt' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:151:8: W0201: Attribute '_valuelever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:505:8: W0201: Attribute '_valuelever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:152:8: W0201: Attribute '_valuemktlever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:506:8: W0201: Attribute '_valuemktlever' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:154:8: W0201: Attribute 'orders' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:155:8: W0201: Attribute 'pending' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:156:8: W0201: Attribute '_toactivate' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:158:8: W0201: Attribute 'positions' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:179:8: W0201: Attribute 'positions' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:159:8: W0201: Attribute 'd_credit' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:160:8: W0201: Attribute 'notifs' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:162:8: W0201: Attribute 'submitted' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:165:8: W0201: Attribute '_pchildren' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:167:8: W0201: Attribute '_ocos' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:168:8: W0201: Attribute '_ocol' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:170:8: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:488:12: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:495:12: W0201: Attribute '_fundval' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:171:8: W0201: Attribute '_fundshares' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:496:12: W0201: Attribute '_fundshares' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:172:8: W0201: Attribute '_cash_addition' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:174:8: W0201: Attribute '_lock_orders' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:175:8: W0201: Attribute 'orderbyid' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:176:8: W0201: Attribute 'executions' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:177:8: W0201: Attribute 'ordstatus' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:178:8: W0201: Attribute 'tonotify' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:508:8: W0201: Attribute '_leverage' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:509:8: W0201: Attribute '_unrealized' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/ibbroker.py:73:0: R0904: Too many public methods (39/20) (too-many-public-methods) +************* Module backtrader.backtrader.brokers.oandabroker +backtrader/brokers/oandabroker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/brokers/oandabroker.py:30:0: E0611: No name 'BrokerBase' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:30:0: E0611: No name 'BuyOrder' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:30:0: E0611: No name 'Order' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:30:0: E0611: No name 'SellOrder' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:36:0: E0401: Unable to import 'backtrader.comminfo' (import-error) +backtrader/brokers/oandabroker.py:36:0: E0611: No name 'comminfo' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:37:0: E0401: Unable to import 'backtrader.position' (import-error) +backtrader/brokers/oandabroker.py:37:0: E0611: No name 'position' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:38:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/brokers/oandabroker.py:38:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:39:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/brokers/oandabroker.py:39:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/brokers/oandabroker.py:42:0: C0112: Empty class docstring (empty-docstring) +backtrader/brokers/oandabroker.py:66:0: C0112: Empty class docstring (empty-docstring) +backtrader/brokers/oandabroker.py:69:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/brokers/oandabroker.py:66:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/brokers/oandabroker.py:82:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes) +backtrader/brokers/oandabroker.py:102:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/oandabroker.py:110:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/oandabroker.py:116:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/oandabroker.py:118:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/oandabroker.py:120:40: W0612: Unused variable 'cash' (unused-variable) +backtrader/brokers/oandabroker.py:199:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/oandabroker.py:201:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/oandabroker.py:204:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/oandabroker.py:210:23: W0613: Unused argument 'datas' (unused-argument) +backtrader/brokers/oandabroker.py:227:29: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/brokers/oandabroker.py:339:4: R0914: Too many local variables (21/15) (too-many-locals) +backtrader/brokers/oandabroker.py:339:0: W0613: Unused argument 'kwargs' (unused-argument) +backtrader/brokers/oandabroker.py:422:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/brokers/oandabroker.py:442:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/brokers/oandabroker.py:442:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/brokers/oandabroker.py:442:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/brokers/oandabroker.py:452:8: W0613: Unused argument 'oco' (unused-argument) +backtrader/brokers/oandabroker.py:497:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/brokers/oandabroker.py:497:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/brokers/oandabroker.py:497:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/brokers/oandabroker.py:507:8: W0613: Unused argument 'oco' (unused-argument) +backtrader/brokers/oandabroker.py:558:8: W0104: Statement seems to have no effect (pointless-statement) +backtrader/brokers/oandabroker.py:552:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/brokers/oandabroker.py:572:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/oandabroker.py:579:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.brokers.vcbroker +backtrader/brokers/vcbroker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/brokers/vcbroker.py:32:0: E0611: No name 'BrokerBase' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:32:0: E0611: No name 'BuyOrder' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:32:0: E0611: No name 'Order' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:32:0: E0611: No name 'SellOrder' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:33:0: E0401: Unable to import 'backtrader.comminfo' (import-error) +backtrader/brokers/vcbroker.py:33:0: E0611: No name 'comminfo' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:34:0: E0401: Unable to import 'backtrader.position' (import-error) +backtrader/brokers/vcbroker.py:34:0: E0611: No name 'position' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:35:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/brokers/vcbroker.py:35:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:36:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/brokers/vcbroker.py:36:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/brokers/vcbroker.py:76:0: C0112: Empty class docstring (empty-docstring) +backtrader/brokers/vcbroker.py:79:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/brokers/vcbroker.py:76:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/brokers/vcbroker.py:92:0: R0902: Too many instance attributes (17/7) (too-many-instance-attributes) +backtrader/brokers/vcbroker.py:112:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/vcbroker.py:127:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/brokers/vcbroker.py:163:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:165:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/vcbroker.py:168:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:170:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/brokers/vcbroker.py:173:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:178:23: W0613: Unused argument 'datas' (unused-argument) +backtrader/brokers/vcbroker.py:186:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:198:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:210:33: W0212: Access to a protected member _tradename of a client class (protected-access) +backtrader/brokers/vcbroker.py:222:11: W0212: Access to a protected member _tradename of a client class (protected-access) +backtrader/brokers/vcbroker.py:223:33: W0212: Access to a protected member _tradename of a client class (protected-access) +backtrader/brokers/vcbroker.py:229:20: W0212: Access to a protected member _syminfo of a client class (protected-access) +backtrader/brokers/vcbroker.py:231:31: W0212: Access to a protected member _syminfo of a client class (protected-access) +backtrader/brokers/vcbroker.py:233:4: R0913: Too many arguments (10/5) (too-many-arguments) +backtrader/brokers/vcbroker.py:233:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +backtrader/brokers/vcbroker.py:263:27: W0212: Access to a protected member _tradename of a client class (protected-access) +backtrader/brokers/vcbroker.py:275:33: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/brokers/vcbroker.py:315:8: C0206: Consider iterating with .items() (consider-using-dict-items) +backtrader/brokers/vcbroker.py:233:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/brokers/vcbroker.py:236:8: W0613: Unused argument 'owner' (unused-argument) +backtrader/brokers/vcbroker.py:352:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/brokers/vcbroker.py:352:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/brokers/vcbroker.py:406:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/brokers/vcbroker.py:406:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/brokers/vcbroker.py:482:4: C0103: Method name "OnChangedBalance" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:482:31: C0103: Argument name "Account" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:498:4: C0103: Method name "OnModifiedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:498:30: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:498:30: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:507:4: C0103: Method name "OnCancelledOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:507:31: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:507:31: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:522:4: C0103: Method name "OnTotalExecutedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:522:35: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:522:35: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:530:4: C0103: Method name "OnPartialExecutedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:530:37: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:530:37: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:538:4: C0103: Method name "OnExecutedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:538:30: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:538:4: R0914: Too many local variables (19/15) (too-many-locals) +backtrader/brokers/vcbroker.py:538:30: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:596:4: C0103: Method name "OnOrderInMarket" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:596:30: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:596:30: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:612:4: C0103: Method name "OnNewOrderLocation" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:612:33: C0103: Argument name "Order" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:612:33: W0621: Redefining name 'Order' from outer scope (line 32) (redefined-outer-name) +backtrader/brokers/vcbroker.py:620:4: C0103: Method name "OnChangedOpenPositions" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:620:37: C0103: Argument name "Account" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:631:4: C0103: Method name "OnNewClosedOperations" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:631:36: C0103: Argument name "Account" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:639:4: C0112: Empty method docstring (empty-docstring) +backtrader/brokers/vcbroker.py:639:4: C0103: Method name "OnServerShutDown" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:642:4: C0103: Method name "OnInternalEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/brokers/vcbroker.py:471:8: W0201: Attribute 'trader' defined outside __init__ (attribute-defined-outside-init) +backtrader/brokers/vcbroker.py:92:0: R0904: Too many public methods (24/20) (too-many-public-methods) +************* Module backtrader.backtrader.feeds +backtrader/feeds/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/__init__.py:43:0: C0413: Import "from .btcsv import BacktraderCSVData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:44:0: C0413: Import "from .vchartcsv import VChartCSVData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:45:0: C0413: Import "from .vchartfile import VChartFile" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:46:0: C0413: Import "from .sierrachart import SierraChartCSVData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:47:0: C0413: Import "from .mt4csv import MT4CSVData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:48:0: C0413: Import "from .yahoo import YahooFinanceCSVData, YahooFinanceData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:49:0: C0413: Import "from .vcdata import VCData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:50:0: C0413: Import "from .ibdata import IBData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:51:0: C0413: Import "from .oanda import OandaData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:52:0: C0413: Import "from .pandafeed import PandasData" should be placed at the top of the module (wrong-import-position) +backtrader/feeds/__init__.py:53:0: C0413: Import "from .csvgeneric import GenericCSVData" should be placed at the top of the module (wrong-import-position) +************* Module backtrader.backtrader.feeds.fakefeed +backtrader/feeds/fakefeed.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/fakefeed.py:11:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/fakefeed.py:11:15: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/fakefeed.py:14:4: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/fakefeed.py:36:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/fakefeed.py:49:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/fakefeed.py:51:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/fakefeed.py:56:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/fakefeed.py:67:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/feeds/fakefeed.py:69:33: E1101: Module 'backtrader' has no 'date2num' member (no-member) +backtrader/feeds/fakefeed.py:84:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/feeds/fakefeed.py:84:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/feeds/fakefeed.py:94:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/feeds/fakefeed.py:96:33: E1101: Module 'backtrader' has no 'date2num' member (no-member) +backtrader/feeds/fakefeed.py:124:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/feeds/fakefeed.py:143:17: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:145:19: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:147:19: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:149:19: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:166:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/feeds/fakefeed.py:194:25: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:194:47: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:196:26: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:202:26: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:204:16: W0719: Raising too general exception: Exception (broad-exception-raised) +backtrader/feeds/fakefeed.py:214:12: W0719: Raising too general exception: Exception (broad-exception-raised) +backtrader/feeds/fakefeed.py:231:17: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:234:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/feeds/fakefeed.py:240:21: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:244:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/fakefeed.py:251:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/feeds/fakefeed.py:258:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +************* Module backtrader.backtrader.feeds.chainer +backtrader/feeds/chainer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/chainer.py:31:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/feeds/chainer.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/feeds/chainer.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/feeds/chainer.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/chainer.py:34:18: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/chainer.py:37:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/chainer.py:48:4: E0213: Method 'donew' should have "self" as first argument (no-self-argument) +backtrader/feeds/chainer.py:59:31: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/feeds/chainer.py:60:33: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/feeds/chainer.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/feeds/chainer.py:65:14: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +backtrader/feeds/chainer.py:65:45: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/chainer.py:84:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/chainer.py:86:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/chainer.py:89:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/feeds/chainer.py:96:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/chainer.py:98:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/chainer.py:102:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/chainer.py:113:19: W0212: Access to a protected member _gettz of a client class (protected-access) +backtrader/feeds/chainer.py:114:15: E1101: Module 'backtrader' has no 'utils' member (no-member) +backtrader/feeds/chainer.py:92:8: W0201: Attribute '_ds' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/chainer.py:93:8: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/chainer.py:120:16: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/chainer.py:94:8: W0201: Attribute '_lastdt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/chainer.py:128:12: W0201: Attribute '_lastdt' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.csvgeneric +backtrader/feeds/csvgeneric.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/csvgeneric.py:31:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/csvgeneric.py:52:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/csvgeneric.py:54:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/csvgeneric.py:102:16: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/csvgeneric.py:107:12: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/csvgeneric.py:69:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/feeds/csvgeneric.py:56:8: W0201: Attribute '_dtstr' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/csvgeneric.py:58:12: W0201: Attribute '_dtstr' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/csvgeneric.py:62:16: W0201: Attribute '_dtconvert' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/csvgeneric.py:64:16: W0201: Attribute '_dtconvert' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/csvgeneric.py:67:12: W0201: Attribute '_dtconvert' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/csvgeneric.py:132:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.feeds.ibdata +backtrader/feeds/ibdata.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/ibdata.py:33:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:33:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:33:0: E0611: No name 'num2date' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:34:0: E0401: Unable to import 'backtrader.commissions.ibcommission' (import-error) +backtrader/feeds/ibdata.py:34:0: E0611: No name 'commissions' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:35:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/ibdata.py:35:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:36:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/feeds/ibdata.py:36:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:37:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/feeds/ibdata.py:37:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/feeds/ibdata.py:45:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/ibdata.py:48:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/ibdata.py:45:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/feeds/ibdata.py:245:8: C0103: Attribute name "constractStartDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/ibdata.py:469:12: C0103: Attribute name "constractStartDateUTC" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/ibdata.py:64:0: R0902: Too many instance attributes (18/7) (too-many-instance-attributes) +backtrader/feeds/ibdata.py:205:19: E1101: Module 'backtrader' has no 'utils' member (no-member) +backtrader/feeds/ibdata.py:211:12: C0415: Import outside toplevel (pytz) (import-outside-toplevel) +backtrader/feeds/ibdata.py:249:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/ibdata.py:284:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/ibdata.py:410:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/ibdata.py:431:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/ibdata.py:450:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/feeds/ibdata.py:455:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/ibdata.py:507:49: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:509:51: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:502:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/feeds/ibdata.py:528:49: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:530:51: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:535:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/ibdata.py:547:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/ibdata.py:539:29: W0613: Unused argument 'step' (unused-argument) +backtrader/feeds/ibdata.py:552:33: C0103: Argument name "hasNewBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/ibdata.py:569:16: W0104: Statement seems to have no effect (pointless-statement) +backtrader/feeds/ibdata.py:590:12: R1724: Unnecessary "elif" after "continue", remove the leading "el" from "elif" (no-else-continue) +backtrader/feeds/ibdata.py:598:27: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/feeds/ibdata.py:623:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/feeds/ibdata.py:669:61: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:671:63: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:733:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/feeds/ibdata.py:756:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:584:4: R0911: Too many return statements (15/6) (too-many-return-statements) +backtrader/feeds/ibdata.py:584:4: R0912: Too many branches (47/12) (too-many-branches) +backtrader/feeds/ibdata.py:584:4: R0915: Too many statements (117/50) (too-many-statements) +backtrader/feeds/ibdata.py:816:34: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/ibdata.py:433:8: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:508:12: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:510:12: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:512:12: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:434:8: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:691:16: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:817:16: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:825:16: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:436:8: W0201: Attribute '_usertvol' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:440:12: W0201: Attribute '_usertvol' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:442:8: W0201: Attribute 'contract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:467:12: W0201: Attribute 'contract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:443:8: W0201: Attribute 'contractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:468:12: W0201: Attribute 'contractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:444:8: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:483:12: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:491:16: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:445:8: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:484:12: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:492:16: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:448:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:452:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:713:16: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:731:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:772:16: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:778:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:848:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:854:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:861:8: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:453:8: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:610:20: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:631:20: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:637:24: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:644:24: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:653:24: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:714:16: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:857:8: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:454:8: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:520:8: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:603:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:614:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:630:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:642:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:651:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:735:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:740:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:745:20: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:455:8: W0201: Attribute '_storedmsg' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:469:12: W0201: Attribute 'constractStartDateUTC' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/ibdata.py:42:0: C0411: third party import "dateutil.relativedelta.relativedelta" should be placed before first party imports "backtrader", "backtrader.TimeFrame", "backtrader.commissions.ibcommission.IBCommInfo", "backtrader.feed.DataBase", "backtrader.stores.ibstore_insync", "backtrader.utils.py3.integer_types" (wrong-import-order) +************* Module backtrader.backtrader.feeds.influxfeed +backtrader/feeds/influxfeed.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/influxfeed.py:31:0: R0402: Use 'from backtrader import feed' instead (consider-using-from-import) +backtrader/feeds/influxfeed.py:31:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/influxfeed.py:31:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/influxfeed.py:33:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/influxfeed.py:37:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:38:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:39:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:40:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:41:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:42:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:47:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/influxfeed.py:61:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/influxfeed.py:71:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/influxfeed.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/influxfeed.py:75:23: E0602: Undefined variable 'idbclient' (undefined-variable) +backtrader/feeds/influxfeed.py:82:15: E0602: Undefined variable 'InfluxDBClientError' (undefined-variable) +backtrader/feeds/influxfeed.py:83:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/influxfeed.py:85:13: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/influxfeed.py:93:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/influxfeed.py:98:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/influxfeed.py:118:15: E0602: Undefined variable 'InfluxDBClientError' (undefined-variable) +backtrader/feeds/influxfeed.py:119:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/influxfeed.py:126:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/influxfeed.py:75:12: W0201: Attribute 'ndb' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/influxfeed.py:121:8: W0201: Attribute 'biter' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/influxfeed.py:47:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.feeds.oanda +backtrader/feeds/oanda.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/oanda.py:30:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/oanda.py:30:0: E0611: No name 'num2date' in module 'backtrader' (no-name-in-module) +backtrader/feeds/oanda.py:31:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/oanda.py:31:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/oanda.py:32:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/feeds/oanda.py:32:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/feeds/oanda.py:33:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/feeds/oanda.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/feeds/oanda.py:39:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/oanda.py:42:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/oanda.py:39:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/feeds/oanda.py:101:8: C0103: Attribute name "_candleFormat" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/oanda.py:57:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/feeds/oanda.py:110:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/oanda.py:119:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/oanda.py:123:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/oanda.py:145:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/feeds/oanda.py:200:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/oanda.py:203:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/oanda.py:213:12: R1724: Unnecessary "elif" after "continue", remove the leading "el" from "elif" (no-else-continue) +backtrader/feeds/oanda.py:303:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/feeds/oanda.py:315:16: R1724: Unnecessary "else" after "continue", remove the "else" and de-indent the code inside it (no-else-continue) +backtrader/feeds/oanda.py:207:4: R0911: Too many return statements (12/6) (too-many-return-statements) +backtrader/feeds/oanda.py:207:4: R0912: Too many branches (28/12) (too-many-branches) +backtrader/feeds/oanda.py:207:4: R0915: Too many statements (76/50) (too-many-statements) +backtrader/feeds/oanda.py:122:8: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:185:12: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:187:12: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:298:16: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:123:8: W0201: Attribute '_storedmsg' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:124:8: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:183:8: W0201: Attribute 'qlive' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:125:8: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:134:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:140:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:144:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:148:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:180:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:192:8: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:227:24: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:239:24: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:245:24: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:297:16: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:306:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:312:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:324:24: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:328:16: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:334:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:348:20: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:137:8: W0201: Attribute 'contractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:151:8: W0201: Attribute '_reconns' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:194:12: W0201: Attribute '_reconns' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:253:16: W0201: Attribute '_reconns' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:170:12: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/oanda.py:287:16: W0201: Attribute 'qhist' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.quandl +backtrader/feeds/quandl.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/quandl.py:34:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/quandl.py:35:0: E0611: No name 'ProxyHandler' in module 'backtrader.backtrader.utils.py3' (no-name-in-module) +backtrader/feeds/quandl.py:35:0: E0611: No name 'build_opener' in module 'backtrader.backtrader.utils.py3' (no-name-in-module) +backtrader/feeds/quandl.py:35:0: E0611: No name 'install_opener' in module 'backtrader.backtrader.utils.py3' (no-name-in-module) +backtrader/feeds/quandl.py:35:0: E0611: No name 'urlopen' in module 'backtrader.backtrader.utils.py3' (no-name-in-module) +backtrader/feeds/quandl.py:35:0: E0611: No name 'urlquote' in module 'backtrader.backtrader.utils.py3' (no-name-in-module) +backtrader/feeds/quandl.py:85:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/quandl.py:87:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/quandl.py:89:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/feeds/quandl.py:89:15: E1101: Instance of 'tuple' has no 'reverse' member (no-member) +backtrader/feeds/quandl.py:117:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/quandl.py:127:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/quandl.py:137:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/quandl.py:138:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/quandl.py:139:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/quandl.py:140:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/quandl.py:141:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/quandl.py:204:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/quandl.py:208:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/quandl.py:217:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/quandl.py:221:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/quandl.py:225:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/quandl.py:243:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/quandl.py:246:11: E1101: Instance of 'tuple' has no 'buffered' member (no-member) +backtrader/feeds/quandl.py:256:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/quandl.py:206:8: W0201: Attribute 'error' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/quandl.py:238:12: W0201: Attribute 'error' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/quandl.py:243:12: W0201: Attribute 'error' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.rollover +backtrader/feeds/rollover.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/rollover.py:33:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/rollover.py:33:19: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/rollover.py:36:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/rollover.py:47:4: E0213: Method 'donew' should have "self" as first argument (no-self-argument) +backtrader/feeds/rollover.py:58:31: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/feeds/rollover.py:59:33: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/feeds/rollover.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/feeds/rollover.py:64:15: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +backtrader/feeds/rollover.py:64:47: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/rollover.py:123:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/rollover.py:125:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/rollover.py:128:12: W0212: Access to a protected member _start of a client class (protected-access) +backtrader/feeds/rollover.py:136:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/rollover.py:138:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/rollover.py:149:19: W0212: Access to a protected member _gettz of a client class (protected-access) +backtrader/feeds/rollover.py:150:15: E1101: Module 'backtrader' has no 'utils' member (no-member) +backtrader/feeds/rollover.py:176:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/feeds/rollover.py:131:8: W0201: Attribute '_ds' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:132:8: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:184:20: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:187:20: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:215:20: W0201: Attribute '_d' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:133:8: W0201: Attribute '_dexp' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:203:20: W0201: Attribute '_dexp' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:214:20: W0201: Attribute '_dexp' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/rollover.py:134:8: W0201: Attribute '_dts' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.vcdata +backtrader/feeds/vcdata.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/vcdata.py:31:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vcdata.py:31:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vcdata.py:32:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/vcdata.py:32:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vcdata.py:33:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/feeds/vcdata.py:33:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vcdata.py:34:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/feeds/vcdata.py:34:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vcdata.py:42:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/vcdata.py:45:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/vcdata.py:42:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/feeds/vcdata.py:645:16: C0103: Attribute name "_TOFFSET" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:60:0: R0902: Too many instance attributes (20/7) (too-many-instance-attributes) +backtrader/feeds/vcdata.py:221:19: E1101: Module 'backtrader' has no 'utils' member (no-member) +backtrader/feeds/vcdata.py:230:12: C0415: Import outside toplevel (pytz) (import-outside-toplevel) +backtrader/feeds/vcdata.py:254:23: E1101: Module 'backtrader' has no 'utils' member (no-member) +backtrader/feeds/vcdata.py:203:4: R0911: Too many return statements (9/6) (too-many-return-statements) +backtrader/feeds/vcdata.py:203:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/feeds/vcdata.py:305:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/vcdata.py:314:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/vcdata.py:339:8: W0212: Access to a protected member _rtdata of a client class (protected-access) +backtrader/feeds/vcdata.py:360:24: W0212: Access to a protected member _ticking of a client class (protected-access) +backtrader/feeds/vcdata.py:361:34: W0212: Access to a protected member _symboldata of a client class (protected-access) +backtrader/feeds/vcdata.py:397:21: W0212: Access to a protected member _directdata of a client class (protected-access) +backtrader/feeds/vcdata.py:411:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/vcdata.py:413:12: W0212: Access to a protected member _canceldirectdata of a client class (protected-access) +backtrader/feeds/vcdata.py:424:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vcdata.py:444:22: W0212: Access to a protected member _RT_SHUTDOWN of a client class (protected-access) +backtrader/feeds/vcdata.py:448:22: W0212: Access to a protected member _RT_DISCONNECTED of a client class (protected-access) +backtrader/feeds/vcdata.py:452:22: W0212: Access to a protected member _RT_CONNECTED of a client class (protected-access) +backtrader/feeds/vcdata.py:457:22: W0212: Access to a protected member _RT_LIVE of a client class (protected-access) +backtrader/feeds/vcdata.py:462:22: W0212: Access to a protected member _RT_DELAYED of a client class (protected-access) +backtrader/feeds/vcdata.py:472:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/vcdata.py:505:4: C0103: Method name "OnNewDataSerieBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:505:32: C0103: Argument name "DataSerie" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:519:27: W0212: Access to a protected member _RT_DELAYED of a client class (protected-access) +backtrader/feeds/vcdata.py:524:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/vcdata.py:531:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/vcdata.py:536:31: W0212: Access to a protected member _RT_LIVE of a client class (protected-access) +backtrader/feeds/vcdata.py:549:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vcdata.py:564:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/feeds/vcdata.py:563:12: W0612: Unused variable 'idx' (unused-variable) +backtrader/feeds/vcdata.py:580:7: W0125: Using a conditional statement with a constant value (using-constant-test) +backtrader/feeds/vcdata.py:582:8: C0103: Method name "OnInternalEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:599:12: W0212: Access to a protected member _vcrt_connection of a client class (protected-access) +backtrader/feeds/vcdata.py:599:40: W0212: Access to a protected member _RT_BASEMSG of a client class (protected-access) +backtrader/feeds/vcdata.py:582:42: W0613: Unused argument 'p3' (unused-argument) +backtrader/feeds/vcdata.py:601:4: C0103: Method name "OnNewTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:601:25: C0103: Argument name "ArrayTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/feeds/vcdata.py:624:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/vcdata.py:667:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/vcdata.py:593:21: E0203: Access to member 'lastconn' before its definition line 596 (access-member-before-definition) +backtrader/feeds/vcdata.py:316:8: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:333:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:345:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:407:12: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:318:8: W0201: Attribute '_newticks' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:630:16: W0201: Attribute '_newticks' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:320:8: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:539:16: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:542:16: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:557:12: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:568:16: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:572:12: W0201: Attribute '_pingtmout' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:322:8: W0201: Attribute 'idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:547:8: W0201: Attribute 'idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:323:8: W0201: Attribute 'q' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:397:12: W0201: Attribute 'q' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:326:8: W0201: Attribute '_mktoffset' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:377:8: W0201: Attribute '_mktoffset' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:327:8: W0201: Attribute '_mktoff1' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:382:8: W0201: Attribute '_mktoff1' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:328:8: W0201: Attribute '_mktoffdiff' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:391:8: W0201: Attribute '_mktoffdiff' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:338:8: W0201: Attribute 'qrt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:351:12: W0201: Attribute '_tf' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:355:12: W0201: Attribute '_tf' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:351:22: W0201: Attribute '_comp' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:355:22: W0201: Attribute '_comp' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:360:8: W0201: Attribute '_ticking' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:361:8: W0201: Attribute '_syminfo' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:422:8: W0201: Attribute '_serie' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vcdata.py:596:12: W0201: Attribute 'lastconn' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.vchart +backtrader/feeds/vchart.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/vchart.py:33:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/vchart.py:53:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vchart.py:55:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/vchart.py:90:21: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/feeds/vchart.py:92:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vchart.py:98:4: R0914: Too many local variables (18/15) (too-many-locals) +backtrader/feeds/vchart.py:122:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/vchart.py:125:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/vchart.py:126:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/vchart.py:127:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/vchart.py:128:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/vchart.py:129:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/vchart.py:130:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/vchart.py:58:8: W0201: Attribute 'ext' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:70:20: W0201: Attribute 'ext' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:72:20: W0201: Attribute 'ext' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:75:12: W0201: Attribute 'barsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:80:12: W0201: Attribute 'barsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:76:12: W0201: Attribute 'dtsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:79:12: W0201: Attribute 'dtsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:77:12: W0201: Attribute 'barfmt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:81:12: W0201: Attribute 'barfmt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:83:8: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:86:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:90:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:96:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchart.py:135:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/vchart.py:140:35: W0212: Access to a protected member _gettuple of a client class (protected-access) +backtrader/feeds/vchart.py:140:35: E1101: Instance of 'tuple' has no '_gettuple' member (no-member) +backtrader/feeds/vchart.py:153:12: E1101: Instance of 'VChartFeed' has no 'p' member (no-member) +backtrader/feeds/vchart.py:161:20: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/feeds/vchart.py:161:20: E1101: Instance of 'VChartFeed' has no 'p' member (no-member) +************* Module backtrader.backtrader.feeds.vchartcsv +backtrader/feeds/vchartcsv.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/vchartcsv.py:31:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/vchartcsv.py:44:16: R1735: Consider using '{"I": TimeFrame.Minutes, "D": TimeFrame.Days, "W": TimeFrame.Weeks, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/vchartcsv.py:84:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/vchartcsv.py:85:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/vchartcsv.py:86:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/vchartcsv.py:87:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/vchartcsv.py:88:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/vchartcsv.py:89:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/vchartcsv.py:90:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/vchartcsv.py:95:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.feeds.vchartfile +backtrader/feeds/vchartfile.py:78:13: W0511: FIXME: find reference to tick counter for format (fixme) +backtrader/feeds/vchartfile.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/vchartfile.py:33:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/vchartfile.py:36:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/vchartfile.py:36:21: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/vchartfile.py:39:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/feeds/vchartfile.py:51:8: E1101: Module 'backtrader' has no 'stores' member (no-member) +backtrader/feeds/vchartfile.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/feeds/vchartfile.py:54:17: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +backtrader/feeds/vchartfile.py:54:51: E1101: Module 'backtrader' has no 'DataBase' member (no-member) +backtrader/feeds/vchartfile.py:66:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vchartfile.py:68:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/vchartfile.py:70:26: E1101: Module 'backtrader' has no 'stores' member (no-member) +backtrader/feeds/vchartfile.py:76:30: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/vchartfile.py:79:32: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/vchartfile.py:101:21: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/feeds/vchartfile.py:105:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/vchartfile.py:111:4: R0914: Too many local variables (18/15) (too-many-locals) +backtrader/feeds/vchartfile.py:128:15: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/feeds/vchartfile.py:69:11: E0203: Access to member '_store' before its definition line 70 (access-member-before-definition) +backtrader/feeds/vchartfile.py:70:12: W0201: Attribute '_store' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:81:12: W0201: Attribute '_dtsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:87:12: W0201: Attribute '_dtsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:82:12: W0201: Attribute '_barsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:86:12: W0201: Attribute '_barsize' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:83:12: W0201: Attribute '_barfmt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:88:12: W0201: Attribute '_barfmt' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:101:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:103:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:109:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:119:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:123:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/vchartfile.py:129:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.feeds.yahoo +backtrader/feeds/yahoo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/yahoo.py:36:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/yahoo.py:96:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/yahoo.py:98:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/yahoo.py:100:15: E1101: Instance of 'tuple' has no 'reverse' member (no-member) +backtrader/feeds/yahoo.py:114:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/feeds/yahoo.py:141:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/yahoo.py:146:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/yahoo.py:154:15: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/feeds/yahoo.py:163:11: E1101: Instance of 'tuple' has no 'adjclose' member (no-member) +backtrader/feeds/yahoo.py:181:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/yahoo.py:182:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/yahoo.py:183:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/yahoo.py:184:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/yahoo.py:185:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/yahoo.py:186:8: E1101: Instance of 'tuple' has no 'adjclose' member (no-member) +backtrader/feeds/yahoo.py:201:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/yahoo.py:257:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/yahoo.py:260:12: C0415: Import outside toplevel (requests) (import-outside-toplevel) +backtrader/feeds/yahoo.py:267:12: W0707: Consider explicitly re-raising using 'except ImportError as exc' and 'raise Exception(msg) from exc' (raise-missing-from) +backtrader/feeds/yahoo.py:267:12: W0719: Raising too general exception: Exception (broad-exception-raised) +backtrader/feeds/yahoo.py:271:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/yahoo.py:278:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:287:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:293:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:296:12: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/yahoo.py:297:12: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/yahoo.py:298:12: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/feeds/yahoo.py:301:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:304:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:310:35: E1101: Instance of 'LookupDict' has no 'ok' member (no-member) +backtrader/feeds/yahoo.py:316:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/feeds/yahoo.py:323:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/feeds/yahoo.py:308:12: W0612: Unused variable 'i' (unused-variable) +backtrader/feeds/yahoo.py:330:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/yahoo.py:335:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/yahoo.py:269:8: W0201: Attribute 'error' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/yahoo.py:316:16: W0201: Attribute 'error' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/yahoo.py:338:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/yahoo.py:343:13: W0212: Access to a protected member _gettuple of a client class (protected-access) +backtrader/feeds/yahoo.py:343:13: E1101: Instance of 'tuple' has no '_gettuple' member (no-member) +************* Module backtrader.backtrader.feeds.btcsv +backtrader/feeds/btcsv.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/btcsv.py:31:0: E0401: Unable to import 'backtrader.stores' (import-error) +backtrader/feeds/btcsv.py:31:0: E0611: No name 'stores' in module 'backtrader' (no-name-in-module) +backtrader/feeds/btcsv.py:34:0: E0611: No name 'date2num' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/feeds/btcsv.py:64:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/btcsv.py:65:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/btcsv.py:66:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/btcsv.py:67:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/btcsv.py:68:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/btcsv.py:69:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/btcsv.py:70:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/btcsv.py:75:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/btcsv.py:81:0: R0902: Too many instance attributes (11/7) (too-many-instance-attributes) +backtrader/feeds/btcsv.py:112:4: W0231: __init__ method from base class 'CSVDataBase' is not called (super-init-not-called) +backtrader/feeds/btcsv.py:134:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/btcsv.py:135:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/btcsv.py:136:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/btcsv.py:137:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/btcsv.py:138:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/btcsv.py:139:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/btcsv.py:140:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/btcsv.py:151:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/btcsv.py:239:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/btcsv.py:249:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/btcsv.py:241:8: W0201: Attribute 'contract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:261:12: W0201: Attribute 'contract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:242:8: W0201: Attribute 'contractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:262:12: W0201: Attribute 'contractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:243:8: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:278:12: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:286:16: W0201: Attribute 'tradecontract' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:244:8: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:279:12: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:287:16: W0201: Attribute 'tradecontractdetails' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:246:8: W0201: Attribute '_state' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:247:8: W0201: Attribute '_statelivereconn' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:248:8: W0201: Attribute '_subcription_valid' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:249:8: W0201: Attribute '_storedmsg' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/btcsv.py:300:0: C0112: Empty class docstring (empty-docstring) +backtrader/feeds/btcsv.py:328:8: E1101: Instance of 'tuple' has no 'datetime' member (no-member) +backtrader/feeds/btcsv.py:329:8: E1101: Instance of 'tuple' has no 'open' member (no-member) +backtrader/feeds/btcsv.py:330:8: E1101: Instance of 'tuple' has no 'high' member (no-member) +backtrader/feeds/btcsv.py:331:8: E1101: Instance of 'tuple' has no 'low' member (no-member) +backtrader/feeds/btcsv.py:332:8: E1101: Instance of 'tuple' has no 'close' member (no-member) +backtrader/feeds/btcsv.py:333:8: E1101: Instance of 'tuple' has no 'volume' member (no-member) +backtrader/feeds/btcsv.py:334:8: E1101: Instance of 'tuple' has no 'openinterest' member (no-member) +backtrader/feeds/btcsv.py:339:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.backtrader.feeds.blaze +backtrader/feeds/blaze.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/blaze.py:28:0: R0402: Use 'from backtrader import feed' instead (consider-using-from-import) +backtrader/feeds/blaze.py:28:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/blaze.py:28:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/blaze.py:29:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/blaze.py:70:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/blaze.py:72:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/blaze.py:75:8: W0201: Attribute '_rows' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/blaze.py:32:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.feeds.mt4csv +backtrader/feeds/mt4csv.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.feeds.pandafeed +backtrader/feeds/pandafeed.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/feeds/pandafeed.py:30:0: W0622: Redefining built-in 'filter' (redefined-builtin) +backtrader/feeds/pandafeed.py:28:0: R0402: Use 'from backtrader import feed' instead (consider-using-from-import) +backtrader/feeds/pandafeed.py:28:0: E0401: Unable to import 'backtrader.feed' (import-error) +backtrader/feeds/pandafeed.py:28:0: E0611: No name 'feed' in module 'backtrader' (no-name-in-module) +backtrader/feeds/pandafeed.py:29:0: E0611: No name 'date2num' in module 'backtrader' (no-name-in-module) +backtrader/feeds/pandafeed.py:30:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/feeds/pandafeed.py:30:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/feeds/pandafeed.py:71:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/pandafeed.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/pandafeed.py:76:8: W0201: Attribute '_rows' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/pandafeed.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/feeds/pandafeed.py:162:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/pandafeed.py:172:27: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/feeds/pandafeed.py:175:27: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/feeds/pandafeed.py:177:8: R1702: Too many nested blocks (6/5) (too-many-nested-blocks) +backtrader/feeds/pandafeed.py:219:4: C0112: Empty method docstring (empty-docstring) +backtrader/feeds/pandafeed.py:221:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/feeds/pandafeed.py:230:23: R1721: Unnecessary use of a comprehension, use list(self.p.dataname.columns.values) instead. (unnecessary-comprehension) +backtrader/feeds/pandafeed.py:224:8: W0201: Attribute '_idx' defined outside __init__ (attribute-defined-outside-init) +backtrader/feeds/pandafeed.py:119:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.feeds.sierrachart +backtrader/feeds/sierrachart.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.indicators +backtrader/indicators/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.indicators.basicops +backtrader/indicators/basicops.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/basicops.py:32:0: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/indicators/basicops.py:32:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/indicators/basicops.py:49:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/basicops.py:68:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:108:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:191:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:265:12: W0212: Access to a protected member _evalfunc of a client class (protected-access) +backtrader/indicators/basicops.py:324:12: W0212: Access to a protected member _evalfunc of a client class (protected-access) +backtrader/indicators/basicops.py:384:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:388:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:439:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:484:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:486:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:489:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:491:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:503:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:545:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:551:8: E1101: Instance of 'str' has no 'incminperiod' member (no-member) +backtrader/indicators/basicops.py:553:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/basicops.py:599:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +backtrader/indicators/basicops.py:601:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/basicops.py:603:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.indicators.crossover +backtrader/indicators/crossover.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/crossover.py:28:0: E0611: No name 'And' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/crossover.py:46:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/crossover.py:50:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/crossover.py:55:31: W0613: Unused argument 'end' (unused-argument) +backtrader/indicators/crossover.py:88:15: R1735: Consider using '{"plotymargin": 0.05, "plotyhlines": [0.0, 1.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/crossover.py:81:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/crossover.py:104:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/crossover.py:121:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/crossover.py:160:15: R1735: Consider using '{"plotymargin": 0.05, "plotyhlines": [-1.0, 1.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/crossover.py:164:18: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/crossover.py:165:20: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/crossover.py:138:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.mabase +backtrader/indicators/mabase.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/mabase.py:32:0: R0205: Class 'MovingAverage' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/indicators/mabase.py:32:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/mabase.py:81:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicators/mabase.py:84:4: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/indicators/mabase.py:81:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/mabase.py:87:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicators/mabase.py:93:4: C0202: Class method __new__ should have 'cls' as first argument (bad-classmethod-argument) +backtrader/indicators/mabase.py:103:14: E1121: Too many positional arguments for classmethod call (too-many-function-args) +backtrader/indicators/mabase.py:87:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/mabase.py:111:0: C0112: Empty class docstring (empty-docstring) +backtrader/indicators/mabase.py:111:0: E1139: Invalid metaclass 'MetaMovAvBase' used (invalid-metaclass) +backtrader/indicators/mabase.py:115:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/mabase.py:111:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.percentchange +backtrader/indicators/percentchange.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/percentchange.py:44:16: R1735: Consider using '{"pctchange": dict(_name='%change')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/percentchange.py:44:31: R1735: Consider using '{"_name": '%change'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/percentchange.py:52:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/percentchange.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/percentchange.py:30:28: E0603: Undefined variable name 'PctChange' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.percentrank +backtrader/indicators/percentrank.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/percentrank.py:30:0: E0611: No name 'BaseApplyN' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/percentrank.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/percentrank.py:32:26: E0603: Undefined variable name 'PctRank' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.rsi +backtrader/indicators/rsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/rsi.py:28:0: E0611: No name 'DivZeroByZero' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/rsi.py:28:0: E0611: No name 'Max' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/rsi.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/rsi.py:53:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/rsi.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:78:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/rsi.py:56:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:106:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/rsi.py:81:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:134:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/rsi.py:109:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:204:16: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/rsi.py:204:16: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/rsi.py:205:18: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/rsi.py:205:18: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/rsi.py:216:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/rsi.py:137:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:232:0: C0103: Class name "RSI_Safe" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/rsi.py:232:15: E0602: Undefined variable 'RSI' (undefined-variable) +backtrader/indicators/rsi.py:232:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:245:0: C0103: Class name "RSI_SMA" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/rsi.py:245:14: E0602: Undefined variable 'RSI' (undefined-variable) +backtrader/indicators/rsi.py:245:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/rsi.py:259:0: C0103: Class name "RSI_EMA" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/rsi.py:259:14: E0602: Undefined variable 'RSI' (undefined-variable) +backtrader/indicators/rsi.py:259:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.vortex +backtrader/indicators/vortex.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/vortex.py:31:13: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/vortex.py:45:16: R1735: Consider using '{"vi_plus": dict(_name='+VI'), "vi_minus": dict(_name='-VI')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/vortex.py:45:29: R1735: Consider using '{"_name": '+VI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/vortex.py:45:57: R1735: Consider using '{"_name": '-VI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/vortex.py:50:18: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/vortex.py:53:19: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/vortex.py:59:13: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/vortex.py:59:25: E1101: Module 'backtrader' has no 'Max' member (no-member) +backtrader/indicators/vortex.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.accdecoscillator +backtrader/indicators/accdecoscillator.py:46:0: C0301: Line too long (102/100) (line-too-long) +backtrader/indicators/accdecoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/accdecoscillator.py:30:0: E0611: No name 'AwesomeOscillator' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/accdecoscillator.py:30:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/accdecoscillator.py:35:41: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/accdecoscillator.py:59:16: R1735: Consider using '{"accde": dict(_method='bar', alpha=0.5, width=1.0)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/accdecoscillator.py:59:27: R1735: Consider using '{"_method": 'bar', "alpha": 0.5, "width": 1.0}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/accdecoscillator.py:65:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/accdecoscillator.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/accdecoscillator.py:32:49: E0603: Undefined variable name 'AccDeOsc' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.aroon +backtrader/indicators/aroon.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/aroon.py:28:0: E0611: No name 'FindFirstIndexHighest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/aroon.py:28:0: E0611: No name 'FindFirstIndexLowest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/aroon.py:53:15: R1735: Consider using '{"plotymargin": 0.05, "plotyhlines": [0, 100]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/aroon.py:79:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/aroon.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/aroon.py:110:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/aroon.py:82:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/aroon.py:143:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/aroon.py:115:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/aroon.py:148:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/aroon.py:200:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/aroon.py:207:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/aroon.py:176:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/aroon.py:212:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.atr +backtrader/indicators/atr.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/atr.py:28:0: E0611: No name 'Max' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/atr.py:28:0: E0611: No name 'Min' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/atr.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/atr.py:52:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/atr.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/atr.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/atr.py:55:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/atr.py:105:24: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/atr.py:105:46: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/atr.py:106:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/atr.py:79:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/atr.py:138:38: E0602: Undefined variable 'TR' (undefined-variable) +backtrader/indicators/atr.py:139:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/atr.py:109:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.awesomeoscillator +backtrader/indicators/awesomeoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/awesomeoscillator.py:30:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/awesomeoscillator.py:35:24: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/awesomeoscillator.py:61:16: R1735: Consider using '{"ao": dict(_method='bar', alpha=0.5, width=1.0)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/awesomeoscillator.py:61:24: R1735: Consider using '{"_method": 'bar', "alpha": 0.5, "width": 1.0}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/awesomeoscillator.py:70:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/awesomeoscillator.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/awesomeoscillator.py:32:32: E0603: Undefined variable name 'AwesomeOsc' in __all__ (undefined-all-variable) +backtrader/indicators/awesomeoscillator.py:32:46: E0603: Undefined variable name 'AO' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.bollinger +backtrader/indicators/bollinger.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/bollinger.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/bollinger.py:28:0: E0611: No name 'StdDev' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/bollinger.py:59:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:60:16: R1735: Consider using '{"mid": dict(ls='--'), "top": dict(_samecolor=True), "bot": dict(_samecolor=True), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:61:12: R1735: Consider using '{"ls": '--'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:62:12: R1735: Consider using '{"_samecolor": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:63:12: R1735: Consider using '{"_samecolor": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:81:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/bollinger.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/bollinger.py:88:16: R1735: Consider using '{"pctb": dict(_name='%B')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:88:26: R1735: Consider using '{"_name": '%B'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/bollinger.py:92:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/bollinger.py:84:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.cci +backtrader/indicators/cci.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/cci.py:28:0: E0611: No name 'MeanDev' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/cci.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/cci.py:81:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/cci.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.dema +backtrader/indicators/dema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/dema.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dema.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dema.py:61:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/dema.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/dema.py:98:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/dema.py:64:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.deviation +backtrader/indicators/deviation.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/deviation.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/deviation.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/deviation.py:85:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.dma +backtrader/indicators/dma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/dma.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dma.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dma.py:28:0: E0611: No name 'ZeroLagIndicator' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dma.py:75:20: W0212: Access to a protected member _movav of a client class (protected-access) +backtrader/indicators/dma.py:76:20: W0212: Access to a protected member _hma of a client class (protected-access) +backtrader/indicators/dma.py:92:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/dma.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.dpo +backtrader/indicators/dpo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/dpo.py:29:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/dpo.py:59:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/dpo.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/dpo.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.dv2 +backtrader/indicators/dv2.py:41:0: C0301: Line too long (127/100) (line-too-long) +backtrader/indicators/dv2.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/dv2.py:58:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/dv2.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.ema +backtrader/indicators/ema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/ema.py:28:0: E0611: No name 'ExponentialSmoothing' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/ema.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/ema.py:58:8: E1137: 'self.lines' does not support item assignment (unsupported-assignment-operation) +backtrader/indicators/ema.py:64:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/ema.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.envelope +backtrader/indicators/envelope.py:48:0: C0301: Line too long (108/100) (line-too-long) +backtrader/indicators/envelope.py:102:0: C0301: Line too long (108/100) (line-too-long) +backtrader/indicators/envelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/envelope.py:30:0: E0611: No name 'MovingAverage' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/envelope.py:33:0: R0205: Class 'EnvelopeMixIn' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/indicators/envelope.py:58:16: R1735: Consider using '{"top": dict(_samecolor=True), "bot": dict(_samecolor=True)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:59:12: R1735: Consider using '{"_samecolor": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:60:12: R1735: Consider using '{"_samecolor": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:67:15: E1101: Instance of 'EnvelopeMixIn' has no 'p' member (no-member) +backtrader/indicators/envelope.py:72:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/envelope.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/envelope.py:81:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:84:16: R1735: Consider using '{"src": dict(_plotskip=True)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:84:25: R1735: Consider using '{"_plotskip": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/envelope.py:89:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/envelope.py:75:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/envelope.py:92:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/envelope.py:110:13: W0212: Access to a protected member _movavs of a client class (protected-access) +backtrader/indicators/envelope.py:111:4: C0103: Constant name "_newclsdoc" doesn't conform to UPPER_CASE naming style (invalid-name) +backtrader/indicators/envelope.py:127:15: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/indicators/envelope.py:143:4: C0103: Class name "newcls" doesn't conform to PascalCase naming style (invalid-name) +************* Module backtrader.backtrader.indicators.hadelta +backtrader/indicators/hadelta.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/hadelta.py:30:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/hadelta.py:35:0: C0103: Class name "haDelta" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/hadelta.py:35:14: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/hadelta.py:64:15: R1735: Consider using '{"subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/hadelta.py:66:16: R1735: Consider using '{"haDelta": dict(color='red'), "smoothed": dict(color='grey', _fill_gt=(0, 'green'), _fill_lt=(0, 'red')), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/hadelta.py:67:16: R1735: Consider using '{"color": 'red'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/hadelta.py:68:17: R1735: Consider using '{"color": 'grey', "_fill_gt": (0, 'green'), "_fill_lt": (0, 'red'), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/hadelta.py:73:12: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/hadelta.py:77:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/hadelta.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/hadelta.py:32:22: E0603: Undefined variable name 'haD' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.heikinashi +backtrader/indicators/heikinashi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/heikinashi.py:33:17: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/heikinashi.py:75:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/heikinashi.py:88:25: E1101: Module 'backtrader' has no 'Max' member (no-member) +backtrader/indicators/heikinashi.py:89:24: E1101: Module 'backtrader' has no 'Min' member (no-member) +backtrader/indicators/heikinashi.py:91:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/heikinashi.py:93:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/heikinashi.py:96:8: E1101: Instance of 'tuple' has no 'ha_open' member (no-member) +backtrader/indicators/heikinashi.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.hma +backtrader/indicators/hma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/hma.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/hma.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/hma.py:69:46: E1101: Instance of 'tuple' has no 'period' member (no-member) +backtrader/indicators/hma.py:70:53: E1101: Instance of 'tuple' has no 'period' member (no-member) +backtrader/indicators/hma.py:72:25: E1101: Instance of 'tuple' has no 'period' member (no-member) +backtrader/indicators/hma.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/hma.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.hurst +backtrader/indicators/hurst.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/hurst.py:28:0: E0611: No name 'PeriodN' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/hurst.py:84:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/hurst.py:88:20: E0602: Undefined variable 'asarray' (undefined-variable) +backtrader/indicators/hurst.py:89:25: E0602: Undefined variable 'log10' (undefined-variable) +backtrader/indicators/hurst.py:91:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/hurst.py:94:13: E0602: Undefined variable 'asarray' (undefined-variable) +backtrader/indicators/hurst.py:97:15: E0602: Undefined variable 'sqrt' (undefined-variable) +backtrader/indicators/hurst.py:97:20: E0602: Undefined variable 'std' (undefined-variable) +backtrader/indicators/hurst.py:97:24: E0602: Undefined variable 'subtract' (undefined-variable) +backtrader/indicators/hurst.py:100:15: E0602: Undefined variable 'polyfit' (undefined-variable) +backtrader/indicators/hurst.py:100:39: E0602: Undefined variable 'log10' (undefined-variable) +backtrader/indicators/hurst.py:103:8: E1101: Instance of 'tuple' has no 'hurst' member (no-member) +backtrader/indicators/hurst.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/hurst.py:30:28: E0603: Undefined variable name 'Hurst' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.ichimoku +backtrader/indicators/ichimoku.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/ichimoku.py:30:0: E0611: No name 'Highest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/ichimoku.py:30:0: E0611: No name 'Lowest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/ichimoku.py:33:15: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/ichimoku.py:72:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/ichimoku.py:73:16: R1735: Consider using '{"senkou_span_a": dict(_fill_gt=('senkou_span_b', 'g'), _fill_lt=('senkou_span_b', 'r')), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/ichimoku.py:74:22: R1735: Consider using '{"_fill_gt": ('senkou_span_b', 'g'), "_fill_lt": ('senkou_span_b', 'r'), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/ichimoku.py:99:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/ichimoku.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.kama +backtrader/indicators/kama.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/kama.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/kama.py:77:20: E1101: Instance of 'AdaptiveMovingAverage' has no 'data' member (no-member) +backtrader/indicators/kama.py:77:32: E1101: Instance of 'AdaptiveMovingAverage' has no 'data' member (no-member) +backtrader/indicators/kama.py:77:43: E1101: Instance of 'AdaptiveMovingAverage' has no 'p' member (no-member) +backtrader/indicators/kama.py:78:21: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/kama.py:78:21: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/kama.py:78:30: E1101: Instance of 'AdaptiveMovingAverage' has no 'data' member (no-member) +backtrader/indicators/kama.py:78:42: E1101: Instance of 'AdaptiveMovingAverage' has no 'data' member (no-member) +backtrader/indicators/kama.py:78:65: E1101: Instance of 'AdaptiveMovingAverage' has no 'p' member (no-member) +backtrader/indicators/kama.py:82:22: E1101: Instance of 'AdaptiveMovingAverage' has no 'p' member (no-member) +backtrader/indicators/kama.py:83:22: E1101: Instance of 'AdaptiveMovingAverage' has no 'p' member (no-member) +backtrader/indicators/kama.py:89:26: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/kama.py:89:26: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/kama.py:89:54: E1101: Instance of 'AdaptiveMovingAverage' has no 'data' member (no-member) +backtrader/indicators/kama.py:89:72: E1101: Instance of 'AdaptiveMovingAverage' has no 'p' member (no-member) +backtrader/indicators/kama.py:85:8: W0612: Unused variable 'sc' (unused-variable) +backtrader/indicators/kama.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.kst +backtrader/indicators/kst.py:47:0: C0301: Line too long (103/100) (line-too-long) +backtrader/indicators/kst.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/kst.py:30:0: E0611: No name 'ROC100' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/kst.py:33:20: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/kst.py:72:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/kst.py:80:21: R1728: Consider using a generator instead 'sum(rfi * rci for (rfi, rci) in zip(self.p.rfactors, [rcma1, rcma2, rcma3, rcma4]))' (consider-using-generator) +backtrader/indicators/kst.py:88:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/kst.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.lrsi +backtrader/indicators/lrsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/lrsi.py:28:0: E0611: No name 'PeriodN' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/lrsi.py:54:15: R1735: Consider using '{"plotymargin": 0.15, "plotyticks": [0.0, 0.2, 0.5, 0.8, 1.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/lrsi.py:58:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/lrsi.py:88:8: E1101: Instance of 'tuple' has no 'lrsi' member (no-member) +backtrader/indicators/lrsi.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/lrsi.py:104:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/lrsi.py:108:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/lrsi.py:119:8: E1101: Instance of 'tuple' has no 'lfilter' member (no-member) +backtrader/indicators/lrsi.py:91:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/lrsi.py:30:26: E0603: Undefined variable name 'LRSI' in __all__ (undefined-all-variable) +backtrader/indicators/lrsi.py:30:52: E0603: Undefined variable name 'LAGF' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.macd +backtrader/indicators/macd.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/macd.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/macd.py:61:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/macd.py:62:16: R1735: Consider using '{"signal": dict(ls='--')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/macd.py:62:28: R1735: Consider using '{"ls": '--'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/macd.py:66:18: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/macd.py:73:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/macd.py:77:41: E1101: Instance of 'tuple' has no 'macd' member (no-member) +backtrader/indicators/macd.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/macd.py:96:16: R1735: Consider using '{"histo": dict(_method='bar', alpha=0.5, width=1.0)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/macd.py:96:27: R1735: Consider using '{"_method": 'bar', "alpha": 0.5, "width": 1.0}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/macd.py:100:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/macd.py:101:27: E1101: Instance of 'tuple' has no 'macd' member (no-member) +backtrader/indicators/macd.py:101:45: E1101: Instance of 'tuple' has no 'signal' member (no-member) +backtrader/indicators/macd.py:80:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.momentum +backtrader/indicators/momentum.py:126:0: C0301: Line too long (115/100) (line-too-long) +backtrader/indicators/momentum.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/momentum.py:47:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/momentum.py:52:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/momentum.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/momentum.py:87:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/momentum.py:55:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/momentum.py:114:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/momentum.py:90:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/momentum.py:141:32: E0602: Undefined variable 'ROC' (undefined-variable) +backtrader/indicators/momentum.py:142:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/momentum.py:117:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.ols +backtrader/indicators/ols.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/ols.py:30:0: E0611: No name 'PeriodN' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/ols.py:35:0: C0103: Class name "OLS_Slope_InterceptN" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/ols.py:56:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/ols.py:58:13: E0602: Undefined variable 'pd' (undefined-variable) +backtrader/indicators/ols.py:59:13: E0602: Undefined variable 'pd' (undefined-variable) +backtrader/indicators/ols.py:60:13: E0602: Undefined variable 'sm' (undefined-variable) +backtrader/indicators/ols.py:61:27: E0602: Undefined variable 'sm' (undefined-variable) +backtrader/indicators/ols.py:63:8: E1101: Instance of 'tuple' has no 'slope' member (no-member) +backtrader/indicators/ols.py:64:8: E1101: Instance of 'tuple' has no 'intercept' member (no-member) +backtrader/indicators/ols.py:35:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/ols.py:67:0: C0103: Class name "OLS_TransformationN" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/ols.py:91:29: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/ols.py:92:28: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/indicators/ols.py:67:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/ols.py:96:0: C0103: Class name "OLS_BetaN" doesn't conform to PascalCase naming style (invalid-name) +backtrader/indicators/ols.py:114:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/ols.py:116:16: E0602: Undefined variable 'pd' (undefined-variable) +backtrader/indicators/ols.py:117:12: E0602: Undefined variable 'smapi' (undefined-variable) +backtrader/indicators/ols.py:119:17: E0602: Undefined variable 'smapi' (undefined-variable) +backtrader/indicators/ols.py:120:8: E1101: Instance of 'tuple' has no 'beta' member (no-member) +backtrader/indicators/ols.py:96:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/ols.py:147:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/ols.py:149:16: E0602: Undefined variable 'pd' (undefined-variable) +backtrader/indicators/ols.py:150:27: E0602: Undefined variable 'coint' (undefined-variable) +backtrader/indicators/ols.py:151:8: E1101: Instance of 'tuple' has no 'score' member (no-member) +backtrader/indicators/ols.py:152:8: E1101: Instance of 'tuple' has no 'pvalue' member (no-member) +backtrader/indicators/ols.py:123:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.oscillator +backtrader/indicators/oscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/oscillator.py:30:0: E0611: No name 'MovingAverage' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/oscillator.py:49:16: R1735: Consider using '{"_0": dict(_name='osc')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/oscillator.py:49:24: R1735: Consider using '{"_name": 'osc'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/oscillator.py:54:20: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/indicators/oscillator.py:55:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/indicators/oscillator.py:55:12: W0212: Access to a protected member _0 of a client class (protected-access) +backtrader/indicators/oscillator.py:62:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/oscillator.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/oscillator.py:90:16: R1735: Consider using '{"_0": dict(_name='osc')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/oscillator.py:90:24: R1735: Consider using '{"_name": 'osc'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/oscillator.py:95:20: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/indicators/oscillator.py:96:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/indicators/oscillator.py:96:12: W0212: Access to a protected member _0 of a client class (protected-access) +backtrader/indicators/oscillator.py:102:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/oscillator.py:111:8: E1137: 'self.lines' does not support item assignment (unsupported-assignment-operation) +backtrader/indicators/oscillator.py:65:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/oscillator.py:116:13: W0212: Access to a protected member _movavs of a client class (protected-access) +backtrader/indicators/oscillator.py:117:4: C0103: Constant name "_newclsdoc" doesn't conform to UPPER_CASE naming style (invalid-name) +backtrader/indicators/oscillator.py:125:15: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/indicators/oscillator.py:141:4: C0103: Class name "newcls" doesn't conform to PascalCase naming style (invalid-name) +************* Module backtrader.backtrader.indicators.pivotpoint +backtrader/indicators/pivotpoint.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/pivotpoint.py:28:0: E0611: No name 'CmpEx' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/pivotpoint.py:78:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/pivotpoint.py:89:11: W0212: Access to a protected member _autoplot of a client class (protected-access) +backtrader/indicators/pivotpoint.py:113:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/pivotpoint.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/pivotpoint.py:164:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/pivotpoint.py:177:11: W0212: Access to a protected member _autoplot of a client class (protected-access) +backtrader/indicators/pivotpoint.py:203:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/pivotpoint.py:120:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/pivotpoint.py:259:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/pivotpoint.py:272:11: W0212: Access to a protected member _autoplot of a client class (protected-access) +backtrader/indicators/pivotpoint.py:288:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/pivotpoint.py:210:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.prettygoodoscillator +backtrader/indicators/prettygoodoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/prettygoodoscillator.py:28:0: E0611: No name 'ATR' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/prettygoodoscillator.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/prettygoodoscillator.py:71:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/prettygoodoscillator.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.priceoscillator +backtrader/indicators/priceoscillator.py:86:0: C0301: Line too long (105/100) (line-too-long) +backtrader/indicators/priceoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/priceoscillator.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/priceoscillator.py:40:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/priceoscillator.py:48:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/priceoscillator.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/priceoscillator.py:51:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/priceoscillator.py:101:16: R1735: Consider using '{"histo": dict(_method='bar', alpha=0.5, width=1.0)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/priceoscillator.py:101:27: R1735: Consider using '{"_method": 'bar', "alpha": 0.5, "width": 1.0}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/priceoscillator.py:105:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/priceoscillator.py:111:27: E1101: Instance of 'tuple' has no 'ppo' member (no-member) +backtrader/indicators/priceoscillator.py:111:44: E1101: Instance of 'tuple' has no 'signal' member (no-member) +backtrader/indicators/priceoscillator.py:73:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/priceoscillator.py:114:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.psar +backtrader/indicators/psar.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/psar.py:28:0: E0611: No name 'PeriodN' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/psar.py:33:0: R0205: Class '_SarStatus' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/indicators/psar.py:44:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/indicators/psar.py:45:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/indicators/psar.py:46:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/indicators/psar.py:47:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/indicators/psar.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/indicators/psar.py:76:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/psar.py:77:16: R1735: Consider using '{"psar": dict(marker='.', markersize=4.0, color='black', fillstyle='full', ls=''), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/psar.py:78:13: R1735: Consider using '{"marker": '.', "markersize": 4.0, "color": 'black', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/psar.py:81:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/psar.py:83:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/indicators/psar.py:92:8: E1101: Instance of 'tuple' has no 'psar' member (no-member) +backtrader/indicators/psar.py:94:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/psar.py:127:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/psar.py:150:8: E1101: Instance of 'tuple' has no 'psar' member (no-member) +backtrader/indicators/psar.py:84:12: W0201: Attribute '_status' defined outside __init__ (attribute-defined-outside-init) +backtrader/indicators/psar.py:101:8: W0201: Attribute '_status' defined outside __init__ (attribute-defined-outside-init) +backtrader/indicators/psar.py:30:27: E0603: Undefined variable name 'PSAR' in __all__ (undefined-all-variable) +************* Module backtrader.backtrader.indicators.rmi +backtrader/indicators/rmi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/rmi.py:28:0: E0611: No name 'RSI' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/rmi.py:61:16: R1735: Consider using '{"rsi": dict(_name='rmi')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/rmi.py:61:25: R1735: Consider using '{"_name": 'rmi'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/rmi.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.sma +backtrader/indicators/sma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/sma.py:28:0: E0611: No name 'Average' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/sma.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/sma.py:53:8: E1137: 'self.lines' does not support item assignment (unsupported-assignment-operation) +backtrader/indicators/sma.py:55:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/sma.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.smma +backtrader/indicators/smma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/smma.py:28:0: E0611: No name 'ExponentialSmoothing' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/smma.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/smma.py:66:8: E1137: 'self.lines' does not support item assignment (unsupported-assignment-operation) +backtrader/indicators/smma.py:69:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/smma.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.stochastic +backtrader/indicators/stochastic.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/stochastic.py:28:0: E0611: No name 'DivByZero' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/stochastic.py:28:0: E0611: No name 'Highest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/stochastic.py:28:0: E0611: No name 'Lowest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/stochastic.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/stochastic.py:48:16: R1735: Consider using '{"percD": dict(_name='%D', ls='--'), "percK": dict(_name='%K')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/stochastic.py:48:27: R1735: Consider using '{"_name": '%D', "ls": '--'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/stochastic.py:48:60: R1735: Consider using '{"_name": '%K'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/stochastic.py:72:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/stochastic.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/stochastic.py:102:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/stochastic.py:75:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/stochastic.py:136:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/stochastic.py:107:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/stochastic.py:162:16: R1735: Consider using '{"percDSlow": dict(_name='%DSlow')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/stochastic.py:162:31: R1735: Consider using '{"_name": '%DSlow'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/stochastic.py:172:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/stochastic.py:141:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.trix +backtrader/indicators/trix.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/trix.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/trix.py:61:15: R1735: Consider using '{"plothlines": [0.0]}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/trix.py:66:20: W0212: Access to a protected member _rocperiod of a client class (protected-access) +backtrader/indicators/trix.py:67:20: W0212: Access to a protected member _movav of a client class (protected-access) +backtrader/indicators/trix.py:80:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/trix.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/trix.py:101:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/trix.py:83:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.tsi +backtrader/indicators/tsi.py:50:0: C0301: Line too long (103/100) (line-too-long) +backtrader/indicators/tsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/tsi.py:30:0: E0611: No name 'EMA' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/tsi.py:33:28: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/tsi.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.ultimateoscillator +backtrader/indicators/ultimateoscillator.py:49:0: C0301: Line too long (103/100) (line-too-long) +backtrader/indicators/ultimateoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/ultimateoscillator.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +backtrader/indicators/ultimateoscillator.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +backtrader/indicators/ultimateoscillator.py:32:25: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +backtrader/indicators/ultimateoscillator.py:88:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/ultimateoscillator.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.williams +backtrader/indicators/williams.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/williams.py:28:0: E0611: No name 'Accum' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'DownDay' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'Highest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'If' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'Lowest' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'TrueHigh' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'TrueLow' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:28:0: E0611: No name 'UpDay' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/williams.py:65:15: R1735: Consider using '{"plotname": 'Williams R%'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/williams.py:66:16: R1735: Consider using '{"percR": dict(_name='R%')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/williams.py:66:27: R1735: Consider using '{"_name": 'R%'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/williams.py:80:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/williams.py:41:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/williams.py:111:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/williams.py:83:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.wma +backtrader/indicators/wma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/wma.py:28:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/indicators/wma.py:29:0: E0611: No name 'AverageWeighted' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/wma.py:29:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/wma.py:60:8: E1137: 'self.lines' does not support item assignment (unsupported-assignment-operation) +backtrader/indicators/wma.py:64:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/wma.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.zlema +backtrader/indicators/zlema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/zlema.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/zlema.py:28:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/zlema.py:59:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/zlema.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.zlind +backtrader/indicators/zlind.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/zlind.py:28:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/indicators/zlind.py:28:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/indicators/zlind.py:30:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/zlind.py:30:0: E0611: No name 'MovingAverageBase' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/zlind.py:75:20: W0212: Access to a protected member _movav of a client class (protected-access) +backtrader/indicators/zlind.py:84:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/zlind.py:86:4: C0112: Empty method docstring (empty-docstring) +backtrader/indicators/zlind.py:91:14: E1101: Instance of 'tuple' has no 'ec' member (no-member) +backtrader/indicators/zlind.py:102:8: E1101: Instance of 'tuple' has no 'ec' member (no-member) +backtrader/indicators/zlind.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.spread +backtrader/indicators/spread.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/spread.py:27:15: R1735: Consider using '{"plot": True, "subplot": True, "plotname": 'Spread', "plotlabels": True, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/spread.py:36:16: R1735: Consider using '{"spread": dict(_name='Spread', color='blue', ls='-', _plotskip=False), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/spread.py:36:28: R1735: Consider using '{"_name": 'Spread', "color": 'blue', "ls": '-', "_plotskip": False, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/spread.py:40:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/spread.py:47:12: R1735: Consider using '{"name": 'buy', "marker": '^', "color": 'g', "markersize": 8, "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/spread.py:59:12: R1735: Consider using '{"name": 'sell', "marker": 'v', "color": 'r', "markersize": 8, "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/spread.py:14:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.directionalmove +backtrader/indicators/directionalmove.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/directionalmove.py:28:0: E0611: No name 'ATR' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/directionalmove.py:28:0: E0611: No name 'And' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/directionalmove.py:28:0: E0611: No name 'DivByZero' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/directionalmove.py:28:0: E0611: No name 'If' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/directionalmove.py:28:0: E0611: No name 'MovAv' in module 'backtrader.backtrader.indicators' (no-name-in-module) +backtrader/indicators/directionalmove.py:52:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:76:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:55:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:124:16: C0103: Attribute name "DIplus" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:134:16: C0103: Attribute name "DIminus" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:98:16: R1735: Consider using '{"plusDI": dict(_name='+DI'), "minusDI": dict(_name='-DI')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:98:28: R1735: Consider using '{"_name": '+DI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:98:55: R1735: Consider using '{"_name": '-DI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:120:12: C0103: Variable name "plusDM" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:121:12: C0103: Variable name "plusDMav" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:130:12: C0103: Variable name "minusDM" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:131:12: C0103: Variable name "minusDMav" doesn't conform to snake_case naming style (invalid-name) +backtrader/indicators/directionalmove.py:138:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:79:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:180:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:141:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:218:15: R1735: Consider using '{"plotname": '+DirectionalIndicator'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:222:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:186:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:259:15: R1735: Consider using '{"plotname": '-DirectionalIndicator'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:263:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:227:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:305:16: R1735: Consider using '{"adx": dict(_name='ADX')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:305:25: R1735: Consider using '{"_name": 'ADX'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:309:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:268:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:361:16: R1735: Consider using '{"adxr": dict(_name='ADXR')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:361:26: R1735: Consider using '{"_name": 'ADXR'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/directionalmove.py:365:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/indicators/directionalmove.py:322:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:370:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/indicators/directionalmove.py:406:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.indicators.contrib +backtrader/indicators/contrib/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/contrib/__init__.py:30:0: C0414: Import alias does not rename original package (useless-import-alias) +backtrader/indicators/contrib/__init__.py:33:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +************* Module backtrader.backtrader.indicators.contrib.vortex +backtrader/indicators/contrib/vortex.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/indicators/contrib/vortex.py:30:0: E0611: No name 'Max' in module 'backtrader.backtrader.indicators.basicops' (no-name-in-module) +backtrader/indicators/contrib/vortex.py:49:16: R1735: Consider using '{"vi_plus": dict(_name='+VI'), "vi_minus": dict(_name='-VI')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/contrib/vortex.py:49:29: R1735: Consider using '{"_name": '+VI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/contrib/vortex.py:49:57: R1735: Consider using '{"_name": '-VI'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/indicators/contrib/vortex.py:51:4: W0231: __init__ method from base class 'Indicator' is not called (super-init-not-called) +backtrader/indicators/contrib/vortex.py:54:18: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/contrib/vortex.py:54:18: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/contrib/vortex.py:57:19: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/contrib/vortex.py:57:19: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +backtrader/indicators/contrib/vortex.py:63:13: E1121: Too many positional arguments for constructor call (too-many-function-args) +backtrader/indicators/contrib/vortex.py:63:13: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +************* Module backtrader.backtrader.observers +backtrader/observers/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.observers.trades +backtrader/observers/trades.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/trades.py:34:0: R0902: Too many instance attributes (16/7) (too-many-instance-attributes) +backtrader/observers/trades.py:49:13: R1735: Consider using '{"pnlcomm": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:51:15: R1735: Consider using '{"plot": True, "subplot": True, "plotname": 'Trades - Net Profit/Loss', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:59:16: R1735: Consider using '{"pnlplus": dict(_name='Positive', ls='', marker='o', color='blue', markersize=8.0, fillstyle='full'), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:60:16: R1735: Consider using '{"_name": 'Positive', "ls": '', "marker": 'o', "color": 'blue', "markersize": 8.0, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:68:17: R1735: Consider using '{"_name": 'Negative', "ls": '', "marker": 'o', "color": 'red', "markersize": 8.0, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:78:4: W0231: __init__ method from base class 'Observer' is not called (super-init-not-called) +backtrader/observers/trades.py:104:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/trades.py:106:21: W0212: Access to a protected member _tradespending of a client class (protected-access) +backtrader/observers/trades.py:116:16: E1101: Instance of 'tuple' has no 'pnlplus' member (no-member) +backtrader/observers/trades.py:118:16: E1101: Instance of 'tuple' has no 'pnlminus' member (no-member) +backtrader/observers/trades.py:121:0: C0112: Empty class docstring (empty-docstring) +backtrader/observers/trades.py:124:4: R0914: Too many local variables (18/15) (too-many-locals) +backtrader/observers/trades.py:131:29: E1101: Super of 'MetaDataTrades' has no 'donew' member (no-member) +backtrader/observers/trades.py:135:27: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/observers/trades.py:137:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/observers/trades.py:141:19: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/observers/trades.py:191:37: E0602: Undefined variable 'base_colors' (undefined-variable) +backtrader/observers/trades.py:192:17: E0602: Undefined variable 'base_colors' (undefined-variable) +backtrader/observers/trades.py:194:19: R1735: Consider using '{"ls": '', "markersize": 8.0, "fillstyle": 'full'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:196:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:202:20: W0212: Access to a protected member _derive of a client class (protected-access) +backtrader/observers/trades.py:209:0: C0112: Empty class docstring (empty-docstring) +backtrader/observers/trades.py:216:15: R1735: Consider using '{"plot": True, "subplot": True, "plothlines": [0.0], "plotymargin": 0.1, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:218:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/trades.py:220:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/trades.py:222:21: W0212: Access to a protected member _tradespending of a client class (protected-access) +backtrader/observers/trades.py:229:23: W0212: Access to a protected member _id of a client class (protected-access) +************* Module backtrader.backtrader.observers.benchmark +backtrader/observers/benchmark.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/benchmark.py:30:0: E0611: No name 'TimeReturn' in module 'backtrader.backtrader.observers' (no-name-in-module) +backtrader/observers/benchmark.py:43:16: R1735: Consider using '{"benchmark": dict(_name='Benchmark')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/benchmark.py:43:31: R1735: Consider using '{"_name": 'Benchmark'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/benchmark.py:55:17: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/observers/benchmark.py:56:22: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/observers/benchmark.py:64:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/observers/benchmark.py:68:43: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/benchmark.py:73:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/benchmark.py:75:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/observers/benchmark.py:76:8: E1101: Instance of 'tuple' has no 'benchmark' member (no-member) +backtrader/observers/benchmark.py:78:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/benchmark.py:81:12: E1003: Bad first argument 'TimeReturn' given to super() (bad-super-call) +backtrader/observers/benchmark.py:80:11: W0212: Access to a protected member _doprenext of a client class (protected-access) +************* Module backtrader.backtrader.observers.broker +backtrader/observers/broker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/broker.py:38:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:40:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:42:8: E1137: 'self.lines[0]' does not support item assignment (unsupported-assignment-operation) +backtrader/observers/broker.py:52:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:54:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:56:8: E1137: 'self.lines[0]' does not support item assignment (unsupported-assignment-operation) +backtrader/observers/broker.py:56:27: W0212: Access to a protected member _valuemkt of a client class (protected-access) +backtrader/observers/broker.py:66:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:68:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:74:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:86:8: E1137: 'self.lines[0]' does not support item assignment (unsupported-assignment-operation) +backtrader/observers/broker.py:70:8: W0201: Attribute '_initial_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:71:8: W0201: Attribute '_cum_return' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:72:8: W0201: Attribute '_prev_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:89:8: W0201: Attribute '_prev_value' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:105:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:107:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:114:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:117:12: E1137: 'self.lines[0]' does not support item assignment (unsupported-assignment-operation) +backtrader/observers/broker.py:119:12: E1137: 'self.lines[0]' does not support item assignment (unsupported-assignment-operation) +backtrader/observers/broker.py:110:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:112:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:136:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:138:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:146:12: W0212: Access to a protected member _plotskip of a client class (protected-access) +backtrader/observers/broker.py:147:12: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/observers/broker.py:149:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:152:12: E1101: Instance of 'tuple' has no 'value' member (no-member) +backtrader/observers/broker.py:153:12: E1101: Instance of 'tuple' has no 'cash' member (no-member) +backtrader/observers/broker.py:155:12: E1101: Instance of 'tuple' has no 'value' member (no-member) +backtrader/observers/broker.py:152:34: W0612: Unused variable 'value' (unused-variable) +backtrader/observers/broker.py:141:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:143:12: W0201: Attribute '_fundmode' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/broker.py:166:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:168:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:170:8: E1101: Instance of 'tuple' has no 'fundval' member (no-member) +backtrader/observers/broker.py:180:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/broker.py:182:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/broker.py:184:8: E1101: Instance of 'tuple' has no 'fundshares' member (no-member) +************* Module backtrader.backtrader.observers.buysell +backtrader/observers/buysell.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/buysell.py:46:15: R1735: Consider using '{"plot": True, "subplot": False, "plotlinelabels": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/buysell.py:47:16: R1735: Consider using '{"buy": dict(marker='^', markersize=8.0, color='lime', fillstyle='full', ls=''), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/buysell.py:48:12: R1735: Consider using '{"marker": '^', "markersize": 8.0, "color": 'lime', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/buysell.py:49:13: R1735: Consider using '{"marker": 'v', "markersize": 8.0, "color": 'red', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/buysell.py:67:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/buysell.py:69:14: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/observers/buysell.py:70:15: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/observers/buysell.py:72:21: W0212: Access to a protected member _orderspending of a client class (protected-access) +backtrader/observers/buysell.py:85:17: E1101: Instance of 'tuple' has no 'buy' member (no-member) +backtrader/observers/buysell.py:86:11: R0124: Redundant comparison - curbuy != curbuy (comparison-with-itself) +backtrader/observers/buysell.py:97:12: E1101: Instance of 'tuple' has no 'buy' member (no-member) +backtrader/observers/buysell.py:98:13: R0124: Redundant comparison - value == value (comparison-with-itself) +backtrader/observers/buysell.py:100:12: E1101: Instance of 'tuple' has no 'buy' member (no-member) +backtrader/observers/buysell.py:107:18: E1101: Instance of 'tuple' has no 'sell' member (no-member) +backtrader/observers/buysell.py:108:11: R0124: Redundant comparison - cursell != cursell (comparison-with-itself) +backtrader/observers/buysell.py:119:12: E1101: Instance of 'tuple' has no 'sell' member (no-member) +backtrader/observers/buysell.py:120:13: R0124: Redundant comparison - value == value (comparison-with-itself) +backtrader/observers/buysell.py:122:12: E1101: Instance of 'tuple' has no 'sell' member (no-member) +backtrader/observers/buysell.py:88:12: W0201: Attribute 'curbuylen' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/buysell.py:104:8: W0201: Attribute 'curbuylen' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/buysell.py:110:12: W0201: Attribute 'curselllen' defined outside __init__ (attribute-defined-outside-init) +backtrader/observers/buysell.py:126:8: W0201: Attribute 'curselllen' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.observers.drawdown +backtrader/observers/drawdown.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/drawdown.py:49:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:51:16: R1735: Consider using '{"maxdrawdown": dict(_plotskip=True)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:52:20: R1735: Consider using '{"_plotskip": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:57:4: W0231: __init__ method from base class 'Observer' is not called (super-init-not-called) +backtrader/observers/drawdown.py:60:50: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/drawdown.py:62:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/drawdown.py:64:8: E1101: Instance of 'tuple' has no 'drawdown' member (no-member) +backtrader/observers/drawdown.py:65:8: E1101: Instance of 'tuple' has no 'maxdrawdown' member (no-member) +backtrader/observers/drawdown.py:82:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:84:16: R1735: Consider using '{"maxlength": dict(_plotskip=True)}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:85:18: R1735: Consider using '{"_plotskip": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/drawdown.py:90:4: W0231: __init__ method from base class 'Observer' is not called (super-init-not-called) +backtrader/observers/drawdown.py:92:50: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/drawdown.py:94:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/drawdown.py:96:8: E1101: Instance of 'tuple' has no 'len' member (no-member) +backtrader/observers/drawdown.py:97:8: E1101: Instance of 'tuple' has no 'maxlen' member (no-member) +************* Module backtrader.backtrader.observers.logreturns +backtrader/observers/logreturns.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/logreturns.py:33:17: E1101: Module 'backtrader' has no 'Observer' member (no-member) +backtrader/observers/logreturns.py:39:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/logreturns.py:50:12: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/observers/logreturns.py:57:12: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/logreturns.py:62:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/logreturns.py:64:8: E1101: Instance of 'tuple' has no 'logret1' member (no-member) +backtrader/observers/logreturns.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/observers/logreturns.py:74:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/observers/logreturns.py:77:12: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/logreturns.py:82:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/logreturns.py:84:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/observers/logreturns.py:85:8: E1101: Instance of 'tuple' has no 'logret2' member (no-member) +backtrader/observers/logreturns.py:67:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.observers.timereturn +backtrader/observers/timereturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/observers/timereturn.py:39:15: R1735: Consider using '{"plot": True, "subplot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/timereturn.py:40:16: R1735: Consider using '{"timereturn": dict(_name='Return')}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/timereturn.py:40:32: R1735: Consider using '{"_name": 'Return'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/observers/timereturn.py:56:4: W0231: __init__ method from base class 'Observer' is not called (super-init-not-called) +backtrader/observers/timereturn.py:59:12: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +backtrader/observers/timereturn.py:62:4: C0112: Empty method docstring (empty-docstring) +backtrader/observers/timereturn.py:64:8: E1101: Instance of 'tuple' has no 'timereturn' member (no-member) +************* Module backtrader.backtrader.plot +backtrader/plot/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/__init__.py:30:0: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise) +backtrader/plot/__init__.py:33:4: W0707: Consider explicitly re-raising using 'except ImportError as exc' and 'raise ImportError('Matplotlib seems to be missing. Needed for plotting support') from exc' (raise-missing-from) +backtrader/plot/__init__.py:35:4: C0103: Constant name "touse" doesn't conform to UPPER_CASE naming style (invalid-name) +backtrader/plot/__init__.py:38:11: W0718: Catching too general exception BaseException (broad-exception-caught) +************* Module backtrader.backtrader.plot.multicursor +backtrader/plot/multicursor.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/multicursor.py:63:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/plot/multicursor.py:66:0: R0205: Class 'Widget' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/multicursor.py:92:21: W0613: Unused argument 'event' (unused-argument) +backtrader/plot/multicursor.py:163:8: C0103: Attribute name "horizOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:164:8: C0103: Attribute name "vertOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:165:8: C0103: Attribute name "horizMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:166:8: C0103: Attribute name "vertMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:103:0: R0902: Too many instance attributes (14/7) (too-many-instance-attributes) +backtrader/plot/multicursor.py:138:8: C0103: Argument name "horizOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:139:8: C0103: Argument name "vertOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:140:8: C0103: Argument name "horizMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:141:8: C0103: Argument name "vertMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:142:8: C0103: Argument name "horizShared" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:143:8: C0103: Argument name "vertShared" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:133:4: R0913: Too many arguments (10/5) (too-many-arguments) +backtrader/plot/multicursor.py:133:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +backtrader/plot/multicursor.py:133:4: R0914: Too many local variables (20/15) (too-many-locals) +backtrader/plot/multicursor.py:329:8: C0103: Attribute name "horizOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:330:8: C0103: Attribute name "vertOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:284:0: R0902: Too many instance attributes (12/7) (too-many-instance-attributes) +backtrader/plot/multicursor.py:312:8: C0103: Argument name "horizOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:313:8: C0103: Argument name "vertOn" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/multicursor.py:307:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/plot/multicursor.py:307:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/plot/multicursor.py:411:22: W0613: Unused argument 'event' (unused-argument) +************* Module backtrader.backtrader.plot.finance +backtrader/plot/finance.py:1:0: C0302: Too many lines in module (1061/1000) (too-many-lines) +backtrader/plot/finance.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/finance.py:33:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/plot/finance.py:33:0: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/plot/finance.py:37:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/finance.py:37:0: R0205: Class 'CandlestickPlotHandler' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/finance.py:37:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/plot/finance.py:45:4: R0913: Too many arguments (21/5) (too-many-arguments) +backtrader/plot/finance.py:45:4: R0917: Too many positional arguments (21/5) (too-many-positional-arguments) +backtrader/plot/finance.py:45:4: R0914: Too many local variables (25/15) (too-many-locals) +backtrader/plot/finance.py:152:28: W0613: Unused argument 'legend' (unused-argument) +backtrader/plot/finance.py:152:36: W0613: Unused argument 'orig_handle' (unused-argument) +backtrader/plot/finance.py:152:49: W0613: Unused argument 'fontsize' (unused-argument) +backtrader/plot/finance.py:188:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/plot/finance.py:188:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/plot/finance.py:188:4: R0914: Too many local variables (38/15) (too-many-locals) +backtrader/plot/finance.py:250:22: W0622: Redefining built-in 'open' (redefined-builtin) +backtrader/plot/finance.py:266:19: W0622: Redefining built-in 'open' (redefined-builtin) +backtrader/plot/finance.py:283:21: W0622: Redefining built-in 'open' (redefined-builtin) +backtrader/plot/finance.py:334:0: R0913: Too many arguments (20/5) (too-many-arguments) +backtrader/plot/finance.py:334:0: R0917: Too many positional arguments (20/5) (too-many-positional-arguments) +backtrader/plot/finance.py:334:0: R0914: Too many local variables (22/15) (too-many-locals) +backtrader/plot/finance.py:412:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/finance.py:412:0: R0205: Class 'VolumePlotHandler' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/finance.py:419:4: R0913: Too many arguments (14/5) (too-many-arguments) +backtrader/plot/finance.py:419:4: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +backtrader/plot/finance.py:419:4: R0914: Too many local variables (19/15) (too-many-locals) +backtrader/plot/finance.py:494:28: W0613: Unused argument 'legend' (unused-argument) +backtrader/plot/finance.py:494:36: W0613: Unused argument 'orig_handle' (unused-argument) +backtrader/plot/finance.py:494:49: W0613: Unused argument 'fontsize' (unused-argument) +backtrader/plot/finance.py:526:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/plot/finance.py:526:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/plot/finance.py:526:4: R0914: Too many local variables (19/15) (too-many-locals) +backtrader/plot/finance.py:591:0: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/plot/finance.py:591:0: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/plot/finance.py:646:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/finance.py:646:0: R0205: Class 'OHLCPlotHandler' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/finance.py:654:4: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/plot/finance.py:654:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/plot/finance.py:654:4: R0914: Too many local variables (20/15) (too-many-locals) +backtrader/plot/finance.py:722:28: W0613: Unused argument 'legend' (unused-argument) +backtrader/plot/finance.py:722:36: W0613: Unused argument 'orig_handle' (unused-argument) +backtrader/plot/finance.py:722:49: W0613: Unused argument 'fontsize' (unused-argument) +backtrader/plot/finance.py:760:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/plot/finance.py:760:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/plot/finance.py:760:4: R0914: Too many local variables (30/15) (too-many-locals) +backtrader/plot/finance.py:837:24: W0622: Redefining built-in 'open' (redefined-builtin) +backtrader/plot/finance.py:881:0: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/plot/finance.py:881:0: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/plot/finance.py:933:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/finance.py:933:0: R0205: Class 'LineOnClosePlotHandler' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/finance.py:938:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/plot/finance.py:938:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/plot/finance.py:977:28: W0613: Unused argument 'legend' (unused-argument) +backtrader/plot/finance.py:977:36: W0613: Unused argument 'orig_handle' (unused-argument) +backtrader/plot/finance.py:977:49: W0613: Unused argument 'fontsize' (unused-argument) +backtrader/plot/finance.py:1003:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/finance.py:1003:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/plot/finance.py:1034:0: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/finance.py:1034:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +************* Module backtrader.backtrader.plot.formatters +backtrader/plot/formatters.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/formatters.py:31:0: E0611: No name 'num2date' in module 'backtrader.backtrader.utils' (no-name-in-module) +backtrader/plot/formatters.py:34:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/formatters.py:66:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/formatters.py:69:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/formatters.py:94:8: R1731: Consider using 'ind = max(ind, 0)' instead of unnecessary if block (consider-using-max-builtin) +backtrader/plot/formatters.py:151:11: R1727: Boolean condition 'False and x < 0' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/plot/formatters.py:144:25: W0613: Unused argument 'pos' (unused-argument) +backtrader/plot/formatters.py:163:17: E1120: No value for argument 'pos' in function call (no-value-for-parameter) +backtrader/plot/formatters.py:163:17: E1120: No value for argument 'type' in function call (no-value-for-parameter) +backtrader/plot/formatters.py:177:25: E1101: Module 'matplotlib.dates' has no 'date_ticker_factory' member (no-member) +************* Module backtrader.backtrader.plot.locator +backtrader/plot/locator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/locator.py:28:0: W0105: String statement has no effect (pointless-string-statement) +backtrader/plot/locator.py:33:0: C0413: Import "import datetime" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:34:0: C0413: Import "import warnings" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:36:0: C0413: Import "import numpy as np" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:37:0: C0413: Import "from dateutil.relativedelta import relativedelta" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:38:0: C0413: Import "from matplotlib.dates import HOURS_PER_DAY, MIN_PER_HOUR, MONTHS_PER_YEAR" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:43:0: C0413: Import "from matplotlib.dates import AutoDateFormatter as ADFormatter" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:44:0: C0413: Import "from matplotlib.dates import AutoDateLocator as ADLocator" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:45:0: C0413: Import "from matplotlib.dates import MicrosecondLocator" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:48:0: C0413: Import "from matplotlib.dates import RRuleLocator as RRLocator" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:49:0: C0413: Import "from matplotlib.dates import num2date, rrulewrapper" should be placed at the top of the module (wrong-import-position) +backtrader/plot/locator.py:71:4: R1731: Consider using 'idx = max(idx, 0)' instead of unnecessary if block (consider-using-max-builtin) +backtrader/plot/locator.py:77:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/locator.py:89:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/plot/locator.py:120:8: C0415: Import outside toplevel (bisect) (import-outside-toplevel) +backtrader/plot/locator.py:122:17: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/plot/locator.py:126:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/locator.py:138:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/plot/locator.py:169:8: C0415: Import outside toplevel (bisect) (import-outside-toplevel) +backtrader/plot/locator.py:171:17: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/plot/locator.py:174:4: R0914: Too many local variables (28/15) (too-many-locals) +backtrader/plot/locator.py:181:8: W0105: String statement has no effect (pointless-string-statement) +backtrader/plot/locator.py:194:8: C0103: Variable name "numYears" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:195:8: C0103: Variable name "numMonths" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:196:8: C0103: Variable name "numDays" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:197:8: C0103: Variable name "numHours" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:198:8: C0103: Variable name "numMinutes" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:199:8: C0103: Variable name "numSeconds" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:200:8: C0103: Variable name "numMicroseconds" doesn't conform to snake_case naming style (invalid-name) +backtrader/plot/locator.py:244:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/locator.py:255:50: W0631: Using possibly undefined loop variable 'interval' (undefined-loop-variable) +backtrader/plot/locator.py:263:15: W0125: Using a conditional statement with a constant value (using-constant-test) +backtrader/plot/locator.py:263:12: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise) +backtrader/plot/locator.py:270:46: W0631: Using possibly undefined loop variable 'i' (undefined-loop-variable) +backtrader/plot/locator.py:297:15: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/plot/locator.py:295:12: E1101: Instance of 'RRuleLocator' has no 'set_view_interval' member (no-member) +backtrader/plot/locator.py:295:12: E1101: Instance of 'MicrosecondLocator' has no 'set_view_interval' member (no-member) +backtrader/plot/locator.py:296:12: E1101: Instance of 'RRuleLocator' has no 'set_data_interval' member (no-member) +backtrader/plot/locator.py:296:12: E1101: Instance of 'MicrosecondLocator' has no 'set_data_interval' member (no-member) +backtrader/plot/locator.py:303:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/plot/locator.py:174:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/plot/locator.py:174:4: R0915: Too many statements (54/50) (too-many-statements) +backtrader/plot/locator.py:309:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/locator.py:322:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/plot/locator.py:336:8: R1731: Consider using 'x = max(x, 0)' instead of unnecessary if block (consider-using-max-builtin) +backtrader/plot/locator.py:341:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +************* Module backtrader.backtrader.plot.plot +backtrader/plot/plot.py:1:0: C0302: Too many lines in module (1283/1000) (too-many-lines) +backtrader/plot/plot.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/plot.py:41:0: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/plot/plot.py:40:0: E0611: No name 'AutoInfoClass' in module 'backtrader.backtrader' (no-name-in-module) +backtrader/plot/plot.py:40:0: E0611: No name 'MetaParams' in module 'backtrader.backtrader' (no-name-in-module) +backtrader/plot/plot.py:40:0: E0611: No name 'date2num' in module 'backtrader.backtrader' (no-name-in-module) +backtrader/plot/plot.py:52:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/plot.py:52:0: R0205: Class 'PInfo' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/plot.py:52:0: R0902: Too many instance attributes (24/7) (too-many-instance-attributes) +backtrader/plot/plot.py:68:20: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:69:23: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:71:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:72:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/plot/plot.py:91:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:288:12: W0201: Attribute 'pstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:288:30: W0201: Attribute 'pend' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:288:46: W0201: Attribute 'psize' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:289:12: W0201: Attribute 'xstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:332:20: W0201: Attribute 'xstart' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:290:12: W0201: Attribute 'xend' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:333:20: W0201: Attribute 'xend' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:293:12: W0201: Attribute 'xreal' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:306:12: W0201: Attribute 'xdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:320:16: W0201: Attribute 'xdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:323:20: W0201: Attribute 'xdata' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:133:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/plot.py:133:0: C0103: Class name "Plot_OldSync" doesn't conform to PascalCase naming style (invalid-name) +backtrader/plot/plot.py:159:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/plot.py:159:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/plot/plot.py:175:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:179:17: R1735: Consider using '{"boxstyle": tag_box_style, "facecolor": facecolor, "edgecolor": edgecolor, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/plot/plot.py:172:8: W0612: Unused variable 'txt' (unused-variable) +backtrader/plot/plot.py:190:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/plot.py:190:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/plot/plot.py:190:4: R0914: Too many local variables (39/15) (too-many-locals) +backtrader/plot/plot.py:215:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/plot/plot.py:223:8: C0415: Import outside toplevel (matplotlib.pyplot) (import-outside-toplevel) +backtrader/plot/plot.py:235:55: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/plot/plot.py:272:18: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:314:37: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/plot/plot.py:326:28: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:190:4: R0912: Too many branches (26/12) (too-many-branches) +backtrader/plot/plot.py:190:4: R0915: Too many statements (86/50) (too-many-statements) +backtrader/plot/plot.py:190:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/plot/plot.py:191:0: W0613: Unused argument 'kwargs' (unused-argument) +backtrader/plot/plot.py:411:50: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/plot/plot.py:411:64: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/plot/plot.py:437:55: E0606: Possibly using variable 'fmtdata' before assignment (possibly-used-before-assignment) +backtrader/plot/plot.py:404:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/plot/plot.py:484:11: W0125: Using a conditional statement with a constant value (using-constant-test) +backtrader/plot/plot.py:529:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/plot.py:529:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/plot/plot.py:529:4: R0914: Too many local variables (50/15) (too-many-locals) +backtrader/plot/plot.py:730:20: W0621: Redefining name 'loc' from outer scope (line 42) (redefined-outer-name) +backtrader/plot/plot.py:543:8: W0104: Statement seems to have no effect (pointless-statement) +backtrader/plot/plot.py:564:24: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/plot/plot.py:565:50: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:570:24: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:572:30: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:579:24: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/plot/plot.py:581:50: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:588:15: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:596:25: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:605:32: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:607:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:609:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/plot/plot.py:610:25: W0212: Access to a protected member _getkwargs of a client class (protected-access) +backtrader/plot/plot.py:613:23: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:617:30: R1735: Consider using '{"aa": True, "label": label}' instead of a call to 'dict'. (use-dict-literal) +backtrader/plot/plot.py:623:36: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:626:15: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:638:19: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/plot/plot.py:644:20: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:646:26: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:664:29: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:673:29: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/plot/plot.py:697:22: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:703:21: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:705:25: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:714:21: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:716:25: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:725:43: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:745:20: W0212: Access to a protected member _legend_box of a client class (protected-access) +backtrader/plot/plot.py:529:4: R0912: Too many branches (38/12) (too-many-branches) +backtrader/plot/plot.py:529:4: R0915: Too many statements (112/50) (too-many-statements) +backtrader/plot/plot.py:726:16: W0612: Unused variable 'handles' (unused-variable) +backtrader/plot/plot.py:751:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/plot/plot.py:751:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/plot/plot.py:751:4: R0914: Too many local variables (24/15) (too-many-locals) +backtrader/plot/plot.py:813:20: W0621: Redefining name 'loc' from outer scope (line 42) (redefined-outer-name) +backtrader/plot/plot.py:833:15: E0606: Possibly using variable 'volplot' before assignment (possibly-used-before-assignment) +backtrader/plot/plot.py:751:38: W0613: Unused argument 'highs' (unused-argument) +backtrader/plot/plot.py:751:45: W0613: Unused argument 'lows' (unused-argument) +backtrader/plot/plot.py:810:25: W0612: Unused variable 'labels' (unused-variable) +backtrader/plot/plot.py:816:20: W0612: Unused variable 'legend' (unused-variable) +backtrader/plot/plot.py:835:4: R0914: Too many local variables (38/15) (too-many-locals) +backtrader/plot/plot.py:1016:12: W0621: Redefining name 'loc' from outer scope (line 42) (redefined-outer-name) +backtrader/plot/plot.py:865:38: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/plot/plot.py:866:25: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/plot/plot.py:871:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:895:39: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/plot/plot.py:895:56: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/plot/plot.py:896:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:896:39: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/plot/plot.py:901:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:914:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/plot/plot.py:936:17: R1727: Boolean condition 'self.pinf.sch.style.startswith('bar') or True' will always evaluate to 'True' (condition-evals-to-constant) +backtrader/plot/plot.py:950:31: E0606: Possibly using variable 'plotted' before assignment (possibly-used-before-assignment) +backtrader/plot/plot.py:953:16: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:965:11: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:1031:12: W0212: Access to a protected member _legend_box of a client class (protected-access) +backtrader/plot/plot.py:1046:11: W0212: Access to a protected member _get of a client class (protected-access) +backtrader/plot/plot.py:835:4: R0912: Too many branches (33/12) (too-many-branches) +backtrader/plot/plot.py:835:4: R0915: Too many statements (99/50) (too-many-statements) +backtrader/plot/plot.py:1050:4: C0112: Empty method docstring (empty-docstring) +backtrader/plot/plot.py:1054:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/plot/plot.py:1054:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/plot/plot.py:1076:25: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/plot/plot.py:1089:30: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/plot/plot.py:1089:49: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/plot/plot.py:1101:12: W0212: Access to a protected member _plotinit of a client class (protected-access) +backtrader/plot/plot.py:1104:26: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/plot/plot.py:1104:45: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/plot/plot.py:1110:20: W0104: Statement seems to have no effect (pointless-statement) +backtrader/plot/plot.py:1113:34: W0212: Access to a protected member _clock of a client class (protected-access) +backtrader/plot/plot.py:1069:4: R0912: Too many branches (19/12) (too-many-branches) +backtrader/plot/plot.py:225:8: W0201: Attribute 'mpyplot' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:227:8: W0201: Attribute 'pinf' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:1076:8: W0201: Attribute 'dplotstop' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:1077:8: W0201: Attribute 'dplotsup' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:1078:8: W0201: Attribute 'dplotsdown' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:1079:8: W0201: Attribute 'dplotsover' defined outside __init__ (attribute-defined-outside-init) +backtrader/plot/plot.py:1282:0: C0103: Class name "plot" doesn't conform to PascalCase naming style (invalid-name) +************* Module backtrader.backtrader.plot.scheme +backtrader/plot/scheme.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/scheme.py:80:0: C0112: Empty class docstring (empty-docstring) +backtrader/plot/scheme.py:80:0: R0205: Class 'PlotScheme' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/plot/scheme.py:80:0: R0902: Too many instance attributes (38/7) (too-many-instance-attributes) +backtrader/plot/scheme.py:80:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.plot.utils +backtrader/plot/utils.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/plot/utils.py:35:0: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/plot/utils.py:35:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/plot/utils.py:35:56: W0613: Unused argument 'mutation_aspect' (unused-argument) +************* Module backtrader.backtrader.stores +backtrader/stores/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.stores.ibstore +backtrader/stores/ibstore.py:1:0: C0302: Too many lines in module (2011/1000) (too-many-lines) +backtrader/stores/ibstore.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/stores/ibstore.py:40:0: W0622: Redefining built-in 'bytes' (redefined-builtin) +backtrader/stores/ibstore.py:37:0: E0611: No name 'Position' in module 'backtrader' (no-name-in-module) +backtrader/stores/ibstore.py:37:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/stores/ibstore.py:38:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/stores/ibstore.py:38:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/stores/ibstore.py:39:0: E0401: Unable to import 'backtrader.utils' (import-error) +backtrader/stores/ibstore.py:39:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/stores/ibstore.py:40:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/stores/ibstore.py:40:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/stores/ibstore.py:63:0: R0205: Class 'RTVolume' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/stores/ibstore.py:101:12: E1101: Instance of 'RTVolume' has no 'datetime' member (no-member) +backtrader/stores/ibstore.py:63:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/ibstore.py:107:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/stores/ibstore.py:118:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/stores/ibstore.py:104:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/ibstore.py:138:4: W0212: Access to a protected member _ibregister of a client class (protected-access) +backtrader/stores/ibstore.py:233:8: C0103: Attribute name "_tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:244:12: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:142:0: R0902: Too many instance attributes (33/7) (too-many-instance-attributes) +backtrader/stores/ibstore.py:180:15: E1102: cls.DataCls is not callable (not-callable) +backtrader/stores/ibstore.py:190:15: E1102: cls.BrokerCls is not callable (not-callable) +backtrader/stores/ibstore.py:194:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/stores/ibstore.py:209:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:218:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:220:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:221:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:222:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:223:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:238:32: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:249:20: E0602: Undefined variable 'ibopt' (undefined-variable) +backtrader/stores/ibstore.py:263:30: E0602: Undefined variable 'ibopt' (undefined-variable) +backtrader/stores/ibstore.py:192:4: R0915: Too many statements (51/50) (too-many-statements) +backtrader/stores/ibstore.py:315:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstore.py:316:24: W0212: Access to a protected member _env of a client class (protected-access) +backtrader/stores/ibstore.py:305:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/stores/ibstore.py:327:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:341:11: W0212: Access to a protected member _debug of a client class (protected-access) +backtrader/stores/ibstore.py:355:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:425:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:428:13: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:437:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:441:13: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:453:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:458:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:468:4: R0912: Too many branches (25/12) (too-many-branches) +backtrader/stores/ibstore.py:468:4: R0915: Too many statements (52/50) (too-many-statements) +backtrader/stores/ibstore.py:573:4: C0103: Method name "connectionClosed" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:573:31: W0613: Unused argument 'msg' (unused-argument) +backtrader/stores/ibstore.py:585:4: C0103: Method name "managedAccounts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:598:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:598:4: C0103: Method name "reqCurrentTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:603:4: C0103: Method name "currentTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:617:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:622:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:622:4: C0103: Method name "nextTickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:628:4: C0103: Method name "nextValidId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:637:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstore.py:637:4: C0103: Method name "nextOrderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:643:4: C0103: Method name "reuseQueue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:643:25: C0103: Argument name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:662:4: C0103: Method name "getTickerQueue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:674:12: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:681:4: C0103: Method name "cancelQueue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:689:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:697:4: C0103: Method name "validQueue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:705:4: C0103: Method name "getContractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:712:14: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/ibstore.py:727:4: C0103: Method name "reqContractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:734:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:739:4: C0103: Method name "contractDetailsEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:748:4: C0103: Method name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:756:4: C0103: Method name "reqHistoricalDataEx" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:764:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:767:8: C0103: Argument name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:756:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/stores/ibstore.py:756:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/stores/ibstore.py:756:4: R0914: Too many local variables (19/15) (too-many-locals) +backtrader/stores/ibstore.py:850:39: R1735: Consider using '{"contract": contract, "enddate": enddate, "begindate": intdate, "timeframe": timeframe, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstore.py:756:4: R0912: Too many branches (14/12) (too-many-branches) +backtrader/stores/ibstore.py:890:4: C0103: Method name "reqHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:897:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:890:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstore.py:890:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstore.py:915:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:945:4: C0103: Method name "cancelHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:955:4: C0103: Method name "reqRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:955:40: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:965:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:974:4: C0103: Method name "cancelRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:981:12: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:987:4: C0103: Method name "reqMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:996:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1010:4: C0103: Method name "cancelMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1017:12: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1024:4: C0103: Method name "tickString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1042:4: C0103: Method name "tickPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1056:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1077:4: C0103: Method name "realtimeBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1091:4: C0103: Method name "historicalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1100:8: C0103: Variable name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1524:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1527:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1531:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1533:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1538:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1540:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1543:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1516:4: R0911: Too many return statements (8/6) (too-many-return-statements) +backtrader/stores/ibstore.py:1591:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1597:32: E0602: Undefined variable 'checkduration' (undefined-variable) +backtrader/stores/ibstore.py:1610:4: R0914: Too many local variables (26/15) (too-many-locals) +backtrader/stores/ibstore.py:1647:17: E0602: Undefined variable 'bisect' (undefined-variable) +backtrader/stores/ibstore.py:1649:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1656:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1662:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstore.py:1668:8: C0103: Variable name "H2" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1668:12: C0103: Variable name "M2" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1668:16: C0103: Variable name "S2" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1668:20: C0103: Variable name "US2" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1669:8: C0103: Variable name "H1" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1669:12: C0103: Variable name "M1" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1669:16: C0103: Variable name "S1" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1669:20: C0103: Variable name "US1" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1677:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstore.py:1688:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstore.py:1688:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstore.py:1712:19: E0602: Undefined variable 'Contract' (undefined-variable) +backtrader/stores/ibstore.py:1727:4: C0103: Method name "cancelOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1735:4: C0103: Method name "placeOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1746:4: C0103: Method name "openOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1755:4: C0103: Method name "execDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1764:4: C0103: Method name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1773:4: C0103: Method name "commissionReport" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1781:4: C0103: Method name "reqPositions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1792:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/stores/ibstore.py:1794:4: C0103: Method name "reqAccountUpdates" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1811:4: C0103: Method name "accountDownloadEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1821:11: W0125: Using a conditional statement with a constant value (using-constant-test) +backtrader/stores/ibstore.py:1811:33: W0613: Unused argument 'msg' (unused-argument) +backtrader/stores/ibstore.py:1828:4: C0103: Method name "updatePortfolio" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1873:4: C0103: Method name "updateAccountValue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstore.py:1919:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstore.py:1959:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstore.py:1999:16: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstore.py:1975:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/stores/ibstore.py:142:0: R0904: Too many public methods (63/20) (too-many-public-methods) +************* Module backtrader.backtrader.stores.oandastore +backtrader/stores/oandastore.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/stores/oandastore.py:35:0: E0401: Unable to import 'oandapy' (import-error) +backtrader/stores/oandastore.py:37:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/stores/oandastore.py:37:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/stores/oandastore.py:38:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/stores/oandastore.py:38:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/stores/oandastore.py:43:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:49:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +backtrader/stores/oandastore.py:48:13: R1735: Consider using '{"code": 599, "message": 'Request Error', "description": ''}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/oandastore.py:43:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/oandastore.py:52:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:62:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +backtrader/stores/oandastore.py:61:13: R1735: Consider using '{"code": 598, "message": 'Failed Streaming', "description": content, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/oandastore.py:52:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/oandastore.py:65:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:75:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +backtrader/stores/oandastore.py:74:13: R1735: Consider using '{"code": 597, "message": 'Not supported TimeFrame', "description": '', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/oandastore.py:68:23: W0613: Unused argument 'content' (unused-argument) +backtrader/stores/oandastore.py:65:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/oandastore.py:78:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:84:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +backtrader/stores/oandastore.py:83:13: R1735: Consider using '{"code": 596, "message": 'Network Error', "description": ''}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/oandastore.py:78:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/oandastore.py:87:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:100:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/oandastore.py:87:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/oandastore.py:130:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/oandastore.py:133:4: W1113: Keyword argument before variable positional arguments list in the definition of __init__ function (keyword-arg-before-vararg) +backtrader/stores/oandastore.py:143:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/stores/oandastore.py:170:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/oandastore.py:195:19: W0718: Catching too general exception BaseException (broad-exception-caught) +backtrader/stores/oandastore.py:159:8: W0201: Attribute 'connected' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/oandastore.py:223:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/stores/oandastore.py:234:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/stores/oandastore.py:220:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/oandastore.py:247:0: R0902: Too many instance attributes (16/7) (too-many-instance-attributes) +backtrader/stores/oandastore.py:272:15: E1102: cls.DataCls is not callable (not-callable) +backtrader/stores/oandastore.py:282:15: E1102: cls.BrokerCls is not callable (not-callable) +backtrader/stores/oandastore.py:286:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/stores/oandastore.py:292:21: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/oandastore.py:322:24: W0212: Access to a protected member _env of a client class (protected-access) +backtrader/stores/oandastore.py:334:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:352:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:355:15: R1721: Unnecessary use of a comprehension, use list(iter(self.notifs.popleft, None)) instead. (unnecessary-comprehension) +backtrader/stores/oandastore.py:359:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:360:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:361:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:362:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:363:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:364:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:365:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:366:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:367:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:368:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:369:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:370:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:371:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:372:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:373:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:374:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:375:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:376:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:377:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:378:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:379:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +backtrader/stores/oandastore.py:382:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:439:39: W0613: Unused argument 'tmout' (unused-argument) +backtrader/stores/oandastore.py:476:8: C0103: Argument name "candleFormat" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/oandastore.py:477:8: C0103: Argument name "includeFirst" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/oandastore.py:469:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/oandastore.py:469:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/oandastore.py:471:8: W0613: Unused argument 'dataname' (unused-argument) +backtrader/stores/oandastore.py:472:8: W0613: Unused argument 'dtbegin' (unused-argument) +backtrader/stores/oandastore.py:473:8: W0613: Unused argument 'dtend' (unused-argument) +backtrader/stores/oandastore.py:474:8: W0613: Unused argument 'timeframe' (unused-argument) +backtrader/stores/oandastore.py:475:8: W0613: Unused argument 'compression' (unused-argument) +backtrader/stores/oandastore.py:476:8: W0613: Unused argument 'candleFormat' (unused-argument) +backtrader/stores/oandastore.py:477:8: W0613: Unused argument 'includeFirst' (unused-argument) +backtrader/stores/oandastore.py:506:8: C0103: Argument name "candleFormat" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/oandastore.py:507:8: C0103: Argument name "includeFirst" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/oandastore.py:499:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/oandastore.py:499:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/oandastore.py:525:16: E1120: No value for argument 'content' in constructor call (no-value-for-parameter) +backtrader/stores/oandastore.py:507:8: W0613: Unused argument 'includeFirst' (unused-argument) +backtrader/stores/oandastore.py:588:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:592:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:597:8: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:598:8: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:599:8: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:600:8: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:603:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/oandastore.py:636:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/stores/oandastore.py:657:18: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/oandastore.py:658:32: W0212: Access to a protected member _dataname of a client class (protected-access) +backtrader/stores/oandastore.py:662:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:672:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:676:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +backtrader/stores/oandastore.py:708:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/stores/oandastore.py:710:16: W0212: Access to a protected member _reject of a client class (protected-access) +backtrader/stores/oandastore.py:715:19: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/stores/oandastore.py:726:16: W0212: Access to a protected member _reject of a client class (protected-access) +backtrader/stores/oandastore.py:730:12: W0212: Access to a protected member _submit of a client class (protected-access) +backtrader/stores/oandastore.py:732:16: W0212: Access to a protected member _accept of a client class (protected-access) +backtrader/stores/oandastore.py:698:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/stores/oandastore.py:767:19: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/stores/oandastore.py:770:12: W0212: Access to a protected member _cancel of a client class (protected-access) +backtrader/stores/oandastore.py:808:15: R1727: Boolean condition 'pid in self._orders and False' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/stores/oandastore.py:835:12: W0104: Statement seems to have no effect (pointless-statement) +backtrader/stores/oandastore.py:867:12: W0212: Access to a protected member _fill of a client class (protected-access) +backtrader/stores/oandastore.py:870:12: W0212: Access to a protected member _accept of a client class (protected-access) +backtrader/stores/oandastore.py:878:16: W0212: Access to a protected member _expire of a client class (protected-access) +backtrader/stores/oandastore.py:880:16: W0212: Access to a protected member _cancel of a client class (protected-access) +backtrader/stores/oandastore.py:882:16: W0212: Access to a protected member _reject of a client class (protected-access) +backtrader/stores/oandastore.py:318:12: W0201: Attribute 'cash' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/oandastore.py:605:8: W0201: Attribute 'q_account' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/oandastore.py:611:8: W0201: Attribute 'q_ordercreate' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/oandastore.py:616:8: W0201: Attribute 'q_orderclose' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/oandastore.py:35:0: C0411: third party import "oandapy" should be placed before first party import "backtrader" (wrong-import-order) +backtrader/stores/oandastore.py:36:0: C0411: third party import "requests" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.backtrader.stores.vchartfile +backtrader/stores/vchartfile.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/stores/vchartfile.py:33:22: E1101: Module 'backtrader' has no 'Store' member (no-member) +backtrader/stores/vchartfile.py:49:8: C0103: Variable name "VC_KEYNAME" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vchartfile.py:50:8: C0103: Variable name "VC_KEYVAL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vchartfile.py:51:8: C0103: Variable name "VC_DATADIR" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vchartfile.py:53:8: C0103: Variable name "VC_NONE" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vchartfile.py:55:8: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/stores/vchartfile.py:55:8: C0415: Import outside toplevel (backtrader.utils.py3.winreg) (import-outside-toplevel) +backtrader/stores/vchartfile.py:55:8: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/stores/vchartfile.py:68:19: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vchartfile.py:74:19: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vchartfile.py:86:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vchartfile.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.stores.vcstore +backtrader/stores/vcstore.py:83:5: W0511: XXX Should there be a way to pass additional event handles which (fixme) +backtrader/stores/vcstore.py:86:5: W0511: XXX XXX XXX (fixme) +backtrader/stores/vcstore.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/stores/vcstore.py:34:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/stores/vcstore.py:35:0: E0401: Unable to import 'backtrader.metabase' (import-error) +backtrader/stores/vcstore.py:35:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +backtrader/stores/vcstore.py:36:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/stores/vcstore.py:36:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/stores/vcstore.py:42:0: R0205: Class '_SymInfo' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/stores/vcstore.py:42:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/vcstore.py:71:0: C0103: Function name "PumpEvents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:111:4: C0103: Variable name "RPC_S_CALLPENDING" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:114:4: C0103: Function name "HandlerRoutine" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:114:23: C0103: Argument name "dwCtrlType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:125:4: C0103: Variable name "HandlerRoutine" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:148:15: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vcstore.py:149:12: R1724: Unnecessary "else" after "continue", remove the "else" and de-indent the code inside it (no-else-continue) +backtrader/stores/vcstore.py:139:12: W0612: Unused variable 'res' (unused-variable) +backtrader/stores/vcstore.py:171:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/vcstore.py:171:0: R0205: Class 'RTEventSink' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/stores/vcstore.py:184:4: C0103: Method name "OnNewTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:184:25: C0103: Argument name "ArrayTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:191:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vcstore.py:191:4: C0103: Method name "OnServerShutDown" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:193:8: W0212: Access to a protected member _vcrt_connection of a client class (protected-access) +backtrader/stores/vcstore.py:193:36: W0212: Access to a protected member _RT_SHUTDOWN of a client class (protected-access) +backtrader/stores/vcstore.py:195:4: C0103: Method name "OnInternalEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:212:8: W0212: Access to a protected member _vcrt_connection of a client class (protected-access) +backtrader/stores/vcstore.py:212:36: W0212: Access to a protected member _RT_BASEMSG of a client class (protected-access) +backtrader/stores/vcstore.py:195:38: W0613: Unused argument 'p3' (unused-argument) +backtrader/stores/vcstore.py:218:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +backtrader/stores/vcstore.py:229:4: E0213: Method '__call__' should have "self" as first argument (no-self-argument) +backtrader/stores/vcstore.py:215:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/vcstore.py:378:12: C0103: Attribute name "CreateObject" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:379:12: C0103: Attribute name "GetEvents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:380:12: C0103: Attribute name "GetModule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/vcstore.py:242:0: R0902: Too many instance attributes (17/7) (too-many-instance-attributes) +backtrader/stores/vcstore.py:279:15: E1102: cls.DataCls is not callable (not-callable) +backtrader/stores/vcstore.py:289:15: E1102: cls.BrokerCls is not callable (not-callable) +backtrader/stores/vcstore.py:315:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vcstore.py:322:8: C0415: Import outside toplevel (_winreg) (import-outside-toplevel) +backtrader/stores/vcstore.py:322:8: E0401: Unable to import '_winreg' (import-error) +backtrader/stores/vcstore.py:333:19: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vcstore.py:339:19: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vcstore.py:372:12: C0415: Import outside toplevel (comtypes) (import-outside-toplevel) +backtrader/stores/vcstore.py:376:12: C0415: Import outside toplevel (comtypes.client.CreateObject, comtypes.client.GetEvents, comtypes.client.GetModule) (import-outside-toplevel) +backtrader/stores/vcstore.py:396:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/vcstore.py:397:24: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/vcstore.py:411:15: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vcstore.py:415:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/vcstore.py:425:15: E0602: Undefined variable 'WindowsError' (undefined-variable) +backtrader/stores/vcstore.py:427:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/vcstore.py:442:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/vcstore.py:469:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vcstore.py:472:15: R1721: Unnecessary use of a comprehension, use list(iter(self.notifs.popleft, None)) instead. (unnecessary-comprehension) +backtrader/stores/vcstore.py:474:20: W0613: Unused argument 'data' (unused-argument) +backtrader/stores/vcstore.py:495:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vcstore.py:497:8: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/stores/vcstore.py:499:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/vcstore.py:583:17: R1735: Consider using '{"data": data, "symbol": symbol}' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/vcstore.py:599:8: W0212: Access to a protected member _vcrt of a client class (protected-access) +backtrader/stores/vcstore.py:632:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/vcstore.py:632:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/vcstore.py:635:8: W0613: Unused argument 'symbol' (unused-argument) +backtrader/stores/vcstore.py:638:8: W0613: Unused argument 'd1' (unused-argument) +backtrader/stores/vcstore.py:639:8: W0613: Unused argument 'd2' (unused-argument) +backtrader/stores/vcstore.py:640:8: W0613: Unused argument 'historical' (unused-argument) +backtrader/stores/vcstore.py:667:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/vcstore.py:667:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/vcstore.py:698:8: W0212: Access to a protected member _setserie of a client class (protected-access) +backtrader/stores/vcstore.py:709:27: W0212: Access to a protected member _getpingtmout of a client class (protected-access) +************* Module backtrader.backtrader.stores.ibstores.client +backtrader/stores/ibstores/client.py:1:0: C0302: Too many lines in module (1660/1000) (too-many-lines) +backtrader/stores/ibstores/client.py:12:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/client.py:83:8: C0103: Attribute name "apiStart" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:84:8: C0103: Attribute name "apiEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:85:8: C0103: Attribute name "apiError" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:86:8: C0103: Attribute name "throttleStart" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:87:8: C0103: Attribute name "throttleEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:95:8: C0103: Attribute name "_priceSizeTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:96:8: C0103: Attribute name "_tcpDataArrived" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:97:8: C0103: Attribute name "_tcpDataProcessed" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:101:8: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:102:8: C0103: Attribute name "optCapab" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:103:8: C0103: Attribute name "connectOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:108:8: C0103: Attribute name "connState" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:109:8: C0103: Attribute name "_apiReady" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:110:8: C0103: Attribute name "_serverVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:112:8: C0103: Attribute name "_hasReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:113:8: C0103: Attribute name "_reqIdSeq" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:115:8: C0103: Attribute name "_startTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:116:8: C0103: Attribute name "_numBytesRecv" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:117:8: C0103: Attribute name "_numMsgRecv" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:118:8: C0103: Attribute name "_isThrottling" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:119:8: C0103: Attribute name "_msgQ" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:120:8: C0103: Attribute name "_timeQ" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:21:0: R0902: Too many instance attributes (30/7) (too-many-instance-attributes) +backtrader/stores/ibstores/client.py:106:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:122:4: C0103: Method name "serverVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:131:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:136:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:136:4: C0103: Method name "isConnected" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:140:4: C0103: Method name "isReady" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:149:4: C0103: Method name "connectionStats" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:167:4: C0103: Method name "getReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:176:8: C0103: Variable name "newId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:180:4: C0103: Method name "updateReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:180:26: C0103: Argument name "minReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:188:4: C0103: Method name "getAccounts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:199:4: C0103: Method name "setConnectOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:199:32: C0103: Argument name "connectOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:213:8: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:233:4: C0103: Method name "connectAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:233:45: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:243:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/client.py:332:4: C0103: Method name "sendMsg" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:374:4: C0103: Method name "_onSocketHasData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:391:12: C0103: Variable name "msgEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:406:25: C0103: Variable name "_connTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:415:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/client.py:420:20: C0103: Variable name "msgId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:422:30: C0103: Variable name "validId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:374:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/stores/ibstores/client.py:438:4: C0103: Method name "_onSocketDisconnected" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:444:8: C0103: Variable name "wasReady" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:464:4: C0103: Method name "reqMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:466:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:468:8: C0103: Argument name "genericTickList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:470:8: C0103: Argument name "regulatorySnapshot" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:471:8: C0103: Argument name "mktDataOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:464:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:464:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:505:4: C0103: Method name "cancelMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:505:28: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:513:4: C0103: Method name "placeOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:513:25: C0103: Argument name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:513:4: R0912: Too many branches (25/12) (too-many-branches) +backtrader/stores/ibstores/client.py:513:4: R0915: Too many statements (64/50) (too-many-statements) +backtrader/stores/ibstores/client.py:743:4: C0103: Method name "cancelOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:743:26: C0103: Argument name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:743:35: C0103: Argument name "manualCancelOrderTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:755:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:755:4: C0103: Method name "reqOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:759:4: C0103: Method name "reqAccountUpdates" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:759:43: C0103: Argument name "acctCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:768:4: C0103: Method name "reqExecutions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:768:28: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:768:35: C0103: Argument name "execFilter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:788:4: C0103: Method name "reqIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:788:21: C0103: Argument name "numIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:796:4: C0103: Method name "reqContractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:796:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:4: C0103: Method name "reqMktDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:43: C0103: Argument name "numRows" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:52: C0103: Argument name "isSmartDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:66: C0103: Argument name "mktDepthOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:816:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:816:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:847:4: C0103: Method name "cancelMktDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:847:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:847:36: C0103: Argument name "isSmartDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:856:4: C0103: Method name "reqNewsBulletins" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:856:31: C0103: Argument name "allMsgs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:864:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:864:4: C0103: Method name "cancelNewsBulletins" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:868:4: C0103: Method name "setServerLogLevel" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:868:32: C0103: Argument name "logLevel" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:876:4: C0103: Method name "reqAutoOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:876:32: C0103: Argument name "bAutoBind" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:884:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:884:4: C0103: Method name "reqAllOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:888:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:888:4: C0103: Method name "reqManagedAccts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:892:4: C0103: Method name "requestFA" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:892:24: C0103: Argument name "faData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:900:4: C0103: Method name "replaceFA" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:900:24: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:900:31: C0103: Argument name "faData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:910:4: C0103: Method name "reqHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:912:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:914:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:915:8: C0103: Argument name "durationStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:916:8: C0103: Argument name "barSizeSetting" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:917:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:918:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:919:8: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:920:8: C0103: Argument name "keepUpToDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:921:8: C0103: Argument name "chartOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:910:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:910:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:959:4: C0103: Method name "exerciseOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:961:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:963:8: C0103: Argument name "exerciseAction" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:964:8: C0103: Argument name "exerciseQuantity" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:959:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:959:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:999:4: C0103: Method name "reqScannerSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1001:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1003:8: C0103: Argument name "scannerSubscriptionOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1004:8: C0103: Argument name "scannerSubscriptionFilterOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1043:4: C0103: Method name "cancelScannerSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1043:40: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1051:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1051:4: C0103: Method name "reqScannerParameters" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1055:4: C0103: Method name "cancelHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1055:35: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1063:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1063:4: C0103: Method name "reqCurrentTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1067:4: C0103: Method name "reqRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1068:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1068:31: C0103: Argument name "barSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1068:40: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1068:52: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1068:60: C0103: Argument name "realTimeBarsOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1067:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1067:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1091:4: C0103: Method name "cancelRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1091:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1099:4: C0103: Method name "reqFundamentalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1099:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1099:50: C0103: Argument name "reportType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1099:62: C0103: Argument name "fundamentalDataOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1125:4: C0103: Method name "cancelFundamentalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1125:36: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1133:4: C0103: Method name "calculateImpliedVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1134:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1134:31: C0103: Argument name "optionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1134:44: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1134:56: C0103: Argument name "implVolOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1133:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1133:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1156:4: C0103: Method name "calculateOptionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1157:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1157:43: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1157:55: C0103: Argument name "optPrcOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1156:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1156:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1179:4: C0103: Method name "cancelCalculateImpliedVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1179:47: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1187:4: C0103: Method name "cancelCalculateOptionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1187:41: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1195:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1195:4: C0103: Method name "reqGlobalCancel" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1199:4: C0103: Method name "reqMarketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1199:32: C0103: Argument name "marketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1207:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1207:4: C0103: Method name "reqPositions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1211:4: C0103: Method name "reqAccountSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1211:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1211:39: C0103: Argument name "groupName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1221:4: C0103: Method name "cancelAccountSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1221:35: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1229:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1229:4: C0103: Method name "cancelPositions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1233:4: C0103: Method name "verifyRequest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1233:28: C0103: Argument name "apiName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1233:37: C0103: Argument name "apiVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1242:4: C0103: Method name "verifyMessage" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1242:28: C0103: Argument name "apiData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1250:4: C0103: Method name "queryDisplayGroups" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1250:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1258:4: C0103: Method name "subscribeToGroupEvents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1258:37: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1258:44: C0103: Argument name "groupId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1267:4: C0103: Method name "updateDisplayGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1267:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1267:40: C0103: Argument name "contractInfo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1276:4: C0103: Method name "unsubscribeFromGroupEvents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1276:41: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1284:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1284:4: C0103: Method name "startApi" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1288:4: C0103: Method name "verifyAndAuthRequest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1288:35: C0103: Argument name "apiName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1288:44: C0103: Argument name "apiVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1288:56: C0103: Argument name "opaqueIsvKey" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1298:4: C0103: Method name "verifyAndAuthMessage" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1298:35: C0103: Argument name "apiData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1298:44: C0103: Argument name "xyzResponse" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1307:4: C0103: Method name "reqPositionsMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1307:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1307:48: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1317:4: C0103: Method name "cancelPositionsMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1317:35: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1325:4: C0103: Method name "reqAccountUpdatesMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1325:37: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1325:53: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1325:64: C0103: Argument name "ledgerAndNLV" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1336:4: C0103: Method name "cancelAccountUpdatesMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1336:40: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1344:4: C0103: Method name "reqSecDefOptParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1346:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1347:8: C0103: Argument name "underlyingSymbol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1348:8: C0103: Argument name "futFopExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1349:8: C0103: Argument name "underlyingSecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1350:8: C0103: Argument name "underlyingConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1344:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1344:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1370:4: C0103: Method name "reqSoftDollarTiers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1370:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1378:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1378:4: C0103: Method name "reqFamilyCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1382:4: C0103: Method name "reqMatchingSymbols" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1382:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1391:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1391:4: C0103: Method name "reqMktDepthExchanges" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1395:4: C0103: Method name "reqSmartComponents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1395:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1395:40: C0103: Argument name "bboExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1404:4: C0103: Method name "reqNewsArticle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1404:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1404:36: C0103: Argument name "providerCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1404:50: C0103: Argument name "articleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1404:61: C0103: Argument name "newsArticleOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1415:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/client.py:1415:4: C0103: Method name "reqNewsProviders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1419:4: C0103: Method name "reqHistoricalNews" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1421:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1422:8: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1423:8: C0103: Argument name "providerCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1424:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1425:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1426:8: C0103: Argument name "totalResults" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1427:8: C0103: Argument name "historicalNewsOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1419:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1419:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1451:4: C0103: Method name "reqHeadTimeStamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1451:31: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1451:48: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1451:60: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1451:68: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1451:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1451:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1471:4: C0103: Method name "reqHistogramData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1471:31: C0103: Argument name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1471:51: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1471:59: C0103: Argument name "timePeriod" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1482:4: C0103: Method name "cancelHistogramData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1482:34: C0103: Argument name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1490:4: C0103: Method name "cancelHeadTimeStamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1490:34: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1498:4: C0103: Method name "reqMarketRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1498:28: C0103: Argument name "marketRuleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1506:4: C0103: Method name "reqPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1506:21: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1506:37: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1516:4: C0103: Method name "cancelPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1516:24: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1524:4: C0103: Method name "reqPnLSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1524:27: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1524:43: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1535:4: C0103: Method name "cancelPnLSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1535:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1543:4: C0103: Method name "reqHistoricalTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1545:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1547:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1548:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1549:8: C0103: Argument name "numberOfTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1550:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1551:8: C0103: Argument name "useRth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1552:8: C0103: Argument name "ignoreSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1553:8: C0103: Argument name "miscOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1543:4: R0913: Too many arguments (10/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1543:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1582:4: C0103: Method name "reqTickByTickData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1582:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1582:49: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1582:59: C0103: Argument name "numberOfTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1582:74: C0103: Argument name "ignoreSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1582:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/client.py:1582:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/client.py:1594:4: C0103: Method name "cancelTickByTickData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1594:35: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1602:4: C0103: Method name "reqCompletedOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1602:33: C0103: Argument name "apiOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1610:4: C0103: Method name "reqWshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1610:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1618:4: C0103: Method name "cancelWshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1618:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1626:4: C0103: Method name "reqWshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1626:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1646:4: C0103: Method name "cancelWshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1646:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1654:4: C0103: Method name "reqUserInfo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:1654:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/client.py:249:12: W0201: Attribute 'connState' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:276:8: W0201: Attribute 'connState' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:412:16: W0201: Attribute 'connState' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:429:24: W0201: Attribute '_apiReady' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:407:16: W0201: Attribute '_serverVersion' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:396:12: W0201: Attribute '_data' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:424:24: W0201: Attribute '_hasReqId' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:186:8: W0201: Attribute '_reqIdSeq' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:427:24: W0201: Attribute '_accounts' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:355:16: W0201: Attribute '_isThrottling' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:361:16: W0201: Attribute '_isThrottling' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/client.py:21:0: R0904: Too many public methods (95/20) (too-many-public-methods) +************* Module backtrader.backtrader.stores.ibstores.contract +backtrader/stores/ibstores/contract.py:307:0: C0301: Line too long (101/100) (line-too-long) +backtrader/stores/ibstores/contract.py:7:0: R0402: Use 'from ib_insync import util' instead (consider-using-from-import) +backtrader/stores/ibstores/contract.py:7:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/contract.py:30:4: C0103: Attribute name "secType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:31:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:33:4: C0103: Attribute name "lastTradeDateOrContractMonth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:38:4: C0103: Attribute name "primaryExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:40:4: C0103: Attribute name "localSymbol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:41:4: C0103: Attribute name "tradingClass" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:42:4: C0103: Attribute name "includeExpired" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:43:4: C0103: Attribute name "secIdType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:44:4: C0103: Attribute name "secId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:46:4: C0103: Attribute name "issuerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:47:4: C0103: Attribute name "comboLegsDescrip" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:48:4: C0103: Attribute name "comboLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:49:4: C0103: Attribute name "deltaNeutralContract" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:11:0: R0902: Too many instance attributes (20/7) (too-many-instance-attributes) +backtrader/stores/ibstores/contract.py:60:8: C0103: Variable name "secType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:85:4: C0103: Method name "isHashable" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:124:8: C0103: Variable name "clsName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:131:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:158:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:161:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/contract.py:161:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/contract.py:209:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:212:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/contract.py:212:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/contract.py:255:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:258:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/contract.py:258:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/contract.py:294:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:356:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:383:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:410:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:437:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:449:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:452:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/contract.py:452:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/contract.py:500:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:512:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:524:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:536:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:563:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:571:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:574:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:578:4: C0103: Attribute name "openClose" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:579:4: C0103: Attribute name "shortSaleSlot" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:580:4: C0103: Attribute name "designatedLocation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:581:4: C0103: Attribute name "exemptCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:571:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/stores/ibstores/contract.py:585:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:588:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:593:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:601:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:605:4: C0103: Attribute name "marketName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:606:4: C0103: Attribute name "minTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:607:4: C0103: Attribute name "orderTypes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:608:4: C0103: Attribute name "validExchanges" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:609:4: C0103: Attribute name "priceMagnifier" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:610:4: C0103: Attribute name "underConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:611:4: C0103: Attribute name "longName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:612:4: C0103: Attribute name "contractMonth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:616:4: C0103: Attribute name "timeZoneId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:617:4: C0103: Attribute name "tradingHours" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:618:4: C0103: Attribute name "liquidHours" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:619:4: C0103: Attribute name "evRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:620:4: C0103: Attribute name "evMultiplier" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:621:4: C0103: Attribute name "mdSizeMultiplier" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:622:4: C0103: Attribute name "aggGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:623:4: C0103: Attribute name "underSymbol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:624:4: C0103: Attribute name "underSecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:625:4: C0103: Attribute name "marketRuleIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:626:4: C0103: Attribute name "secIdList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:627:4: C0103: Attribute name "realExpirationDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:628:4: C0103: Attribute name "lastTradeTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:629:4: C0103: Attribute name "stockType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:630:4: C0103: Attribute name "minSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:631:4: C0103: Attribute name "sizeIncrement" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:632:4: C0103: Attribute name "suggestedSizeIncrement" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:636:4: C0103: Attribute name "descAppend" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:637:4: C0103: Attribute name "bondType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:638:4: C0103: Attribute name "couponType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:644:4: C0103: Attribute name "issueDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:645:4: C0103: Attribute name "nextOptionDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:646:4: C0103: Attribute name "nextOptionType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:647:4: C0103: Attribute name "nextOptionPartial" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:601:0: R0902: Too many instance attributes (44/7) (too-many-instance-attributes) +backtrader/stores/ibstores/contract.py:650:4: C0103: Method name "tradingSessions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:659:4: C0103: Method name "liquidSessions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:668:4: C0103: Method name "_parseSessions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:693:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:697:4: C0103: Attribute name "derivativeSecTypes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:701:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/contract.py:705:4: C0103: Attribute name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/contract.py:709:4: C0103: Attribute name "legsStr" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtrader.stores.ibstores.decoder +backtrader/stores/ibstores/decoder.py:1:0: C0302: Too many lines in module (1563/1000) (too-many-lines) +backtrader/stores/ibstores/decoder.py:52:8: C0103: Attribute name "serverVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:42:41: C0103: Argument name "serverVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:165:19: C0103: Argument name "methodName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:202:23: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/stores/ibstores/decoder.py:203:20: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/decoder.py:217:15: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/stores/ibstores/decoder.py:214:12: C0103: Variable name "msgId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:218:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/decoder.py:238:4: C0103: Method name "priceSizeTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:244:14: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:244:21: C0103: Variable name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:251:4: C0103: Method name "errorMsg" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:257:14: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:257:21: C0103: Variable name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:257:32: C0103: Variable name "errorString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:258:8: C0103: Variable name "advancedOrderRejectJson" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:260:12: C0103: Variable name "advancedOrderRejectJson" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:265:4: C0103: Method name "updatePortfolio" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:287:12: C0103: Variable name "marketPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:288:12: C0103: Variable name "marketValue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:289:12: C0103: Variable name "averageCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:290:12: C0103: Variable name "unrealizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:291:12: C0103: Variable name "realizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:292:12: C0103: Variable name "accountName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:307:4: C0103: Method name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:319:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:322:12: C0103: Variable name "lastTimes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:353:12: C0103: Variable name "numSecIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:357:8: C0103: Variable name "numSecIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:396:4: C0103: Method name "bondContractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:408:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:413:12: C0103: Variable name "lastTimes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:442:12: C0103: Variable name "numSecIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:446:8: C0103: Variable name "numSecIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:475:4: C0103: Method name "execDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:485:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:499:12: C0103: Variable name "timeStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:530:4: C0103: Method name "historicalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:536:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:536:18: C0103: Variable name "startDateStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:536:32: C0103: Variable name "endDateStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:536:44: C0103: Variable name "numBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:540:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/decoder.py:554:4: C0103: Method name "historicalDataUpdate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:560:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:563:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/decoder.py:576:4: C0103: Method name "scannerData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:582:14: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:603:16: C0103: Variable name "legsStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:621:4: C0103: Method name "tickOptionComputation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:627:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:627:18: C0103: Variable name "tickTypeInt" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:627:31: C0103: Variable name "tickAttrib" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:629:12: C0103: Variable name "impliedVol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:631:12: C0103: Variable name "optPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:632:12: C0103: Variable name "pvDividend" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:636:12: C0103: Variable name "undPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:653:4: C0103: Method name "deltaNeutralValidation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:659:14: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:659:21: C0103: Variable name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:666:4: C0103: Method name "commissionReport" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:675:12: C0103: Variable name "execId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:678:12: C0103: Variable name "realizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:680:12: C0103: Variable name "yieldRedemptionDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:717:12: C0103: Variable name "avgCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:723:4: C0103: Method name "positionMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:733:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:747:12: C0103: Variable name "avgCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:748:12: C0103: Variable name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:761:4: C0103: Method name "securityDefinitionOptionParameter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:769:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:771:12: C0103: Variable name "underlyingConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:772:12: C0103: Variable name "tradingClass" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:792:4: C0103: Method name "softDollarTiers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:798:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:808:4: C0103: Method name "familyCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:817:8: C0103: Variable name "familyCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:823:4: C0103: Method name "symbolSamples" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:829:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:854:4: C0103: Method name "smartComponents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:860:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:870:4: C0103: Method name "mktDepthExchanges" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:892:4: C0103: Method name "newsProviders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:905:4: C0103: Method name "histogramData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:911:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:920:4: C0103: Method name "marketRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:926:11: C0103: Variable name "marketRuleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:936:4: C0103: Method name "historicalTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:942:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:957:4: C0103: Method name "historicalTicksBidAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:963:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:973:12: C0103: Variable name "priceBid" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:974:12: C0103: Variable name "priceAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:975:12: C0103: Variable name "sizeBid" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:976:12: C0103: Variable name "sizeAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:985:4: C0103: Method name "historicalTicksLast" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:991:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1002:12: C0103: Variable name "specialConditions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1011:4: C0103: Method name "tickByTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1011:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/stores/ibstores/decoder.py:1017:11: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1017:18: C0103: Variable name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1018:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1019:8: C0103: Variable name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1023:41: C0103: Variable name "specialConditions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1041:12: C0103: Variable name "bidPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1041:22: C0103: Variable name "askPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1041:32: C0103: Variable name "bidSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1041:41: C0103: Variable name "askSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1058:13: C0103: Variable name "midPoint" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1062:4: C0103: Method name "openOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1062:4: R0914: Too many local variables (21/15) (too-many-locals) +backtrader/stores/ibstores/decoder.py:1166:8: C0103: Variable name "numLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1184:8: C0103: Variable name "numOrderLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1192:8: C0103: Variable name "numParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1223:12: C0103: Variable name "dncPresent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1228:12: C0103: Variable name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1235:12: C0103: Variable name "numParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1275:8: C0103: Variable name "numConditions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1278:16: C0103: Variable name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1279:16: C0103: Variable name "condCls" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1062:4: R0912: Too many branches (19/12) (too-many-branches) +backtrader/stores/ibstores/decoder.py:1062:4: R0915: Too many statements (72/50) (too-many-statements) +backtrader/stores/ibstores/decoder.py:1328:4: C0103: Method name "completedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1328:4: R0914: Too many local variables (21/15) (too-many-locals) +backtrader/stores/ibstores/decoder.py:1418:8: C0103: Variable name "numLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1436:8: C0103: Variable name "numOrderLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1444:8: C0103: Variable name "numParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1473:12: C0103: Variable name "dncPresent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1478:12: C0103: Variable name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1485:12: C0103: Variable name "numParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1503:8: C0103: Variable name "numConditions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1506:16: C0103: Variable name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1507:16: C0103: Variable name "condCls" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1328:4: R0912: Too many branches (16/12) (too-many-branches) +backtrader/stores/ibstores/decoder.py:1328:4: R0915: Too many statements (66/50) (too-many-statements) +backtrader/stores/ibstores/decoder.py:1549:4: C0103: Method name "historicalSchedule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1555:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1555:19: C0103: Variable name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1555:34: C0103: Variable name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:1555:47: C0103: Variable name "timeZone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/decoder.py:39:0: R0904: Too many public methods (33/20) (too-many-public-methods) +************* Module backtrader.backtrader.stores.ibstores.flexreport +backtrader/stores/ibstores/flexreport.py:9:0: E0401: Unable to import 'ib_insync' (import-error) +backtrader/stores/ibstores/flexreport.py:10:0: E0401: Unable to import 'ib_insync.objects' (import-error) +backtrader/stores/ibstores/flexreport.py:15:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/flexreport.py:33:35: C0103: Argument name "queryId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:51:34: C0103: Argument name "parseNumbers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:74:29: C0103: Argument name "parseNumbers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:84:30: C0103: Argument name "queryId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:107:12: C0103: Variable name "baseUrl" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:111:12: C0103: Variable name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:113:12: C0103: Variable name "errorMsg" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/flexreport.py:96:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +backtrader/stores/ibstores/flexreport.py:124:16: R1724: Unnecessary "else" after "continue", remove the "else" and de-indent the code inside it (no-else-continue) +backtrader/stores/ibstores/flexreport.py:119:19: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +************* Module backtrader.backtrader.stores.ibstores.order +backtrader/stores/ibstores/order.py:6:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/order.py:22:4: C0103: Attribute name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:23:4: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:24:4: C0103: Attribute name "permId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:26:4: C0103: Attribute name "totalQuantity" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:27:4: C0103: Attribute name "orderType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:28:4: C0103: Attribute name "lmtPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:29:4: C0103: Attribute name "auxPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:31:4: C0103: Attribute name "activeStartTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:32:4: C0103: Attribute name "activeStopTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:33:4: C0103: Attribute name "ocaGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:34:4: C0103: Attribute name "ocaType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:35:4: C0103: Attribute name "orderRef" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:37:4: C0103: Attribute name "parentId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:38:4: C0103: Attribute name "blockOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:39:4: C0103: Attribute name "sweepToFill" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:40:4: C0103: Attribute name "displaySize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:41:4: C0103: Attribute name "triggerMethod" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:42:4: C0103: Attribute name "outsideRth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:44:4: C0103: Attribute name "goodAfterTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:45:4: C0103: Attribute name "goodTillDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:46:4: C0103: Attribute name "rule80A" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:47:4: C0103: Attribute name "allOrNone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:48:4: C0103: Attribute name "minQty" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:49:4: C0103: Attribute name "percentOffset" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:50:4: C0103: Attribute name "overridePercentageConstraints" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:51:4: C0103: Attribute name "trailStopPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:52:4: C0103: Attribute name "trailingPercent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:53:4: C0103: Attribute name "faGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:54:4: C0103: Attribute name "faProfile" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:55:4: C0103: Attribute name "faMethod" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:56:4: C0103: Attribute name "faPercentage" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:57:4: C0103: Attribute name "designatedLocation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:58:4: C0103: Attribute name "openClose" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:60:4: C0103: Attribute name "shortSaleSlot" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:61:4: C0103: Attribute name "exemptCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:62:4: C0103: Attribute name "discretionaryAmt" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:63:4: C0103: Attribute name "eTradeOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:64:4: C0103: Attribute name "firmQuoteOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:65:4: C0103: Attribute name "nbboPriceCap" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:66:4: C0103: Attribute name "optOutSmartRouting" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:67:4: C0103: Attribute name "auctionStrategy" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:68:4: C0103: Attribute name "startingPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:69:4: C0103: Attribute name "stockRefPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:71:4: C0103: Attribute name "stockRangeLower" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:72:4: C0103: Attribute name "stockRangeUpper" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:73:4: C0103: Attribute name "randomizePrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:74:4: C0103: Attribute name "randomizeSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:76:4: C0103: Attribute name "volatilityType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:77:4: C0103: Attribute name "deltaNeutralOrderType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:78:4: C0103: Attribute name "deltaNeutralAuxPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:79:4: C0103: Attribute name "deltaNeutralConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:80:4: C0103: Attribute name "deltaNeutralSettlingFirm" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:81:4: C0103: Attribute name "deltaNeutralClearingAccount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:82:4: C0103: Attribute name "deltaNeutralClearingIntent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:83:4: C0103: Attribute name "deltaNeutralOpenClose" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:84:4: C0103: Attribute name "deltaNeutralShortSale" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:85:4: C0103: Attribute name "deltaNeutralShortSaleSlot" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:86:4: C0103: Attribute name "deltaNeutralDesignatedLocation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:87:4: C0103: Attribute name "continuousUpdate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:88:4: C0103: Attribute name "referencePriceType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:89:4: C0103: Attribute name "basisPoints" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:90:4: C0103: Attribute name "basisPointsType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:91:4: C0103: Attribute name "scaleInitLevelSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:92:4: C0103: Attribute name "scaleSubsLevelSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:93:4: C0103: Attribute name "scalePriceIncrement" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:94:4: C0103: Attribute name "scalePriceAdjustValue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:95:4: C0103: Attribute name "scalePriceAdjustInterval" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:96:4: C0103: Attribute name "scaleProfitOffset" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:97:4: C0103: Attribute name "scaleAutoReset" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:98:4: C0103: Attribute name "scaleInitPosition" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:99:4: C0103: Attribute name "scaleInitFillQty" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:100:4: C0103: Attribute name "scaleRandomPercent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:101:4: C0103: Attribute name "scaleTable" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:102:4: C0103: Attribute name "hedgeType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:103:4: C0103: Attribute name "hedgeParam" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:105:4: C0103: Attribute name "settlingFirm" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:106:4: C0103: Attribute name "clearingAccount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:107:4: C0103: Attribute name "clearingIntent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:108:4: C0103: Attribute name "algoStrategy" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:109:4: C0103: Attribute name "algoParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:110:4: C0103: Attribute name "smartComboRoutingParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:111:4: C0103: Attribute name "algoId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:112:4: C0103: Attribute name "whatIf" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:113:4: C0103: Attribute name "notHeld" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:115:4: C0103: Attribute name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:116:4: C0103: Attribute name "orderComboLegs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:117:4: C0103: Attribute name "orderMiscOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:118:4: C0103: Attribute name "referenceContractId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:119:4: C0103: Attribute name "peggedChangeAmount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:120:4: C0103: Attribute name "isPeggedChangeAmountDecrease" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:121:4: C0103: Attribute name "referenceChangeAmount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:122:4: C0103: Attribute name "referenceExchangeId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:123:4: C0103: Attribute name "adjustedOrderType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:124:4: C0103: Attribute name "triggerPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:125:4: C0103: Attribute name "adjustedStopPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:126:4: C0103: Attribute name "adjustedStopLimitPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:127:4: C0103: Attribute name "adjustedTrailingAmount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:128:4: C0103: Attribute name "adjustableTrailingUnit" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:129:4: C0103: Attribute name "lmtPriceOffset" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:131:4: C0103: Attribute name "conditionsCancelOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:132:4: C0103: Attribute name "conditionsIgnoreRth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:133:4: C0103: Attribute name "extOperator" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:134:4: C0103: Attribute name "softDollarTier" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:135:4: C0103: Attribute name "cashQty" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:136:4: C0103: Attribute name "mifid2DecisionMaker" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:137:4: C0103: Attribute name "mifid2DecisionAlgo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:138:4: C0103: Attribute name "mifid2ExecutionTrader" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:139:4: C0103: Attribute name "mifid2ExecutionAlgo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:140:4: C0103: Attribute name "dontUseAutoPriceForHedge" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:141:4: C0103: Attribute name "isOmsContainer" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:142:4: C0103: Attribute name "discretionaryUpToLimitPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:143:4: C0103: Attribute name "autoCancelDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:144:4: C0103: Attribute name "filledQuantity" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:145:4: C0103: Attribute name "refFuturesConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:146:4: C0103: Attribute name "autoCancelParent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:148:4: C0103: Attribute name "imbalanceOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:149:4: C0103: Attribute name "routeMarketableToBbo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:150:4: C0103: Attribute name "parentPermId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:151:4: C0103: Attribute name "usePriceMgmtAlgo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:153:4: C0103: Attribute name "postToAts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:154:4: C0103: Attribute name "advancedErrorOverride" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:155:4: C0103: Attribute name "manualOrderTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:156:4: C0103: Attribute name "minTradeQty" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:157:4: C0103: Attribute name "minCompeteSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:158:4: C0103: Attribute name "competeAgainstBestOffset" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:159:4: C0103: Attribute name "midOffsetAtWhole" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:160:4: C0103: Attribute name "midOffsetAtHalf" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:14:0: R0902: Too many instance attributes (139/7) (too-many-instance-attributes) +backtrader/stores/ibstores/order.py:169:8: C0103: Variable name "clsName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:188:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:188:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/ibstores/order.py:213:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:213:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/ibstores/order.py:235:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:235:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/ibstores/order.py:260:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:260:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/stores/ibstores/order.py:296:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:299:4: C0103: Attribute name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:303:4: C0103: Attribute name "avgFillPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:304:4: C0103: Attribute name "permId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:305:4: C0103: Attribute name "parentId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:306:4: C0103: Attribute name "lastFillPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:307:4: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:308:4: C0103: Attribute name "whyHeld" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:309:4: C0103: Attribute name "mktCapPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:296:0: R0902: Too many instance attributes (11/7) (too-many-instance-attributes) +backtrader/stores/ibstores/order.py:330:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:334:4: C0103: Attribute name "initMarginBefore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:335:4: C0103: Attribute name "maintMarginBefore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:336:4: C0103: Attribute name "equityWithLoanBefore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:337:4: C0103: Attribute name "initMarginChange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:338:4: C0103: Attribute name "maintMarginChange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:339:4: C0103: Attribute name "equityWithLoanChange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:340:4: C0103: Attribute name "initMarginAfter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:341:4: C0103: Attribute name "maintMarginAfter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:342:4: C0103: Attribute name "equityWithLoanAfter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:344:4: C0103: Attribute name "minCommission" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:345:4: C0103: Attribute name "maxCommission" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:346:4: C0103: Attribute name "commissionCurrency" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:347:4: C0103: Attribute name "warningText" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:348:4: C0103: Attribute name "completedTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:349:4: C0103: Attribute name "completedStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:330:0: R0902: Too many instance attributes (17/7) (too-many-instance-attributes) +backtrader/stores/ibstores/order.py:353:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:395:8: C0103: Attribute name "statusEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:396:8: C0103: Attribute name "modifyEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:397:8: C0103: Attribute name "fillEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:398:8: C0103: Attribute name "commissionReportEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:399:8: C0103: Attribute name "filledEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:400:8: C0103: Attribute name "cancelEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:401:8: C0103: Attribute name "cancelledEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:378:4: C0103: Attribute name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:381:4: C0103: Attribute name "advancedError" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:360:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes) +backtrader/stores/ibstores/order.py:403:4: C0103: Method name "isActive" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:412:4: C0103: Method name "isDone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:444:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:453:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:457:4: C0103: Method name "createClass" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:457:20: C0103: Argument name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:473:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/order.py:473:4: C0103: Method name "And" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:478:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/order.py:478:4: C0103: Method name "Or" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:475:8: W0201: Attribute 'conjunction' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/order.py:480:8: W0201: Attribute 'conjunction' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/order.py:485:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:488:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:490:4: C0103: Attribute name "isMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:492:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:494:4: C0103: Attribute name "triggerMethod" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:498:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:501:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:503:4: C0103: Attribute name "isMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:508:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:511:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:513:4: C0103: Attribute name "isMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:518:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:521:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:523:4: C0103: Attribute name "secType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:529:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:532:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:534:4: C0103: Attribute name "isMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:536:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:541:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/order.py:544:4: C0103: Attribute name "condType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:546:4: C0103: Attribute name "isMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:547:4: C0103: Attribute name "changePercent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/order.py:548:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtrader.stores.ibstores.connection +backtrader/stores/ibstores/connection.py:5:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/connection.py:6:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/connection.py:24:8: C0103: Attribute name "hasData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:31:8: C0103: Attribute name "numBytesSent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:32:8: C0103: Attribute name "numMsgSent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:28:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/connection.py:34:4: C0103: Method name "connectAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:49:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/connection.py:55:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/connection.py:55:4: C0103: Method name "isConnected" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:59:4: C0103: Method name "sendMsg" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/connection.py:47:8: W0201: Attribute 'transport' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/connection.py:76:8: W0201: Attribute 'transport' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.stores.ibstores.ib +backtrader/stores/ibstores/ib.py:1021:0: C0301: Line too long (104/100) (line-too-long) +backtrader/stores/ibstores/ib.py:1:0: C0302: Too many lines in module (3063/1000) (too-many-lines) +backtrader/stores/ibstores/ib.py:10:0: R0402: Use 'from ib_insync import util' instead (consider-using-from-import) +backtrader/stores/ibstores/ib.py:10:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/ib.py:11:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/ib.py:12:0: E0401: Unable to import 'ib_insync.client' (import-error) +backtrader/stores/ibstores/ib.py:13:0: E0401: Unable to import 'ib_insync.contract' (import-error) +backtrader/stores/ibstores/ib.py:14:0: E0401: Unable to import 'ib_insync.objects' (import-error) +backtrader/stores/ibstores/ib.py:43:0: E0401: Unable to import 'ib_insync.order' (import-error) +backtrader/stores/ibstores/ib.py:52:0: E0401: Unable to import 'ib_insync.ticker' (import-error) +backtrader/stores/ibstores/ib.py:53:0: E0401: Unable to import 'ib_insync.wrapper' (import-error) +backtrader/stores/ibstores/ib.py:224:8: C0103: Attribute name "errorEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:230:8: C0103: Attribute name "connectedEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:231:8: C0103: Attribute name "disconnectedEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:232:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:233:8: C0103: Attribute name "pendingTickersEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:234:8: C0103: Attribute name "barUpdateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:235:8: C0103: Attribute name "newOrderEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:236:8: C0103: Attribute name "orderModifyEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:237:8: C0103: Attribute name "cancelOrderEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:238:8: C0103: Attribute name "openOrderEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:239:8: C0103: Attribute name "orderStatusEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:240:8: C0103: Attribute name "execDetailsEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:241:8: C0103: Attribute name "commissionReportEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:242:8: C0103: Attribute name "updatePortfolioEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:243:8: C0103: Attribute name "positionEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:244:8: C0103: Attribute name "accountValueEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:245:8: C0103: Attribute name "accountSummaryEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:246:8: C0103: Attribute name "pnlEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:247:8: C0103: Attribute name "pnlSingleEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:248:8: C0103: Attribute name "scannerDataEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:249:8: C0103: Attribute name "tickNewsEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:250:8: C0103: Attribute name "newsBulletinEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:251:8: C0103: Attribute name "wshMetaEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:252:8: C0103: Attribute name "wshEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:254:8: C0103: Attribute name "timeoutEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:56:0: R0902: Too many instance attributes (29/7) (too-many-instance-attributes) +backtrader/stores/ibstores/ib.py:228:4: C0103: Method name "_createEvents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:286:8: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:290:8: C0103: Argument name "raiseSyncErrors" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:282:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:282:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:341:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:352:4: C0103: Method name "isConnected" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:361:4: C0103: Method name "_onError" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:361:23: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:361:30: C0103: Argument name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:361:41: C0103: Argument name "errorString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:361:23: W0613: Unused argument 'reqId' (unused-argument) +backtrader/stores/ibstores/ib.py:361:41: W0613: Unused argument 'errorString' (unused-argument) +backtrader/stores/ibstores/ib.py:361:54: W0613: Unused argument 'contract' (unused-argument) +backtrader/stores/ibstores/ib.py:391:4: C0103: Method name "waitOnUpdate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:416:4: C0103: Method name "loopUntil" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:428:8: C0103: Variable name "endTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:431:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstores/ib.py:441:4: C0103: Method name "setTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:454:4: C0103: Method name "managedAccounts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:463:8: E1101: Instance of 'IB' has no '_event_managed_accounts' member (no-member) +backtrader/stores/ibstores/ib.py:466:4: C0103: Method name "accountValues" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:475:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/stores/ibstores/ib.py:482:4: C0103: Method name "accountSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:504:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/stores/ibstores/ib.py:518:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/stores/ibstores/ib.py:523:30: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:541:4: C0103: Method name "pnlSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:542:33: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:542:54: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:575:4: C0103: Method name "openTrades" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:597:4: C0103: Method name "openOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:649:4: C0103: Method name "pendingTickers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:658:4: C0103: Method name "realtimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:668:4: C0103: Method name "newsTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:678:4: C0103: Method name "newsBulletins" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:687:4: C0103: Method name "reqTickers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:706:4: C0103: Method name "qualifyContracts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:721:4: C0103: Method name "bracketOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:725:8: C0103: Argument name "limitPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:726:8: C0103: Argument name "takeProfitPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:727:8: C0103: Argument name "stopLossPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:721:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:721:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:755:8: C0103: Variable name "reverseAction" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:764:8: C0103: Variable name "takeProfit" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:773:8: C0103: Variable name "stopLoss" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:785:4: C0103: Method name "oneCancelsAll" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:785:43: C0103: Argument name "ocaGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:785:58: C0103: Argument name "ocaType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:804:4: C0103: Method name "whatIfOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:819:4: C0103: Method name "placeOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:831:8: C0103: Variable name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:839:12: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:841:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:848:12: C0103: Variable name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:849:12: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:852:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:856:4: C0103: Method name "cancelOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:857:28: C0103: Argument name "manualCancelOrderTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:880:20: C0103: Variable name "newStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:882:20: C0103: Variable name "newStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:883:16: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:886:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:894:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:897:4: C0103: Method name "reqGlobalCancel" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:906:4: C0103: Method name "reqCurrentTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:917:4: C0103: Method name "reqAccountUpdates" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:932:4: C0103: Method name "reqAccountUpdatesMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:932:56: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:947:4: C0103: Method name "reqAccountSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:959:4: C0103: Method name "reqAutoOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:959:32: C0103: Argument name "autoBind" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:975:4: C0103: Method name "reqOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:991:4: C0103: Method name "reqAllOpenOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1003:4: C0103: Method name "reqCompletedOrders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1003:33: C0103: Argument name "apiOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1013:4: C0103: Method name "reqExecutions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1013:28: C0103: Argument name "execFilter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1028:4: C0103: Method name "reqPositions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1041:4: C0103: Method name "reqPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1041:35: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1058:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1065:4: C0103: Method name "cancelPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1065:33: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1074:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1079:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:1084:4: C0103: Method name "reqPnLSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1084:41: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1084:57: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1103:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1105:8: C0103: Variable name "pnlSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1110:4: C0103: Method name "cancelPnLSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1110:44: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1110:60: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1123:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1128:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:1133:4: C0103: Method name "reqContractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1152:4: C0103: Method name "reqMatchingSymbols" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1168:4: C0103: Method name "reqMarketRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1168:28: C0103: Argument name "marketRuleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1184:4: C0103: Method name "reqRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1187:8: C0103: Argument name "barSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1188:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1189:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1190:8: C0103: Argument name "realTimeBarsOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1184:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1184:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1184:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:1211:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1225:4: C0103: Method name "cancelRealTimeBars" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1235:4: C0103: Method name "reqHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1238:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1239:8: C0103: Argument name "durationStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1240:8: C0103: Argument name "barSizeSetting" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1241:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1242:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1243:8: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1244:8: C0103: Argument name "keepUpToDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1245:8: C0103: Argument name "chartOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1235:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1235:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1235:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:1315:4: C0103: Method name "cancelHistoricalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1326:4: C0103: Method name "reqHistoricalSchedule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1329:8: C0103: Argument name "numDays" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1330:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1331:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1356:4: C0103: Method name "reqHistoricalTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1359:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1360:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1361:8: C0103: Argument name "numberOfTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1362:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1363:8: C0103: Argument name "useRth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1364:8: C0103: Argument name "ignoreSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1365:8: C0103: Argument name "miscOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1356:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1356:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1356:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:1412:4: C0103: Method name "reqMarketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1412:32: C0103: Argument name "marketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1426:4: C0103: Method name "reqHeadTimeStamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1429:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1430:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1431:8: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1453:4: C0103: Method name "reqMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1456:8: C0103: Argument name "genericTickList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1458:8: C0103: Argument name "regulatorySnapshot" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1459:8: C0103: Argument name "mktDataOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1453:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1453:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1453:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:1513:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1525:4: C0103: Method name "cancelMktData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1534:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1538:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:1540:4: C0103: Method name "reqTickByTickData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1543:8: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1544:8: C0103: Argument name "numberOfTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1545:8: C0103: Argument name "ignoreSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1563:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1570:4: C0103: Method name "cancelTickByTickData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1570:55: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1581:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1585:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:1587:4: C0103: Method name "reqSmartComponents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1587:33: C0103: Argument name "bboExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1600:4: C0103: Method name "reqMktDepthExchanges" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1610:4: C0103: Method name "reqMktDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1613:8: C0103: Argument name "numRows" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1614:8: C0103: Argument name "isSmartDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1615:8: C0103: Argument name "mktDepthOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1635:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1642:4: C0103: Method name "cancelMktDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1642:49: C0103: Argument name "isSmartDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1652:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1656:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:1660:4: C0103: Method name "reqHistogramData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1661:34: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1682:4: C0103: Method name "reqFundamentalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1685:8: C0103: Argument name "reportType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1686:8: C0103: Argument name "fundamentalDataOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1682:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1712:4: C0103: Method name "reqScannerData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1715:8: C0103: Argument name "scannerSubscriptionOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1716:8: C0103: Argument name "scannerSubscriptionFilterOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1712:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1712:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1742:4: C0103: Method name "reqScannerSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1745:8: C0103: Argument name "scannerSubscriptionOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1746:8: C0103: Argument name "scannerSubscriptionFilterOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1742:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1742:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1761:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1762:8: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1778:4: C0103: Method name "cancelScannerSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1778:40: C0103: Argument name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1791:4: C0103: Method name "reqScannerParameters" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1802:4: C0103: Method name "calculateImpliedVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1805:8: C0103: Argument name "optionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1806:8: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1807:8: C0103: Argument name "implVolOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1802:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1832:4: C0103: Method name "calculateOptionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1836:8: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1837:8: C0103: Argument name "optPrcOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1832:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1862:4: C0103: Method name "reqSecDefOptParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1864:8: C0103: Argument name "underlyingSymbol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1865:8: C0103: Argument name "futFopExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1866:8: C0103: Argument name "underlyingSecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1867:8: C0103: Argument name "underlyingConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1897:4: C0103: Method name "exerciseOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1900:8: C0103: Argument name "exerciseAction" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1901:8: C0103: Argument name "exerciseQuantity" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1897:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1897:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:1923:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1928:4: C0103: Method name "reqNewsProviders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1939:4: C0103: Method name "reqNewsArticle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1941:8: C0103: Argument name "providerCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1942:8: C0103: Argument name "articleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1943:8: C0103: Argument name "newsArticleOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1939:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1964:4: C0103: Method name "reqHistoricalNews" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1966:8: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1967:8: C0103: Argument name "providerCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1968:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1969:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1970:8: C0103: Argument name "totalResults" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1971:8: C0103: Argument name "historicalNewsOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:1964:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:1964:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:1964:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:2012:4: C0103: Method name "reqNewsBulletins" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2012:31: C0103: Argument name "allMessages" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2023:4: C0103: Method name "cancelNewsBulletins" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2027:4: C0103: Method name "requestFA" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2027:24: C0103: Argument name "faDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2045:4: C0103: Method name "replaceFA" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2045:24: C0103: Argument name "faDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2054:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2057:4: C0103: Method name "reqWshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2067:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2071:4: C0103: Method name "cancelWshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2073:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2080:4: C0103: Method name "reqWshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2094:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2098:4: C0103: Method name "cancelWshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2100:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2107:4: C0103: Method name "getWshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2127:4: C0103: Method name "getWshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2161:4: C0103: Method name "reqUserInfo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2172:4: C0103: Method name "connectAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2176:8: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2180:8: C0103: Argument name "raiseSyncErrors" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2172:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:2172:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:2172:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/stores/ibstores/ib.py:2172:4: R0912: Too many branches (13/12) (too-many-branches) +backtrader/stores/ibstores/ib.py:2262:4: C0103: Method name "qualifyContractsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2270:8: C0103: Variable name "detailsLists" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2274:22: C0103: Variable name "detailsList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2276:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:2279:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:2292:4: C0103: Method name "reqTickersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2306:8: C0103: Variable name "reqIds" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2308:12: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2320:4: C0103: Method name "whatIfOrderAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2332:8: C0103: Variable name "whatIfOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2334:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2339:4: C0103: Method name "reqCurrentTimeAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2350:4: C0103: Method name "reqAccountUpdatesAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2362:4: C0103: Method name "reqAccountUpdatesMultiAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2363:28: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2374:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2379:4: C0103: Method name "accountSummaryAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2390:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/stores/ibstores/ib.py:2397:4: C0103: Method name "reqAccountSummaryAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2404:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2422:4: C0103: Method name "reqOpenOrdersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2433:4: C0103: Method name "reqAllOpenOrdersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2444:4: C0103: Method name "reqCompletedOrdersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2444:38: C0103: Argument name "apiOnly" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2456:4: C0103: Method name "reqExecutionsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2457:14: C0103: Argument name "execFilter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2467:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2472:4: C0103: Method name "reqPositionsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2483:4: C0103: Method name "reqContractDetailsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2493:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2498:4: C0103: Method name "reqMatchingSymbolsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2508:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2518:4: C0103: Method name "reqMarketRuleAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2519:14: C0103: Argument name "marketRuleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2537:4: C0103: Method name "reqHistoricalDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2540:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2541:8: C0103: Argument name "durationStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2542:8: C0103: Argument name "barSizeSetting" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2543:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2544:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2545:8: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2546:8: C0103: Argument name "keepUpToDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2547:8: C0103: Argument name "chartOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2537:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2537:4: R0913: Too many arguments (11/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:2537:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:2537:4: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/stores/ibstores/ib.py:2575:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2608:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/ib.py:2612:4: C0103: Method name "reqHistoricalScheduleAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2615:8: C0103: Argument name "numDays" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2616:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2617:8: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2632:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2649:4: C0103: Method name "reqHistoricalTicksAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2652:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2653:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2654:8: C0103: Argument name "numberOfTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2655:8: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2656:8: C0103: Argument name "useRth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2657:8: C0103: Argument name "ignoreSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2658:8: C0103: Argument name "miscOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2649:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2649:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:2649:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:2681:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2698:4: C0103: Method name "reqHeadTimeStampAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2699:34: C0103: Argument name "whatToShow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2699:51: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2699:65: C0103: Argument name "formatDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2714:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2721:4: C0103: Method name "reqSmartComponentsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2721:38: C0103: Argument name "bboExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2727:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2732:4: C0103: Method name "reqMktDepthExchangesAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2745:4: C0103: Method name "reqHistogramDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2746:34: C0103: Argument name "useRTH" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2759:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2764:4: C0103: Method name "reqFundamentalDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2767:8: C0103: Argument name "reportType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2768:8: C0103: Argument name "fundamentalDataOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2764:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2781:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2788:4: C0103: Method name "reqScannerDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2791:8: C0103: Argument name "scannerSubscriptionOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2792:8: C0103: Argument name "scannerSubscriptionFilterOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2788:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2788:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2805:8: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2815:4: C0103: Method name "reqScannerParametersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2826:4: C0103: Method name "calculateImpliedVolatilityAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2829:8: C0103: Argument name "optionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2830:8: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2831:8: C0103: Argument name "implVolOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2826:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2846:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2860:4: C0103: Method name "calculateOptionPriceAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2864:8: C0103: Argument name "underPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2865:8: C0103: Argument name "optPrcOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2860:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2880:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2894:4: C0103: Method name "reqSecDefOptParamsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2896:8: C0103: Argument name "underlyingSymbol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2897:8: C0103: Argument name "futFopExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2898:8: C0103: Argument name "underlyingSecType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2899:8: C0103: Argument name "underlyingConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2914:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2925:4: C0103: Method name "reqNewsProvidersAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2936:4: C0103: Method name "reqNewsArticleAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2938:8: C0103: Argument name "providerCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2939:8: C0103: Argument name "articleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2940:8: C0103: Argument name "newsArticleOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2936:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2953:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2958:4: C0103: Method name "reqHistoricalNewsAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2960:8: C0103: Argument name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2961:8: C0103: Argument name "providerCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2962:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2963:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2964:8: C0103: Argument name "totalResults" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2965:8: C0103: Argument name "historicalNewsOptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:2958:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +backtrader/stores/ibstores/ib.py:2958:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/ib.py:2958:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/ib.py:2984:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3004:4: C0103: Method name "requestFAAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3004:35: C0103: Argument name "faDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3019:4: C0103: Method name "getWshMetaDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3033:4: C0103: Method name "getWshEventDataAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3049:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ib.py:3049:4: C0103: Method name "reqUserInfoAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:3051:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ib.py:462:8: W0201: Attribute 'managed_accounts' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/ib.py:56:0: R0904: Too many public methods (127/20) (too-many-public-methods) +************* Module backtrader.backtrader.stores.ibstores.ibcontroller +backtrader/stores/ibstores/ibcontroller.py:10:0: R0402: Use 'from ib_insync import util' instead (consider-using-from-import) +backtrader/stores/ibstores/ibcontroller.py:10:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/ibcontroller.py:11:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/ibcontroller.py:12:0: E0401: Unable to import 'ib_insync.contract' (import-error) +backtrader/stores/ibstores/ibcontroller.py:13:0: E0401: Unable to import 'ib_insync.ib' (import-error) +backtrader/stores/ibstores/ibcontroller.py:42:8: C0103: Attribute name "_isWindows" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:31:4: C0103: Attribute name "ibcPath" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:26:4: C0103: Attribute name "twsVersion" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:28:4: C0103: Attribute name "tradingMode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:29:4: C0103: Attribute name "twsPath" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:30:4: C0103: Attribute name "twsSettingsPath" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:32:4: C0103: Attribute name "ibcIni" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:33:4: C0103: Attribute name "javaPath" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:17:0: R0902: Too many instance attributes (17/7) (too-many-instance-attributes) +backtrader/stores/ibstores/ibcontroller.py:70:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:70:4: C0103: Method name "startAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:77:15: R1735: Consider using '{"twsVersion": ('', ''), "gateway": ('--gateway', '/Gateway'), "tradingMode": ('--mode=', '/Mode:'), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstores/ibcontroller.py:117:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:117:4: C0103: Method name "terminateAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:126:12: C0415: Import outside toplevel (subprocess) (import-outside-toplevel) +backtrader/stores/ibstores/ibcontroller.py:135:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:135:4: C0103: Method name "monitorAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:183:8: C0103: Attribute name "startingEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:184:8: C0103: Attribute name "startedEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:185:8: C0103: Attribute name "stoppingEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:186:8: C0103: Attribute name "stoppedEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:187:8: C0103: Attribute name "softTimeoutEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:188:8: C0103: Attribute name "hardTimeoutEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:170:4: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:171:4: C0103: Attribute name "connectTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:172:4: C0103: Attribute name "appStartupTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:173:4: C0103: Attribute name "appTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:174:4: C0103: Attribute name "retryDelay" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:177:4: C0103: Attribute name "raiseSyncErrors" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:178:4: C0103: Attribute name "probeContract" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:179:4: C0103: Attribute name "probeTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:145:0: R0902: Too many instance attributes (22/7) (too-many-instance-attributes) +backtrader/stores/ibstores/ibcontroller.py:198:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:205:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:212:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/ibcontroller.py:212:4: C0103: Method name "runAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:215:8: C0103: Function name "onTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:215:22: C0103: Argument name "idlePeriod" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:215:22: W0613: Unused argument 'idlePeriod' (unused-argument) +backtrader/stores/ibstores/ibcontroller.py:224:8: C0103: Function name "onError" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:224:20: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:224:27: C0103: Argument name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:224:38: C0103: Argument name "errorString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:224:20: W0613: Unused argument 'reqId' (unused-argument) +backtrader/stores/ibstores/ibcontroller.py:224:38: W0613: Unused argument 'errorString' (unused-argument) +backtrader/stores/ibstores/ibcontroller.py:224:51: W0613: Unused argument 'contract' (unused-argument) +backtrader/stores/ibstores/ibcontroller.py:236:8: C0103: Function name "onDisconnected" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ibcontroller.py:286:19: W0718: Catching too general exception Exception (broad-exception-caught) +************* Module backtrader.backtrader.stores.ibstores.objects +backtrader/stores/ibstores/objects.py:8:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/objects.py:17:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:20:4: C0103: Attribute name "numberOfRows" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:22:4: C0103: Attribute name "locationCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:23:4: C0103: Attribute name "scanCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:24:4: C0103: Attribute name "abovePrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:25:4: C0103: Attribute name "belowPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:26:4: C0103: Attribute name "aboveVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:27:4: C0103: Attribute name "marketCapAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:28:4: C0103: Attribute name "marketCapBelow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:29:4: C0103: Attribute name "moodyRatingAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:30:4: C0103: Attribute name "moodyRatingBelow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:31:4: C0103: Attribute name "spRatingAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:32:4: C0103: Attribute name "spRatingBelow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:33:4: C0103: Attribute name "maturityDateAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:34:4: C0103: Attribute name "maturityDateBelow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:35:4: C0103: Attribute name "couponRateAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:36:4: C0103: Attribute name "couponRateBelow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:37:4: C0103: Attribute name "excludeConvertible" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:38:4: C0103: Attribute name "averageOptionVolumeAbove" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:39:4: C0103: Attribute name "scannerSettingPairs" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:40:4: C0103: Attribute name "stockTypeFilter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:17:0: R0902: Too many instance attributes (21/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:44:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:49:4: C0103: Attribute name "displayName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:57:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:60:4: C0103: Attribute name "execId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:62:4: C0103: Attribute name "acctNumber" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:67:4: C0103: Attribute name "permId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:68:4: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:69:4: C0103: Attribute name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:71:4: C0103: Attribute name "cumQty" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:72:4: C0103: Attribute name "avgPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:73:4: C0103: Attribute name "orderRef" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:74:4: C0103: Attribute name "evRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:75:4: C0103: Attribute name "evMultiplier" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:76:4: C0103: Attribute name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:77:4: C0103: Attribute name "lastLiquidity" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:78:4: C0103: Attribute name "pendingPriceRevision" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:57:0: R0902: Too many instance attributes (19/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:82:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:85:4: C0103: Attribute name "execId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:88:4: C0103: Attribute name "realizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:90:4: C0103: Attribute name "yieldRedemptionDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:94:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:97:4: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:98:4: C0103: Attribute name "acctCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:101:4: C0103: Attribute name "secType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:107:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:117:4: C0103: Attribute name "barCount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:107:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:121:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:125:4: C0103: Attribute name "endTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:121:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:136:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:139:4: C0103: Attribute name "canAutoExecute" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:140:4: C0103: Attribute name "pastLimit" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:141:4: C0103: Attribute name "preOpen" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:145:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:148:4: C0103: Attribute name "bidPastLow" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:149:4: C0103: Attribute name "askPastHigh" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:153:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:156:4: C0103: Attribute name "pastLimit" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:161:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:169:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:177:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:181:4: C0103: Attribute name "secType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:182:4: C0103: Attribute name "listingExch" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:183:4: C0103: Attribute name "serviceDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:184:4: C0103: Attribute name "aggGroup" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:188:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:192:4: C0103: Attribute name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:193:4: C0103: Attribute name "dailyPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:194:4: C0103: Attribute name "unrealizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:195:4: C0103: Attribute name "realizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:199:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:205:4: C0103: Attribute name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:209:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:213:4: C0103: Attribute name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:214:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:215:4: C0103: Attribute name "dailyPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:216:4: C0103: Attribute name "unrealizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:217:4: C0103: Attribute name "realizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:209:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:223:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:226:4: C0103: Attribute name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:227:4: C0103: Attribute name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:228:4: C0103: Attribute name "refDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:232:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:235:4: C0103: Attribute name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:236:4: C0103: Attribute name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:237:4: C0103: Attribute name "timeZone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:242:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:245:4: C0103: Attribute name "conId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:247:4: C0103: Attribute name "fillWatchlist" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:248:4: C0103: Attribute name "fillPortfolio" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:249:4: C0103: Attribute name "fillCompetitors" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:250:4: C0103: Attribute name "startDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:251:4: C0103: Attribute name "endDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:252:4: C0103: Attribute name "totalLimit" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:242:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +backtrader/stores/ibstores/objects.py:255:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:265:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:274:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:282:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:293:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:304:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:316:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:327:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:334:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:346:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:354:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:361:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:374:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:383:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:392:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:406:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:417:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:426:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:433:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:442:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:452:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:461:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:468:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:476:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:516:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:556:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:592:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:607:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/objects.py:620:8: C0103: Variable name "clsName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/objects.py:607:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/ibstores/objects.py:625:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.stores.ibstores.ticker +backtrader/stores/ibstores/ticker.py:7:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/ticker.py:8:0: E0401: Unable to import 'ib_insync.contract' (import-error) +backtrader/stores/ibstores/ticker.py:9:0: E0401: Unable to import 'ib_insync.objects' (import-error) +backtrader/stores/ibstores/ticker.py:20:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/ticker.py:127:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:53:4: C0103: Attribute name "marketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:54:4: C0103: Attribute name "minTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:56:4: C0103: Attribute name "bidSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:57:4: C0103: Attribute name "bidExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:59:4: C0103: Attribute name "askSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:60:4: C0103: Attribute name "askExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:62:4: C0103: Attribute name "lastSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:63:4: C0103: Attribute name "lastExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:64:4: C0103: Attribute name "prevBid" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:65:4: C0103: Attribute name "prevBidSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:66:4: C0103: Attribute name "prevAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:67:4: C0103: Attribute name "prevAskSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:68:4: C0103: Attribute name "prevLast" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:69:4: C0103: Attribute name "prevLastSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:82:4: C0103: Attribute name "bidYield" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:83:4: C0103: Attribute name "askYield" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:84:4: C0103: Attribute name "lastYield" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:85:4: C0103: Attribute name "markPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:87:4: C0103: Attribute name "rtHistVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:88:4: C0103: Attribute name "rtVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:89:4: C0103: Attribute name "rtTradeVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:90:4: C0103: Attribute name "rtTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:91:4: C0103: Attribute name "avVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:92:4: C0103: Attribute name "tradeCount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:93:4: C0103: Attribute name "tradeRate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:94:4: C0103: Attribute name "volumeRate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:95:4: C0103: Attribute name "shortableShares" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:96:4: C0103: Attribute name "indexFuturePremium" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:97:4: C0103: Attribute name "futuresOpenInterest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:98:4: C0103: Attribute name "putOpenInterest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:99:4: C0103: Attribute name "callOpenInterest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:100:4: C0103: Attribute name "putVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:101:4: C0103: Attribute name "callVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:102:4: C0103: Attribute name "avOptionVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:103:4: C0103: Attribute name "histVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:104:4: C0103: Attribute name "impliedVolatility" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:106:4: C0103: Attribute name "fundamentalRatios" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:108:4: C0103: Attribute name "tickByTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:111:4: C0103: Attribute name "domBids" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:112:4: C0103: Attribute name "domAsks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:113:4: C0103: Attribute name "domTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:114:4: C0103: Attribute name "bidGreeks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:115:4: C0103: Attribute name "askGreeks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:116:4: C0103: Attribute name "lastGreeks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:117:4: C0103: Attribute name "modelGreeks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:118:4: C0103: Attribute name "auctionVolume" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:119:4: C0103: Attribute name "auctionPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:120:4: C0103: Attribute name "auctionImbalance" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:121:4: C0103: Attribute name "regulatoryImbalance" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:122:4: C0103: Attribute name "bboExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:123:4: C0103: Attribute name "snapshotPermissions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:26:0: R0902: Too many instance attributes (72/7) (too-many-instance-attributes) +backtrader/stores/ibstores/ticker.py:144:4: C0103: Method name "hasBidAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:171:4: C0103: Method name "marketPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:191:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:255:8: C0103: Attribute name "_tickTypes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:247:23: C0103: Argument name "tickTypes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:311:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:327:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:339:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:349:8: C0103: Attribute name "updateEvent" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/ticker.py:364:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:397:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:387:24: W0613: Unused argument 'time' (unused-argument) +backtrader/stores/ibstores/ticker.py:414:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:421:29: W0613: Unused argument 'timer' (unused-argument) +backtrader/stores/ibstores/ticker.py:364:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/ibstores/ticker.py:431:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:459:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:462:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:431:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/stores/ibstores/ticker.py:473:0: C0112: Empty class docstring (empty-docstring) +backtrader/stores/ibstores/ticker.py:501:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:504:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/ticker.py:473:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.stores.ibstores.util +backtrader/stores/ibstores/util.py:44:0: C0301: Line too long (102/100) (line-too-long) +backtrader/stores/ibstores/util.py:21:0: E0401: Unable to import 'eventkit' (import-error) +backtrader/stores/ibstores/util.py:37:0: C0103: Type alias name "Time_t" doesn't conform to predefined naming style (invalid-name) +backtrader/stores/ibstores/util.py:56:12: W0621: Redefining name 'df' from outer scope (line 40) (redefined-outer-name) +backtrader/stores/ibstores/util.py:48:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:50:4: C0415: Import outside toplevel (objects.DynamicObject) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:75:0: C0103: Function name "dataclassAsDict" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:88:0: C0103: Function name "dataclassAsTuple" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:101:0: C0103: Function name "dataclassNonDefaults" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:116:12: R0124: Redundant comparison - value == value (comparison-with-itself) +backtrader/stores/ibstores/util.py:121:0: C0103: Function name "dataclassUpdate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:133:8: C0103: Variable name "srcObj" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:139:0: C0103: Function name "dataclassRepr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:148:4: C0103: Variable name "clsName" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:166:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +backtrader/stores/ibstores/util.py:176:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/stores/ibstores/util.py:169:0: R0911: Too many return statements (7/6) (too-many-return-statements) +backtrader/stores/ibstores/util.py:192:28: C0103: Argument name "upColor" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:192:44: C0103: Argument name "downColor" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:192:0: R0914: Too many local variables (21/15) (too-many-locals) +backtrader/stores/ibstores/util.py:202:4: C0415: Import outside toplevel (matplotlib.pyplot) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:203:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:204:4: C0415: Import outside toplevel (matplotlib.lines.Line2D) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:205:4: C0415: Import outside toplevel (matplotlib.patches.Rectangle) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:208:8: C0103: Variable name "ohlcTups" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:210:8: C0103: Variable name "ohlcTups" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:212:8: C0103: Variable name "ohlcTups" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:221:12: C0103: Variable name "bodyHi" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:221:20: C0103: Variable name "bodyLo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:224:12: C0103: Variable name "bodyHi" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:224:20: C0103: Variable name "bodyLo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:244:0: C0103: Function name "allowCtrlC" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:249:0: C0103: Function name "logToFile" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:267:0: C0103: Function name "logToConsole" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:275:4: C0103: Variable name "stdHandlers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:278:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +backtrader/stores/ibstores/util.py:293:0: C0103: Function name "isNan" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:301:11: R0124: Redundant comparison - x != x (comparison-with-itself) +backtrader/stores/ibstores/util.py:304:0: C0103: Function name "formatSI" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:316:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +backtrader/stores/ibstores/util.py:325:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +backtrader/stores/ibstores/util.py:337:0: C0103: Class name "timeit" doesn't conform to PascalCase naming style (invalid-name) +backtrader/stores/ibstores/util.py:350:8: W0201: Attribute 't0' defined outside __init__ (attribute-defined-outside-init) +backtrader/stores/ibstores/util.py:395:24: E1101: Class 'Task' has no 'all_tasks' member (no-member) +backtrader/stores/ibstores/util.py:413:8: C0103: Function name "onError" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:361:0: R0912: Too many branches (14/12) (too-many-branches) +backtrader/stores/ibstores/util.py:361:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +backtrader/stores/ibstores/util.py:432:0: C0103: Function name "_fillDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:432:14: W0621: Redefining name 'time' from outer scope (line 9) (redefined-outer-name) +backtrader/stores/ibstores/util.py:448:13: W0621: Redefining name 'time' from outer scope (line 9) (redefined-outer-name) +backtrader/stores/ibstores/util.py:481:0: C0103: Function name "timeRange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:509:0: C0103: Function name "waitUntil" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:524:0: C0103: Function name "timeRangeAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:551:0: C0103: Function name "waitUntilAsync" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:565:0: C0103: Function name "patchAsyncio" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:567:4: C0415: Import outside toplevel (nest_asyncio) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:572:0: C0103: Function name "getLoop" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:577:0: C0103: Function name "startLoop" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:582:0: C0103: Function name "useQt" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:582:10: C0103: Argument name "qtLib" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:606:8: W0106: Expression "qloop.exec() if qtLib == 'PyQt6' else qloop.exec_()" is assigned to nothing (expression-not-assigned) +backtrader/stores/ibstores/util.py:613:4: C0415: Import outside toplevel (importlib.import_module) (import-outside-toplevel) +backtrader/stores/ibstores/util.py:617:4: W0601: Global variable 'qApp' undefined at the module level (global-variable-undefined) +backtrader/stores/ibstores/util.py:626:0: C0103: Function name "formatIBDatetime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/util.py:650:0: C0103: Function name "parseIBDatetime" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtrader.stores.ibstores.wrapper +backtrader/stores/ibstores/wrapper.py:1:0: C0302: Too many lines in module (2404/1000) (too-many-lines) +backtrader/stores/ibstores/wrapper.py:20:0: E0401: Unable to import 'ib_insync.contract' (import-error) +backtrader/stores/ibstores/wrapper.py:27:0: E0401: Unable to import 'ib_insync.objects' (import-error) +backtrader/stores/ibstores/wrapper.py:69:0: E0401: Unable to import 'ib_insync.order' (import-error) +backtrader/stores/ibstores/wrapper.py:70:0: E0401: Unable to import 'ib_insync.ticker' (import-error) +backtrader/stores/ibstores/wrapper.py:71:0: E0401: Unable to import 'ib_insync.util' (import-error) +backtrader/stores/ibstores/wrapper.py:83:0: E0001: Cannot import 'ibstore_insync' due to 'unexpected indent (backtrader.backtrader.stores.ibstore_insync, line 509)' (syntax-error) +backtrader/stores/ibstores/wrapper.py:108:8: C0103: Attribute name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:197:8: C0103: Attribute name "_timeoutHandle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:202:8: C0103: Attribute name "accountValues" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:203:8: C0103: Attribute name "acctSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:207:8: C0103: Attribute name "permId2Trade" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:209:8: C0103: Attribute name "newsTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:210:8: C0103: Attribute name "msgId2NewsBulletin" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:212:8: C0103: Attribute name "pendingTickers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:213:8: C0103: Attribute name "reqId2Ticker" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:214:8: C0103: Attribute name "ticker2ReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:215:8: C0103: Attribute name "reqId2Subscriber" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:216:8: C0103: Attribute name "reqId2PnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:217:8: C0103: Attribute name "reqId2PnlSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:218:8: C0103: Attribute name "pnlKey2ReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:219:8: C0103: Attribute name "pnlSingleKey2ReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:220:8: C0103: Attribute name "lastTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:222:8: C0103: Attribute name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:223:8: C0103: Attribute name "wshMetaReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:224:8: C0103: Attribute name "wshEventReqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:225:8: C0103: Attribute name "_reqId2Contract" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:113:0: R0902: Too many instance attributes (30/7) (too-many-instance-attributes) +backtrader/stores/ibstores/wrapper.py:200:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:231:4: C0103: Method name "setEventsDone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:248:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:248:4: C0103: Method name "connectionClosed" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:258:4: C0103: Method name "startReq" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:274:4: C0103: Method name "_endReq" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:294:4: C0103: Method name "startTicker" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:294:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:294:58: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:321:4: C0103: Method name "endTicker" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:321:40: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:330:8: C0103: Variable name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:334:4: C0103: Method name "startSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:334:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:345:4: C0103: Method name "endSubscription" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:354:4: C0103: Method name "orderKey" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:354:23: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:354:38: C0103: Argument name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:354:52: C0103: Argument name "permId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:374:4: C0103: Method name "setTimeout" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:389:4: C0103: Method name "_setTimer" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:412:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:412:4: C0103: Method name "connectAck" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:416:4: C0103: Method name "nextValidId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:416:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:426:4: C0103: Method name "managedAccounts" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:426:30: C0103: Argument name "accountsList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:436:4: C0103: Method name "updateAccountTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:445:4: C0103: Method name "updateAccountValue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:459:8: C0103: Variable name "acctVal" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:464:4: C0103: Method name "accountDownloadEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:476:4: C0103: Method name "accountUpdateMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:478:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:480:8: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:476:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:476:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:502:8: C0103: Variable name "acctVal" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:478:8: W0613: Unused argument 'reqId' (unused-argument) +backtrader/stores/ibstores/wrapper.py:506:4: C0103: Method name "accountUpdateMultiEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:506:36: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:515:4: C0103: Method name "accountSummary" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:516:14: C0103: Argument name "_reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:533:8: C0103: Variable name "acctVal" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:537:4: C0103: Method name "accountSummaryEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:537:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:546:4: C0103: Method name "updatePortfolio" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:549:8: C0103: Argument name "posSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:550:8: C0103: Argument name "marketPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:551:8: C0103: Argument name "marketValue" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:552:8: C0103: Argument name "averageCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:553:8: C0103: Argument name "unrealizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:554:8: C0103: Argument name "realizedPNL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:546:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:546:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:578:8: C0103: Variable name "portfItem" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:588:8: C0103: Variable name "portfolioItems" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:593:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:601:48: C0103: Argument name "posSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:601:64: C0103: Argument name "avgCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:622:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:635:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:635:4: C0103: Method name "positionEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:639:4: C0103: Method name "positionMulti" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:641:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:643:8: C0103: Argument name "modelCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:646:8: C0103: Argument name "avgCost" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:639:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:639:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:665:4: C0103: Method name "positionMultiEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:665:31: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:675:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:676:8: C0103: Argument name "dailyPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:677:8: C0103: Argument name "unrealizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:678:8: C0103: Argument name "realizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:700:4: C0103: Method name "pnlSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:702:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:704:8: C0103: Argument name "dailyPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:705:8: C0103: Argument name "unrealizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:706:8: C0103: Argument name "realizedPnL" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:700:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:700:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:725:8: C0103: Variable name "pnlSingle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:735:4: C0103: Method name "openOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:737:8: C0103: Argument name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:740:8: C0103: Argument name "orderState" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:780:16: C0103: Variable name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:783:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:797:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:797:4: C0103: Method name "openOrderEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:802:4: C0103: Method name "completedOrder" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:802:63: C0103: Argument name "orderState" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:814:8: C0103: Variable name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:822:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:822:4: C0103: Method name "completedOrdersEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:826:4: C0103: Method name "orderStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:828:8: C0103: Argument name "orderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:832:8: C0103: Argument name "avgFillPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:833:8: C0103: Argument name "permId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:834:8: C0103: Argument name "parentId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:835:8: C0103: Argument name "lastFillPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:836:8: C0103: Argument name "clientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:837:8: C0103: Argument name "whyHeld" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:838:8: C0103: Argument name "mktCapPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:826:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:826:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:826:4: R0914: Too many local variables (20/15) (too-many-locals) +backtrader/stores/ibstores/wrapper.py:870:12: C0103: Variable name "oldStatus" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:871:18: R1735: Consider using '{"status": status, "filled": filled, "remaining": remaining, "avgFillPrice": avgFillPrice, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/stores/ibstores/wrapper.py:884:12: C0103: Variable name "isChanged" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:899:16: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:901:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:916:4: C0103: Method name "execDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:916:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:928:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:940:8: C0103: Variable name "execId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:941:8: C0103: Variable name "isLive" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:949:16: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:956:20: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:962:4: C0103: Method name "execDetailsEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:962:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:971:4: C0103: Method name "commissionReport" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:971:31: C0103: Argument name "commissionReport" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:985:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:998:4: C0103: Method name "orderBound" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:998:25: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:998:37: C0103: Argument name "apiClientId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:998:55: C0103: Argument name "apiOrderId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1010:4: C0103: Method name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1010:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1010:42: C0103: Argument name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1024:4: C0103: Method name "contractDetailsEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1024:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1034:4: C0103: Method name "symbolSamples" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1035:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1035:26: C0103: Argument name "contractDescriptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1047:4: C0103: Method name "marketRule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1047:25: C0103: Argument name "marketRuleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1047:44: C0103: Argument name "priceIncrements" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1058:4: C0103: Method name "marketDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1058:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1058:41: C0103: Argument name "marketDataId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1071:4: C0103: Method name "realtimeBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1073:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1071:4: R0913: Too many arguments (10/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1071:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1106:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/wrapper.py:1135:4: C0103: Method name "historicalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1135:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1135:41: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/wrapper.py:1151:4: C0103: Method name "historicalSchedule" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1153:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1154:8: C0103: Argument name "startDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1155:8: C0103: Argument name "endDateTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1156:8: C0103: Argument name "timeZone" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1151:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1151:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1186:4: C0103: Method name "historicalDataEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1186:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1199:4: C0103: Method name "historicalDataUpdate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1199:35: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1199:47: C0104: Disallowed name "bar" (disallowed-name) +backtrader/stores/ibstores/wrapper.py:1210:8: C0103: Variable name "hasNewBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1214:12: C0103: Variable name "lastDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1217:12: C0103: Variable name "hasNewBar" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1229:4: C0103: Method name "headTimestamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1229:28: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1229:40: C0103: Argument name "headTimestamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1244:4: C0103: Method name "historicalTicks" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1244:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1261:4: C0103: Method name "historicalTicksBidAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1262:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1280:4: C0103: Method name "historicalTicksLast" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1281:14: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1300:4: C0103: Method name "priceSizeTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1300:28: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1300:40: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1315:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1300:4: R0912: Too many branches (28/12) (too-many-branches) +backtrader/stores/ibstores/wrapper.py:1300:4: R0915: Too many statements (61/50) (too-many-statements) +backtrader/stores/ibstores/wrapper.py:1378:4: C0103: Method name "tickPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1378:24: C0103: Argument name "tickerId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1378:39: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1392:4: C0103: Method name "tickSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1392:23: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1392:35: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1405:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1392:4: R0912: Too many branches (21/12) (too-many-branches) +backtrader/stores/ibstores/wrapper.py:1457:4: C0103: Method name "tickSnapshotEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1457:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1466:4: C0103: Method name "tickByTickAllLast" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1468:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1469:8: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1473:8: C0103: Argument name "tickAttribLast" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1475:8: C0103: Argument name "specialConditions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1466:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1466:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1497:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1470:8: W0613: Unused argument 'time' (unused-argument) +backtrader/stores/ibstores/wrapper.py:1517:4: C0103: Method name "tickByTickBidAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1519:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1521:8: C0103: Argument name "bidPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1522:8: C0103: Argument name "askPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1523:8: C0103: Argument name "bidSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1524:8: C0103: Argument name "askSize" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1525:8: C0103: Argument name "tickAttribBidAsk" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1517:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1517:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1547:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1520:8: W0613: Unused argument 'time' (unused-argument) +backtrader/stores/ibstores/wrapper.py:1572:4: C0103: Method name "tickByTickMidPoint" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1572:33: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1572:56: C0103: Argument name "midPoint" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1585:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1572:45: W0613: Unused argument 'time' (unused-argument) +backtrader/stores/ibstores/wrapper.py:1591:4: C0103: Method name "tickString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1591:25: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1591:37: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1591:4: R0914: Too many local variables (20/15) (too-many-locals) +backtrader/stores/ibstores/wrapper.py:1631:16: C0103: Variable name "priceStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1631:26: C0103: Variable name "sizeStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1631:35: C0103: Variable name "rtTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1660:32: C0103: Variable name "nextDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1660:42: C0103: Variable name "nextAmount" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1669:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1591:4: R0912: Too many branches (19/12) (too-many-branches) +backtrader/stores/ibstores/wrapper.py:1673:4: C0103: Method name "tickGeneric" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1673:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1673:38: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1690:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1712:4: C0103: Method name "tickReqParams" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1714:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1715:8: C0103: Argument name "minTick" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1716:8: C0103: Argument name "bboExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1717:8: C0103: Argument name "snapshotPermissions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1738:4: C0103: Method name "smartComponents" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1738:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1747:4: C0103: Method name "mktDepthExchanges" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1748:14: C0103: Argument name "depthMktDataDescriptions" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1758:4: C0103: Method name "updateMktDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1760:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1758:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1758:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1785:4: C0103: Method name "updateMktDepthL2" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1787:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1789:8: C0103: Argument name "marketMaker" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1794:8: C0103: Argument name "isSmartDepth" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1785:4: R0913: Too many arguments (9/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1785:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1794:8: W0613: Unused argument 'isSmartDepth' (unused-argument) +backtrader/stores/ibstores/wrapper.py:1837:4: C0103: Method name "tickOptionComputation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1839:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1840:8: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1841:8: C0103: Argument name "tickAttrib" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1842:8: C0103: Argument name "impliedVol" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1844:8: C0103: Argument name "optPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1845:8: C0103: Argument name "pvDividend" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1849:8: C0103: Argument name "undPrice" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1837:4: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1837:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1905:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:1907:4: C0103: Method name "deltaNeutralValidation" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1907:37: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1917:4: C0103: Method name "fundamentalData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1917:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1928:4: C0103: Method name "scannerParameters" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1937:4: C0103: Method name "scannerData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1939:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1941:8: C0103: Argument name "contractDetails" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1945:8: C0103: Argument name "legsStr" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1937:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:1937:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:1966:8: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1968:12: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1974:4: C0103: Method name "scannerDataEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1974:29: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1981:8: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1985:12: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1990:4: C0103: Method name "histogramData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:1990:28: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2002:4: C0103: Method name "securityDefinitionOptionParameter" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2004:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2006:8: C0103: Argument name "underlyingConId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2007:8: C0103: Argument name "tradingClass" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2002:4: R0913: Too many arguments (8/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:2002:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:2040:4: C0103: Method name "securityDefinitionOptionParameterEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2040:51: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2049:4: C0103: Method name "newsProviders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2049:28: C0103: Argument name "newsProviders" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2059:4: C0103: Method name "tickNews" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2061:8: C0103: Argument name "_reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2062:8: C0103: Argument name "timeStamp" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2063:8: C0103: Argument name "providerCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2064:8: C0103: Argument name "articleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2066:8: C0103: Argument name "extraData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2059:4: R0913: Too many arguments (7/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:2059:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:2088:4: C0103: Method name "newsArticle" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2088:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2088:38: C0103: Argument name "articleType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2088:56: C0103: Argument name "articleText" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2102:4: C0103: Method name "historicalNews" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2104:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2106:8: C0103: Argument name "providerCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2107:8: C0103: Argument name "articleId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2102:4: R0913: Too many arguments (6/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:2102:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:2129:4: C0103: Method name "historicalNewsEnd" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2129:32: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2129:39: C0103: Argument name "_hasMore" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2139:4: C0103: Method name "updateNewsBulletin" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2140:14: C0103: Argument name "msgId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2140:26: C0103: Argument name "msgType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2140:54: C0103: Argument name "origExchange" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2158:4: C0103: Method name "receiveFA" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2158:24: C0103: Argument name "_faDataType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2158:42: C0103: Argument name "faXmlData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2169:4: C0103: Method name "currentTime" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2179:4: C0103: Method name "tickEFP" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2181:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2182:8: C0103: Argument name "tickType" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2183:8: C0103: Argument name "basisPoints" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2184:8: C0103: Argument name "formattedBasisPoints" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2185:8: C0103: Argument name "totalDividends" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2186:8: C0103: Argument name "holdDays" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2187:8: C0103: Argument name "futureLastTradeDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2188:8: C0103: Argument name "dividendImpact" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2189:8: C0103: Argument name "dividendsToLastTradeDate" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2179:4: R0913: Too many arguments (10/5) (too-many-arguments) +backtrader/stores/ibstores/wrapper.py:2179:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +backtrader/stores/ibstores/wrapper.py:2214:4: C0103: Method name "wshMetaData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2214:26: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2214:38: C0103: Argument name "dataJson" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2226:4: C0103: Method name "wshEventData" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2226:27: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2226:39: C0103: Argument name "dataJson" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2238:4: C0103: Method name "userInfo" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2238:23: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2238:35: C0103: Argument name "whiteBrandingId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2238:35: W0613: Unused argument 'whiteBrandingId' (unused-argument) +backtrader/stores/ibstores/wrapper.py:2249:4: C0103: Method name "softDollarTiers" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2249:30: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2259:4: C0103: Method name "familyCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2259:26: C0103: Argument name "familyCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2269:8: C0103: Argument name "reqId" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2270:8: C0103: Argument name "errorCode" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2271:8: C0103: Argument name "errorString" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2272:8: C0103: Argument name "advancedOrderRejectJson" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2267:4: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/stores/ibstores/wrapper.py:2287:8: C0103: Variable name "isRequest" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2289:8: C0103: Variable name "warningCodes" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2290:8: C0103: Variable name "isWarning" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2293:12: C0103: Variable name "isWarning" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2300:12: C0103: Variable name "isWarning" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2328:20: C0103: Variable name "logEntry" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2330:20: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/stores/ibstores/wrapper.py:2337:12: C0103: Variable name "dataList" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2267:4: R0912: Too many branches (18/12) (too-many-branches) +backtrader/stores/ibstores/wrapper.py:2267:4: R0915: Too many statements (56/50) (too-many-statements) +backtrader/stores/ibstores/wrapper.py:2388:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:2388:4: C0103: Method name "tcpDataArrived" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:2397:4: C0112: Empty method docstring (empty-docstring) +backtrader/stores/ibstores/wrapper.py:2397:4: C0103: Method name "tcpDataProcessed" doesn't conform to snake_case naming style (invalid-name) +backtrader/stores/ibstores/wrapper.py:113:0: R0904: Too many public methods (90/20) (too-many-public-methods) +************* Module backtrader.backtrader.btrun +backtrader/btrun/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.btrun.btrun +backtrader/btrun/btrun.py:1:0: C0302: Too many lines in module (1040/1000) (too-many-lines) +backtrader/btrun/btrun.py:65:14: R1735: Consider using '{"btcsv": BacktraderCSVData, "vchartcsv": VChartCSVData, "vcfile": VChartFile, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:91:13: R1735: Consider using '{"microseconds": TimeFrame.MicroSeconds, "seconds": TimeFrame.Seconds, ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:133:0: R0914: Too many local variables (32/15) (too-many-locals) +backtrader/btrun/btrun.py:235:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:133:0: R0912: Too many branches (25/12) (too-many-branches) +backtrader/btrun/btrun.py:133:0: R0915: Too many statements (60/50) (too-many-statements) +backtrader/btrun/btrun.py:265:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:314:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:341:12: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/btrun/btrun.py:365:14: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/btrun/btrun.py:396:15: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/btrun/btrun.py:433:11: W0718: Catching too general exception Exception (broad-exception-caught) +backtrader/btrun/btrun.py:437:0: R0914: Too many local variables (17/15) (too-many-locals) +backtrader/btrun/btrun.py:452:17: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/btrun/btrun.py:467:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:473:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:437:0: R0912: Too many branches (14/12) (too-many-branches) +backtrader/btrun/btrun.py:513:19: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/btrun/btrun.py:521:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +backtrader/btrun/btrun.py:527:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +************* Module backtrader.backtrader.commissions +backtrader/commissions/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/commissions/__init__.py:32:0: W0105: String statement has no effect (pointless-string-statement) +************* Module backtrader.backtrader.filters +backtrader/filters/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.filters.bsplitter +backtrader/filters/bsplitter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/bsplitter.py:33:0: C0103: Class name "DaySplitter_Close" doesn't conform to PascalCase naming style (invalid-name) +backtrader/filters/bsplitter.py:33:24: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +backtrader/filters/bsplitter.py:33:42: E1101: Module 'backtrader' has no 'MetaParams' member (no-member) +backtrader/filters/bsplitter.py:67:23: W0613: Unused argument 'data' (unused-argument) +backtrader/filters/bsplitter.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.filters.calendardays +backtrader/filters/calendardays.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/calendardays.py:30:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/filters/calendardays.py:30:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/filters/calendardays.py:93:12: C0104: Disallowed name "bar" (disallowed-name) +backtrader/filters/calendardays.py:99:33: E0606: Possibly using variable 'price' before assignment (possibly-used-before-assignment) +backtrader/filters/calendardays.py:110:12: W0212: Access to a protected member _add2stack of a client class (protected-access) +backtrader/filters/calendardays.py:113:8: W0212: Access to a protected member _save2stack of a client class (protected-access) +backtrader/filters/calendardays.py:35:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.filters.daysteps +backtrader/filters/daysteps.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/daysteps.py:29:0: C0103: Class name "BarReplayer_Open" doesn't conform to PascalCase naming style (invalid-name) +backtrader/filters/daysteps.py:29:0: R0205: Class 'BarReplayer_Open' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/filters/daysteps.py:96:12: W0212: Access to a protected member _add2stack of a client class (protected-access) +************* Module backtrader.backtrader.filters.heikinashi +backtrader/filters/heikinashi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/heikinashi.py:31:0: R0205: Class 'HeikinAshi' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/filters/heikinashi.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.filters.renko +backtrader/filters/renko.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/renko.py:28:0: E0611: No name 'Filter' in module 'backtrader.backtrader.filters' (no-name-in-module) +backtrader/filters/renko.py:76:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +backtrader/filters/renko.py:53:8: W0201: Attribute '_size' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:81:16: W0201: Attribute '_size' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:102:16: W0201: Attribute '_size' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:57:8: W0201: Attribute '_top' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:87:12: W0201: Attribute '_top' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:99:12: W0201: Attribute '_top' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:58:8: W0201: Attribute '_bot' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:78:12: W0201: Attribute '_bot' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/renko.py:108:12: W0201: Attribute '_bot' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.filters.session +backtrader/filters/session.py:224:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +backtrader/filters/session.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/session.py:30:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/filters/session.py:31:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +backtrader/filters/session.py:31:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +backtrader/filters/session.py:156:12: W0212: Access to a protected member _save2stack of a client class (protected-access) +backtrader/filters/session.py:168:8: C0104: Disallowed name "bar" (disallowed-name) +backtrader/filters/session.py:187:8: W0212: Access to a protected member _add2stack of a client class (protected-access) +backtrader/filters/session.py:107:16: E0203: Access to member 'dtime_prev' before its definition line 127 (access-member-before-definition) +backtrader/filters/session.py:127:12: W0201: Attribute 'dtime_prev' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/session.py:132:12: W0201: Attribute 'dtime_prev' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/session.py:36:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/filters/session.py:192:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/filters/session.py:227:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.filters.datafiller +backtrader/filters/datafiller.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/datafiller.py:31:0: E0611: No name 'AbstractDataBase' in module 'backtrader' (no-name-in-module) +backtrader/filters/datafiller.py:31:0: E0611: No name 'TimeFrame' in module 'backtrader' (no-name-in-module) +backtrader/filters/datafiller.py:57:4: C0112: Empty method docstring (empty-docstring) +backtrader/filters/datafiller.py:59:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/filters/datafiller.py:63:4: C0112: Empty method docstring (empty-docstring) +backtrader/filters/datafiller.py:72:45: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/filters/datafiller.py:73:49: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/filters/datafiller.py:75:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/filters/datafiller.py:112:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/filters/datafiller.py:116:30: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/filters/datafiller.py:117:32: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/filters/datafiller.py:60:8: W0201: Attribute '_fillbars' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:61:8: W0201: Attribute '_dbar' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:83:8: W0201: Attribute '_dbar' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:130:8: W0201: Attribute '_dbar' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:171:12: W0201: Attribute '_dbar' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:72:27: W0201: Attribute '_timeframe' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:116:12: W0201: Attribute '_timeframe' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:73:29: W0201: Attribute '_compression' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:117:12: W0201: Attribute '_compression' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafiller.py:123:12: W0201: Attribute '_tdunit' defined outside __init__ (attribute-defined-outside-init) +************* Module backtrader.backtrader.filters.datafilter +backtrader/filters/datafilter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/filters/datafilter.py:31:17: E1101: Module 'backtrader' has no 'AbstractDataBase' member (no-member) +backtrader/filters/datafilter.py:50:4: C0112: Empty method docstring (empty-docstring) +backtrader/filters/datafilter.py:59:45: W0212: Access to a protected member _timeframe of a client class (protected-access) +backtrader/filters/datafilter.py:60:49: W0212: Access to a protected member _compression of a client class (protected-access) +backtrader/filters/datafilter.py:62:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/filters/datafilter.py:66:11: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) +backtrader/filters/datafilter.py:59:27: W0201: Attribute '_timeframe' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafilter.py:60:29: W0201: Attribute '_compression' defined outside __init__ (attribute-defined-outside-init) +backtrader/filters/datafilter.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.signals +backtrader/signals/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.sizers +backtrader/sizers/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.sizers.fixedsize +backtrader/sizers/fixedsize.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/sizers/fixedsize.py:31:16: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +backtrader/sizers/fixedsize.py:51:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/sizers/fixedsize.py:42:25: W0613: Unused argument 'comminfo' (unused-argument) +backtrader/sizers/fixedsize.py:42:35: W0613: Unused argument 'cash' (unused-argument) +backtrader/sizers/fixedsize.py:42:41: W0613: Unused argument 'data' (unused-argument) +backtrader/sizers/fixedsize.py:42:47: W0613: Unused argument 'isbuy' (unused-argument) +backtrader/sizers/fixedsize.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/sizers/fixedsize.py:71:20: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +backtrader/sizers/fixedsize.py:84:25: W0613: Unused argument 'comminfo' (unused-argument) +backtrader/sizers/fixedsize.py:84:35: W0613: Unused argument 'cash' (unused-argument) +backtrader/sizers/fixedsize.py:84:47: W0613: Unused argument 'isbuy' (unused-argument) +backtrader/sizers/fixedsize.py:71:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/sizers/fixedsize.py:98:22: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +backtrader/sizers/fixedsize.py:119:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/sizers/fixedsize.py:110:25: W0613: Unused argument 'comminfo' (unused-argument) +backtrader/sizers/fixedsize.py:110:35: W0613: Unused argument 'cash' (unused-argument) +backtrader/sizers/fixedsize.py:110:41: W0613: Unused argument 'data' (unused-argument) +backtrader/sizers/fixedsize.py:110:47: W0613: Unused argument 'isbuy' (unused-argument) +backtrader/sizers/fixedsize.py:98:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.sizers.percents_sizer +backtrader/sizers/percents_sizer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/sizers/percents_sizer.py:33:19: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +backtrader/sizers/percents_sizer.py:55:43: E1101: Instance of 'tuple' has no 'percents' member (no-member) +backtrader/sizers/percents_sizer.py:44:25: W0613: Unused argument 'comminfo' (unused-argument) +backtrader/sizers/percents_sizer.py:44:47: W0613: Unused argument 'isbuy' (unused-argument) +backtrader/sizers/percents_sizer.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/sizers/percents_sizer.py:65:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/sizers/percents_sizer.py:71:0: R0903: Too few public methods (0/2) (too-few-public-methods) +backtrader/sizers/percents_sizer.py:82:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.strategies.nullstrategy +backtrader/strategies/nullstrategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/strategies/nullstrategy.py:8:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +backtrader/strategies/nullstrategy.py:8:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.strategies +backtrader/strategies/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.strategies.sma_crossover +backtrader/strategies/sma_crossover.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/strategies/sma_crossover.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +backtrader/strategies/sma_crossover.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +backtrader/strategies/sma_crossover.py:32:0: C0103: Class name "MA_CrossOver" doesn't conform to PascalCase naming style (invalid-name) +backtrader/strategies/sma_crossover.py:32:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +backtrader/strategies/sma_crossover.py:74:4: C0112: Empty method docstring (empty-docstring) +backtrader/strategies/sma_crossover.py:32:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.studies +backtrader/studies/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.studies.contrib +backtrader/studies/contrib/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/studies/contrib/__init__.py:30:0: C0414: Import alias does not rename original package (useless-import-alias) +backtrader/studies/contrib/__init__.py:33:12: E1101: Module 'backtrader' has no 'studies' member (no-member) +************* Module backtrader.backtrader.studies.contrib.fractal +backtrader/studies/contrib/fractal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/studies/contrib/fractal.py:29:14: E1101: Module 'backtrader' has no 'ind' member (no-member) +backtrader/studies/contrib/fractal.py:38:15: R1735: Consider using '{"subplot": False, "plotlinelabels": False, "plot": True}' instead of a call to 'dict'. (use-dict-literal) +backtrader/studies/contrib/fractal.py:40:16: R1735: Consider using '{"fractal_bearish": dict(marker='^', markersize=4.0, color='lightblue', fillstyle='full', ls=''), ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/studies/contrib/fractal.py:41:24: R1735: Consider using '{"marker": '^', "markersize": 4.0, "color": 'lightblue', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/studies/contrib/fractal.py:48:24: R1735: Consider using '{"marker": 'v', "markersize": 4.0, "color": 'lightblue', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +backtrader/studies/contrib/fractal.py:62:4: C0112: Empty method docstring (empty-docstring) +backtrader/studies/contrib/fractal.py:72:12: E1101: Instance of 'tuple' has no 'fractal_bearish' member (no-member) +backtrader/studies/contrib/fractal.py:29:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.backtrader.utils +backtrader/utils/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.utils.date +backtrader/utils/date.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.backtrader.utils.flushfile +backtrader/utils/flushfile.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/utils/flushfile.py:31:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/flushfile.py:31:0: C0103: Class name "flushfile" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/flushfile.py:31:0: R0205: Class 'flushfile' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/utils/flushfile.py:51:4: C0112: Empty method docstring (empty-docstring) +backtrader/utils/flushfile.py:61:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/flushfile.py:61:0: R0205: Class 'StdOutDevNull' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/utils/flushfile.py:76:4: C0112: Empty method docstring (empty-docstring) +backtrader/utils/flushfile.py:79:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.utils.autodict +backtrader/utils/autodict.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/utils/autodict.py:33:0: C0112: Empty function docstring (empty-docstring) +backtrader/utils/autodict.py:33:0: C0103: Function name "Tree" doesn't conform to snake_case naming style (invalid-name) +backtrader/utils/autodict.py:38:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/autodict.py:47:28: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/utils/autodict.py:51:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/autodict.py:62:19: E1101: Super of 'DotDict' has no '__getattr__' member (no-member) +backtrader/utils/autodict.py:62:19: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +backtrader/utils/autodict.py:66:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/autodict.py:76:16: W0212: Access to a protected member _close of a client class (protected-access) +backtrader/utils/autodict.py:74:12: W0612: Unused variable 'key' (unused-variable) +backtrader/utils/autodict.py:100:11: R1727: Boolean condition 'False and key.startswith('_')' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/utils/autodict.py:112:11: R1727: Boolean condition 'False and key.startswith('_')' will always evaluate to 'False' (condition-evals-to-constant) +backtrader/utils/autodict.py:119:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/autodict.py:129:16: W0212: Access to a protected member _close of a client class (protected-access) +backtrader/utils/autodict.py:127:12: W0612: Unused variable 'key' (unused-variable) +backtrader/utils/autodict.py:228:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.utils.dateintern +backtrader/utils/dateintern.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/utils/dateintern.py:65:8: C0415: Import outside toplevel (pytz) (import-outside-toplevel) +backtrader/utils/dateintern.py:81:0: C0103: Function name "Localizer" doesn't conform to snake_case naming style (invalid-name) +backtrader/utils/dateintern.py:87:4: C0415: Import outside toplevel (types) (import-outside-toplevel) +backtrader/utils/dateintern.py:150:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/utils/dateintern.py:161:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +backtrader/utils/dateintern.py:230:4: W0105: String statement has no effect (pointless-string-statement) +backtrader/utils/dateintern.py:253:7: R1726: Boolean condition "True and tz is not None" may be simplified to "tz is not None" (simplifiable-condition) +************* Module backtrader.backtrader.utils.ordereddefaultdict +backtrader/utils/ordereddefaultdict.py:21:0: C0301: Line too long (122/100) (line-too-long) +backtrader/utils/ordereddefaultdict.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/utils/ordereddefaultdict.py:35:0: C0112: Empty class docstring (empty-docstring) +backtrader/utils/ordereddefaultdict.py:52:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +************* Module backtrader.backtrader.utils.py3 +backtrader/utils/py3.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/utils/py3.py:48:4: W0622: Redefining built-in 'filter' (redefined-builtin) +backtrader/utils/py3.py:49:4: W0622: Redefining built-in 'map' (redefined-builtin) +backtrader/utils/py3.py:50:4: W0622: Redefining built-in 'range' (redefined-builtin) +backtrader/utils/py3.py:51:4: W0622: Redefining built-in 'zip' (redefined-builtin) +backtrader/utils/py3.py:56:4: W0622: Redefining built-in 'bytes' (redefined-builtin) +backtrader/utils/py3.py:39:13: E1101: Module 'sys' has no 'maxint' member (no-member) +backtrader/utils/py3.py:40:14: E1101: Module 'sys' has no 'maxint' member (no-member) +backtrader/utils/py3.py:45:24: E0602: Undefined variable 'unicode' (undefined-variable) +backtrader/utils/py3.py:46:25: E0601: Using variable 'long' before assignment (used-before-assignment) +backtrader/utils/py3.py:48:13: E1101: Module 'itertools' has no 'ifilter' member (no-member) +backtrader/utils/py3.py:49:10: E1101: Module 'itertools' has no 'imap' member (no-member) +backtrader/utils/py3.py:50:12: E0602: Undefined variable 'xrange' (undefined-variable) +backtrader/utils/py3.py:51:10: E1101: Module 'itertools' has no 'izip' member (no-member) +backtrader/utils/py3.py:52:4: W0127: Assigning the same variable 'long' to itself (self-assigning-variable) +backtrader/utils/py3.py:54:4: W0127: Assigning the same variable 'cmp' to itself (self-assigning-variable) +backtrader/utils/py3.py:54:10: E0602: Undefined variable 'cmp' (undefined-variable) +backtrader/utils/py3.py:56:4: W0127: Assigning the same variable 'bytes' to itself (self-assigning-variable) +backtrader/utils/py3.py:56:4: C0103: Class name "bytes" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:57:4: C0103: Class name "bstr" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:122:4: W0127: Assigning the same variable 'filter' to itself (self-assigning-variable) +backtrader/utils/py3.py:122:4: C0103: Class name "filter" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:123:4: W0127: Assigning the same variable 'map' to itself (self-assigning-variable) +backtrader/utils/py3.py:123:4: C0103: Class name "map" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:124:4: W0127: Assigning the same variable 'range' to itself (self-assigning-variable) +backtrader/utils/py3.py:124:4: C0103: Class name "range" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:125:4: W0127: Assigning the same variable 'zip' to itself (self-assigning-variable) +backtrader/utils/py3.py:125:4: C0103: Class name "zip" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:126:4: C0103: Class name "long" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:214:4: C0112: Empty class docstring (empty-docstring) +backtrader/utils/py3.py:214:4: C0103: Class name "metaclass" doesn't conform to PascalCase naming style (invalid-name) +backtrader/utils/py3.py:217:31: W0613: Unused argument 'this_bases' (unused-argument) +backtrader/utils/py3.py:214:4: R0903: Too few public methods (1/2) (too-few-public-methods) +backtrader/utils/py3.py:1:0: W0612: Unused variable 'temporary_class' (unused-variable) +backtrader/utils/py3.py:35:8: W0611: Unused _winreg imported as winreg (unused-import) +backtrader/utils/py3.py:109:8: W0611: Unused import winreg (unused-import) +************* Module backtrader.backtrader.utils.iter +backtrader/utils/iter.py:25:16: R1734: Consider using [] instead of list() (use-list-literal) +backtrader/utils/iter.py:8:0: C0411: standard import "collections" should be placed before local import "py3.string_types" (wrong-import-order) +************* Module backtrader.backtrader.utils.optreturn +backtrader/utils/optreturn.py:8:0: R0205: Class 'OptReturn' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +backtrader/utils/optreturn.py:8:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtrader.utils.calendar +backtrader/utils/calendar.py:19:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +************* Module backtrader.backtrader.utils.timer +backtrader/utils/timer.py:11:0: R0913: Too many arguments (13/5) (too-many-arguments) +backtrader/utils/timer.py:11:0: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +backtrader/utils/timer.py:11:0: R0914: Too many local variables (16/15) (too-many-locals) +backtrader/utils/timer.py:11:0: W1113: Keyword argument before variable positional arguments list in the definition of create_timer function (keyword-arg-before-vararg) +backtrader/utils/timer.py:73:0: R0913: Too many arguments (12/5) (too-many-arguments) +backtrader/utils/timer.py:73:0: R0917: Too many positional arguments (12/5) (too-many-positional-arguments) +backtrader/utils/timer.py:73:0: W1113: Keyword argument before variable positional arguments list in the definition of schedule_timer function (keyword-arg-before-vararg) +backtrader/utils/timer.py:108:8: W0212: Access to a protected member _pretimers of a client class (protected-access) +backtrader/utils/timer.py:134:4: W0107: Unnecessary pass statement (unnecessary-pass) +backtrader/utils/timer.py:126:17: W0613: Unused argument 'timer' (unused-argument) +backtrader/utils/timer.py:126:24: W0613: Unused argument 'when' (unused-argument) +backtrader/utils/timer.py:126:0: W0613: Unused argument 'args' (unused-argument) +backtrader/utils/timer.py:126:0: W0613: Unused argument 'kwargs' (unused-argument) +************* Module backtrader.backtrader.listeners.recorder +backtrader/listeners/recorder.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtrader/listeners/recorder.py:6:0: E0401: Unable to import 'backtrader.listener' (import-error) +backtrader/listeners/recorder.py:6:0: E0611: No name 'listener' in module 'backtrader' (no-name-in-module) +backtrader/listeners/recorder.py:11:0: C0112: Empty class docstring (empty-docstring) +backtrader/listeners/recorder.py:16:32: E1101: Module 'backtrader' has no 'cerebro' member (no-member) +backtrader/listeners/recorder.py:37:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +backtrader/listeners/recorder.py:38:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/listeners/recorder.py:44:24: W0622: Redefining built-in 'next' (redefined-builtin) +backtrader/listeners/recorder.py:51:8: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/listeners/recorder.py:55:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/listeners/recorder.py:60:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/listeners/recorder.py:65:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation) +backtrader/listeners/recorder.py:90:24: W0212: Access to a protected member _getlinealias of a client class (protected-access) +backtrader/listeners/recorder.py:108:28: W0212: Access to a protected member _name of a client class (protected-access) +backtrader/listeners/recorder.py:107:12: W0612: Unused variable 'i' (unused-variable) +backtrader/listeners/recorder.py:132:4: C0112: Empty method docstring (empty-docstring) +************* Module backtrader.backtrader.orders +backtrader/orders/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.arbitrage.JM_J_strategy_CUSUM +arbitrage/JM_J_strategy_CUSUM.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_CUSUM.py:1:0: C0103: Module name "JM_J_strategy_CUSUM" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_CUSUM.py:118:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM.py:118:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:118:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_CUSUM.py:129:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM.py:129:0: R0902: Too many instance attributes (18/7) (too-many-instance-attributes) +arbitrage/JM_J_strategy_CUSUM.py:129:33: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:154:26: E1101: Module 'backtrader' has no 'ind' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:214:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM.py:302:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM.py:305:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM.py:308:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:316:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM.py:319:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:172:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM.py:274:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM.py:173:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM.py:275:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM.py:347:0: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM.py:347:0: R0914: Too many local variables (29/15) (too-many-locals) +arbitrage/JM_J_strategy_CUSUM.py:376:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:377:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:381:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:402:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:404:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:405:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:410:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:411:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:414:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:416:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:417:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:418:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM.py:347:0: R0915: Too many statements (67/50) (too-many-statements) +arbitrage/JM_J_strategy_CUSUM.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_CUSUM.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:16:0: C0301: Line too long (115/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:626:0: C0301: Line too long (171/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:627:0: C0301: Line too long (170/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:628:0: C0301: Line too long (170/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:629:0: C0301: Line too long (169/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:630:0: C0301: Line too long (171/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:631:0: C0301: Line too long (171/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:632:0: C0301: Line too long (171/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:633:0: C0301: Line too long (173/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:634:0: C0301: Line too long (171/100) (line-too-long) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_CUSUM_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:61:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:61:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:61:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:72:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:72:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:72:33: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:90:26: E1101: Module 'backtrader' has no 'ind' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:138:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:197:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:203:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:206:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:214:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:217:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:240:0: R0913: Too many arguments (10/5) (too-many-arguments) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:240:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:240:0: R0914: Too many local variables (22/15) (too-many-locals) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:254:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:276:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:277:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:281:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:282:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:283:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:326:0: R0913: Too many arguments (9/5) (too-many-arguments) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:326:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:326:0: R0914: Too many local variables (34/15) (too-many-locals) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:388:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:389:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:376:4: R1702: Too many nested blocks (6/5) (too-many-nested-blocks) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:326:0: R0912: Too many branches (16/12) (too-many-branches) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:326:0: R0915: Too many statements (62/50) (too-many-statements) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_CUSUM_GridSearch.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_trailing_stop +arbitrage/JM_J_strategy_trailing_stop.py:1:0: C0103: Module name "JM_J_strategy_trailing_stop" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.CUSUM_GridSearch_CLI +arbitrage/CUSUM_GridSearch_CLI.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/CUSUM_GridSearch_CLI.py:1:0: C0103: Module name "CUSUM_GridSearch_CLI" doesn't conform to snake_case naming style (invalid-name) +arbitrage/CUSUM_GridSearch_CLI.py:59:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/CUSUM_GridSearch_CLI.py:59:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:59:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/CUSUM_GridSearch_CLI.py:70:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/CUSUM_GridSearch_CLI.py:70:33: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:101:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/CUSUM_GridSearch_CLI.py:144:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/CUSUM_GridSearch_CLI.py:150:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/CUSUM_GridSearch_CLI.py:153:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:161:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/CUSUM_GridSearch_CLI.py:164:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:87:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/CUSUM_GridSearch_CLI.py:128:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/CUSUM_GridSearch_CLI.py:88:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/CUSUM_GridSearch_CLI.py:129:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/CUSUM_GridSearch_CLI.py:171:0: R0913: Too many arguments (8/5) (too-many-arguments) +arbitrage/CUSUM_GridSearch_CLI.py:171:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +arbitrage/CUSUM_GridSearch_CLI.py:171:0: R0914: Too many local variables (20/15) (too-many-locals) +arbitrage/CUSUM_GridSearch_CLI.py:183:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:203:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:204:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:208:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:209:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:210:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:210:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:211:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:248:0: R0913: Too many arguments (9/5) (too-many-arguments) +arbitrage/CUSUM_GridSearch_CLI.py:248:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +arbitrage/CUSUM_GridSearch_CLI.py:248:0: R0914: Too many local variables (30/15) (too-many-locals) +arbitrage/CUSUM_GridSearch_CLI.py:310:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:317:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/CUSUM_GridSearch_CLI.py:381:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/CUSUM_GridSearch_CLI.py:385:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +arbitrage/CUSUM_GridSearch_CLI.py:248:0: R0912: Too many branches (17/12) (too-many-branches) +arbitrage/CUSUM_GridSearch_CLI.py:248:0: R0915: Too many statements (65/50) (too-many-statements) +arbitrage/CUSUM_GridSearch_CLI.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/CUSUM_GridSearch_CLI.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_CUSUM copy +arbitrage/JM_J_strategy_CUSUM copy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:1:0: C0103: Module name "JM_J_strategy_CUSUM copy" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_CUSUM copy.py:94:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:94:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:94:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_CUSUM copy.py:105:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:105:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +arbitrage/JM_J_strategy_CUSUM copy.py:105:33: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:140:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:162:19: W0212: Access to a protected member _name of a client class (protected-access) +arbitrage/JM_J_strategy_CUSUM copy.py:163:19: W0212: Access to a protected member _name of a client class (protected-access) +arbitrage/JM_J_strategy_CUSUM copy.py:166:19: W0212: Access to a protected member _name of a client class (protected-access) +arbitrage/JM_J_strategy_CUSUM copy.py:167:19: W0212: Access to a protected member _name of a client class (protected-access) +arbitrage/JM_J_strategy_CUSUM copy.py:214:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:217:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM copy.py:220:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:228:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_CUSUM copy.py:231:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:126:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM copy.py:198:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM copy.py:127:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM copy.py:199:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_CUSUM copy.py:242:0: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_CUSUM copy.py:242:0: R0914: Too many local variables (21/15) (too-many-locals) +arbitrage/JM_J_strategy_CUSUM copy.py:266:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:273:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:283:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:302:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:303:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:303:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:305:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:306:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:311:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:312:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:315:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:315:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:317:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:319:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:320:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:321:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_CUSUM copy.py:242:0: R0915: Too many statements (55/50) (too-many-statements) +arbitrage/JM_J_strategy_CUSUM copy.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_CUSUM copy.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_RSI_Bollinger_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:57:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:57:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:57:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:68:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:68:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:68:40: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:83:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:86:22: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:98:22: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:119:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:129:8: W0612: Unused variable 'bb_pct_value' (unused-variable) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:162:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:168:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:171:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:179:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:182:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:106:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:142:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:107:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:143:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:189:0: R0913: Too many arguments (9/5) (too-many-arguments) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:189:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:189:0: R0914: Too many local variables (21/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:202:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:224:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:225:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:229:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:230:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:231:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:231:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:232:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:271:0: R0914: Too many local variables (29/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:301:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:308:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:295:4: R1702: Too many nested blocks (6/5) (too-many-nested-blocks) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:379:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:271:0: R0915: Too many statements (51/50) (too-many-statements) +arbitrage/JM_J_strategy_RSI_Bollinger_GridSearch.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_RSI_GridSearch +arbitrage/JM_J_strategy_RSI_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_RSI_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_RSI_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_RSI_GridSearch.py:57:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_GridSearch.py:57:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:57:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_RSI_GridSearch.py:68:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_GridSearch.py:68:31: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:82:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:99:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_GridSearch.py:132:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_GridSearch.py:138:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_GridSearch.py:141:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:149:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_GridSearch.py:152:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:86:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_GridSearch.py:115:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_GridSearch.py:87:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_GridSearch.py:116:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_GridSearch.py:159:0: R0913: Too many arguments (8/5) (too-many-arguments) +arbitrage/JM_J_strategy_RSI_GridSearch.py:159:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_RSI_GridSearch.py:159:0: R0914: Too many local variables (20/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_GridSearch.py:171:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:192:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:193:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:197:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:198:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:199:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:199:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:200:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:238:0: R0914: Too many local variables (27/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_GridSearch.py:267:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:274:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_GridSearch.py:341:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/JM_J_strategy_RSI_GridSearch.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:414:0: C0301: Line too long (123/100) (line-too-long) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_RSI_MACD_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:57:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:57:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:57:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:68:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:68:0: C0103: Class name "DynamicSpreadRSI_MACD_Strategy" doesn't conform to PascalCase naming style (invalid-name) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:68:37: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:86:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:89:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:115:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:154:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:160:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:163:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:171:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:174:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:102:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:138:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:103:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:139:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:181:0: R0913: Too many arguments (9/5) (too-many-arguments) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:181:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:181:0: R0914: Too many local variables (21/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:194:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:216:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:217:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:221:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:222:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:223:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:223:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:224:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:263:0: R0914: Too many local variables (29/15) (too-many-locals) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:293:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:300:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:287:4: R1702: Too many nested blocks (6/5) (too-many-nested-blocks) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:372:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/JM_J_strategy_RSI_MACD_GridSearch.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch +arbitrage/JM_J_strategy_ZScore_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_ZScore_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:7:0: E0401: Unable to import 'seaborn' (import-error) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:60:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:60:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:60:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:71:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:71:34: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:83:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:84:22: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:103:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:143:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:149:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:152:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:160:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:163:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:89:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:122:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:90:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:123:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:170:0: R0913: Too many arguments (7/5) (too-many-arguments) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:170:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:170:0: R0914: Too many local variables (19/15) (too-many-locals) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:173:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:193:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:194:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:198:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:199:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:200:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:200:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:201:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:238:0: R0914: Too many local variables (20/15) (too-many-locals) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:260:4: W0612: Unused variable 'fig' (unused-variable) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:319:0: R0914: Too many local variables (25/15) (too-many-locals) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:347:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:354:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:417:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/JM_J_strategy_ZScore_GridSearch.py:7:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.concat_cusum +arbitrage/concat_cusum.py:59:4: C0103: Constant name "pattern" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio +arbitrage/JM_J_strategy_adjust_pair_ratio.py:217:0: C0301: Line too long (158/100) (line-too-long) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:1:0: C0103: Module name "JM_J_strategy_adjust_pair_ratio" doesn't conform to snake_case naming style (invalid-name) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:9:29: W0621: Redefining name 'df0' from outer scope (line 49) (redefined-outer-name) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:9:34: W0621: Redefining name 'df1' from outer scope (line 50) (redefined-outer-name) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:48:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:67:0: C0112: Empty class docstring (empty-docstring) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:67:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:67:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:86:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:87:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:91:0: C0112: Empty class docstring (empty-docstring) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:91:28: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:102:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:113:4: C0112: Empty method docstring (empty-docstring) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:189:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:192:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:200:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:203:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:126:8: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:159:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:127:8: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:160:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:221:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:246:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:250:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:251:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:256:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:257:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:259:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:264:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:266:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/JM_J_strategy_adjust_pair_ratio.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.hold_rb +arbitrage/hold_rb.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/hold_rb.py:6:0: C0112: Empty class docstring (empty-docstring) +arbitrage/hold_rb.py:6:27: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/hold_rb.py:16:4: C0112: Empty method docstring (empty-docstring) +arbitrage/hold_rb.py:41:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/hold_rb.py:47:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/hold_rb.py:50:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/hold_rb.py:62:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/hold_rb.py:63:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/hold_rb.py:67:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/hold_rb.py:68:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/hold_rb.py:70:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/hold_rb.py:72:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/hold_rb.py:77:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/hold_rb.py:77:38: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/hold_rb.py:97:6: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/hold_rb.py:99:10: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/hold_rb.py:2:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.test_feedspread_yearly +arbitrage/test_feedspread_yearly.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/test_feedspread_yearly.py:51:21: C0103: Argument name "df_I" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test_feedspread_yearly.py:51:27: C0103: Argument name "df_RB" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test_feedspread_yearly.py:51:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +arbitrage/test_feedspread_yearly.py:51:21: W0621: Redefining name 'df_I' from outer scope (line 238) (redefined-outer-name) +arbitrage/test_feedspread_yearly.py:51:27: W0621: Redefining name 'df_RB' from outer scope (line 239) (redefined-outer-name) +arbitrage/test_feedspread_yearly.py:63:4: W0621: Redefining name 'df_spread' from outer scope (line 242) (redefined-outer-name) +arbitrage/test_feedspread_yearly.py:60:4: C0103: Variable name "df_I_aligned" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test_feedspread_yearly.py:60:18: C0103: Variable name "df_RB_aligned" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test_feedspread_yearly.py:76:0: C0112: Empty class docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:76:30: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/test_feedspread_yearly.py:89:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/test_feedspread_yearly.py:103:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:163:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:174:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:196:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:201:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test_feedspread_yearly.py:212:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test_feedspread_yearly.py:222:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test_feedspread_yearly.py:226:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test_feedspread_yearly.py:229:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test_feedspread_yearly.py:184:8: W0201: Attribute 'annual_metrics' defined outside __init__ (attribute-defined-outside-init) +arbitrage/test_feedspread_yearly.py:237:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test_feedspread_yearly.py:259:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/test_feedspread_yearly.py:260:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/test_feedspread_yearly.py:261:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/test_feedspread_yearly.py:264:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/test_feedspread_yearly.py:4:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/test_feedspread_yearly.py:5:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.myutil +arbitrage/myutil.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/myutil.py:3:0: E0401: Unable to import 'statsmodels.api' (import-error) +arbitrage/myutil.py:41:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +arbitrage/myutil.py:93:4: W0621: Redefining name 'pd' from outer scope (line 2) (redefined-outer-name) +arbitrage/myutil.py:85:13: E0601: Using variable 'pd' before assignment (used-before-assignment) +arbitrage/myutil.py:110:4: C0415: Import outside toplevel (fractions.Fraction) (import-outside-toplevel) +arbitrage/myutil.py:116:0: C0112: Empty class docstring (empty-docstring) +arbitrage/myutil.py:122:8: C0103: Attribute name "P" doesn't conform to snake_case naming style (invalid-name) +arbitrage/myutil.py:123:8: C0103: Attribute name "Q" doesn't conform to snake_case naming style (invalid-name) +arbitrage/myutil.py:124:8: C0103: Attribute name "R" doesn't conform to snake_case naming style (invalid-name) +arbitrage/myutil.py:134:8: C0103: Variable name "P_pred" doesn't conform to snake_case naming style (invalid-name) +arbitrage/myutil.py:137:8: C0103: Variable name "K" doesn't conform to snake_case naming style (invalid-name) +arbitrage/myutil.py:116:0: R0903: Too few public methods (1/2) (too-few-public-methods) +arbitrage/myutil.py:156:28: E0606: Possibly using variable 'beta' before assignment (possibly-used-before-assignment) +arbitrage/myutil.py:172:4: C0103: Variable name "X" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.test +arbitrage/test.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/test.py:5:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:33:21: C0103: Argument name "df_I" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test.py:33:27: C0103: Argument name "df_RB" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test.py:33:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +arbitrage/test.py:33:21: W0621: Redefining name 'df_I' from outer scope (line 6) (redefined-outer-name) +arbitrage/test.py:33:27: W0621: Redefining name 'df_RB' from outer scope (line 7) (redefined-outer-name) +arbitrage/test.py:42:4: W0621: Redefining name 'df_spread' from outer scope (line 81) (redefined-outer-name) +arbitrage/test.py:41:4: C0103: Variable name "df_I_aligned" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test.py:41:18: C0103: Variable name "df_RB_aligned" doesn't conform to snake_case naming style (invalid-name) +arbitrage/test.py:52:28: W0621: Redefining name 'returns' from outer scope (line 100) (redefined-outer-name) +arbitrage/test.py:63:4: W0621: Redefining name 'annual_sharpe' from outer scope (line 136) (redefined-outer-name) +arbitrage/test.py:68:17: W0621: Redefining name 'nav' from outer scope (line 135) (redefined-outer-name) +arbitrage/test.py:76:4: W0621: Redefining name 'max_drawdown' from outer scope (line 68) (redefined-outer-name) +arbitrage/test.py:84:0: C0103: Constant name "period" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:85:0: C0103: Constant name "devfactor" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:94:0: C0103: Constant name "initial_cash" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:95:0: C0103: Constant name "cash" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:96:0: C0103: Constant name "position" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:111:12: C0103: Constant name "position" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:114:12: C0103: Constant name "position" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:119:24: E0606: Possibly using variable 'entry_price' before assignment (possibly-used-before-assignment) +arbitrage/test.py:122:8: C0103: Constant name "position" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test.py:128:8: C0103: Constant name "position" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.arbitrage.Kalman +arbitrage/Kalman.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/Kalman.py:1:0: C0103: Module name "Kalman" doesn't conform to snake_case naming style (invalid-name) +arbitrage/Kalman.py:7:0: E0401: Unable to import 'pykalman' (import-error) +arbitrage/Kalman.py:8:0: E0401: Unable to import 'statsmodels.regression.linear_model' (import-error) +arbitrage/Kalman.py:9:0: E0401: Unable to import 'statsmodels.tsa.stattools' (import-error) +arbitrage/Kalman.py:11:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/Kalman.py:47:4: W0621: Redefining name 'intercept' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:48:4: W0621: Redefining name 'hedge_ratio' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:49:4: W0621: Redefining name 'spread' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:55:24: W0621: Redefining name 'spread' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:67:4: W0621: Redefining name 'half_life' from outer scope (line 203) (redefined-outer-name) +arbitrage/Kalman.py:80:4: W0621: Redefining name 'hedge_ratio' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:81:4: W0621: Redefining name 'spread' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:84:4: W0621: Redefining name 'p_value' from outer scope (line 193) (redefined-outer-name) +arbitrage/Kalman.py:90:0: C0112: Empty class docstring (empty-docstring) +arbitrage/Kalman.py:90:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/Kalman.py:90:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/Kalman.py:101:0: C0112: Empty class docstring (empty-docstring) +arbitrage/Kalman.py:101:32: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/Kalman.py:119:18: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/Kalman.py:122:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/Kalman.py:129:4: C0112: Empty method docstring (empty-docstring) +arbitrage/Kalman.py:135:8: W0621: Redefining name 'hedge_ratio' from outer scope (line 200) (redefined-outer-name) +arbitrage/Kalman.py:184:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/Kalman.py:216:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/Kalman.py:219:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/Kalman.py:233:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/Kalman.py:255:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/Kalman.py:256:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/Kalman.py:256:53: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/Kalman.py:258:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/Kalman.py:259:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/Kalman.py:263:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/Kalman.py:263:47: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/Kalman.py:264:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/Kalman.py:264:54: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/Kalman.py:267:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/Kalman.py:268:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/Kalman.py:269:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/Kalman.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/Kalman.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/Kalman.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/Kalman.py:7:0: C0411: third party import "pykalman.KalmanFilter" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/Kalman.py:8:0: C0411: third party import "statsmodels.regression.linear_model.OLS" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/Kalman.py:9:0: C0411: third party import "statsmodels.tsa.stattools.adfuller" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:1:0: C0103: Module name "JM_J_strategy_Quantile" doesn't conform to snake_case naming style (invalid-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:63:4: W0621: Redefining name 'df0' from outer scope (line 113) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:64:4: W0621: Redefining name 'df1' from outer scope (line 114) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:112:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:130:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:130:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:130:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:142:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:145:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:152:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:152:24: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:164:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:171:12: E1101: Instance of 'tuple' has no 'upper' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:172:12: E1101: Instance of 'tuple' has no 'lower' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:173:12: E1101: Instance of 'tuple' has no 'mid' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:175:12: E1101: Instance of 'tuple' has no 'upper' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:176:12: E1101: Instance of 'tuple' has no 'lower' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:177:12: E1101: Instance of 'tuple' has no 'mid' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:152:0: R0903: Too few public methods (1/2) (too-few-public-methods) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:180:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:180:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:180:36: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:192:24: E1121: Too many positional arguments for constructor call (too-many-function-args) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:192:24: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:192:24: E1123: Unexpected keyword argument 'upper_quantile' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:192:24: E1123: Unexpected keyword argument 'lower_quantile' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:192:24: E1123: Unexpected keyword argument 'subplot' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:211:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:211:4: R0912: Too many branches (14/12) (too-many-branches) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:370:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:376:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:379:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:387:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:390:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:248:8: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:310:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:249:8: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:311:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:401:0: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:401:0: R0914: Too many local variables (24/15) (too-many-locals) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:407:4: W0621: Redefining name 'output_file' from outer scope (line 112) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:408:4: W0621: Redefining name 'df0' from outer scope (line 113) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:409:4: W0621: Redefining name 'df1' from outer scope (line 114) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:416:4: W0621: Redefining name 'df_spread' from outer scope (line 121) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:421:4: W0621: Redefining name 'fromdate' from outer scope (line 125) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:422:4: W0621: Redefining name 'todate' from outer scope (line 126) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:425:4: W0621: Redefining name 'data0' from outer scope (line 142) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:432:4: W0621: Redefining name 'data1' from outer scope (line 145) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:439:4: W0621: Redefining name 'data2' from outer scope (line 148) (redefined-outer-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:425:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:432:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:442:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:464:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:465:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:465:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:467:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:468:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:473:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:474:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:476:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:478:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:479:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:401:0: R0915: Too many statements (57/50) (too-many-statements) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:6:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/classic_indicators/JM_J_strategy_Quantile.py:7:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_Quantile_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:58:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:58:24: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:70:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:77:12: E1101: Instance of 'tuple' has no 'upper' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:78:12: E1101: Instance of 'tuple' has no 'lower' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:79:12: E1101: Instance of 'tuple' has no 'mid' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:81:12: E1101: Instance of 'tuple' has no 'upper' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:82:12: E1101: Instance of 'tuple' has no 'lower' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:83:12: E1101: Instance of 'tuple' has no 'mid' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:58:0: R0903: Too few public methods (1/2) (too-few-public-methods) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:86:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:86:36: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:98:24: E1121: Too many positional arguments for constructor call (too-many-function-args) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:98:24: E1123: Unexpected keyword argument 'period' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:98:24: E1123: Unexpected keyword argument 'upper_quantile' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:98:24: E1123: Unexpected keyword argument 'lower_quantile' in constructor call (unexpected-keyword-arg) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:114:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:114:4: R0912: Too many branches (14/12) (too-many-branches) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:247:4: C0116: Missing function or method docstring (missing-function-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:253:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:256:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:264:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:267:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:126:8: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:188:12: W0201: Attribute 'size0' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:127:8: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:189:12: W0201: Attribute 'size1' defined outside __init__ (attribute-defined-outside-init) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:274:0: R0913: Too many arguments (7/5) (too-many-arguments) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:274:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:285:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:305:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:306:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:310:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:311:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:312:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:312:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:313:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:341:0: R0914: Too many local variables (24/15) (too-many-locals) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:368:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:375:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:432:15: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:472:0: C0115: Missing class docstring (missing-class-docstring) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:472:17: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:472:0: R0903: Too few public methods (0/2) (too-few-public-methods) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:4:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/classic_indicators/JM_J_strategy_Quantile_GridSearch.py:5:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.atr_strategy +arbitrage/classic_indicators/atr_strategy.py:10:0: E0401: Unable to import 'backtrader.feeds' (import-error) +arbitrage/classic_indicators/atr_strategy.py:10:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:11:0: E0401: Unable to import 'backtrader.indicators.atr' (import-error) +arbitrage/classic_indicators/atr_strategy.py:11:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:12:0: E0401: Unable to import 'backtrader.indicators.sma' (import-error) +arbitrage/classic_indicators/atr_strategy.py:12:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:13:0: E0401: Unable to import 'backtrader.analyzers.sharpe' (import-error) +arbitrage/classic_indicators/atr_strategy.py:13:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:14:0: E0401: Unable to import 'backtrader.analyzers.drawdown' (import-error) +arbitrage/classic_indicators/atr_strategy.py:14:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:15:0: E0401: Unable to import 'backtrader.analyzers.returns' (import-error) +arbitrage/classic_indicators/atr_strategy.py:15:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +arbitrage/classic_indicators/atr_strategy.py:18:27: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/atr_strategy.py:52:4: C0112: Empty method docstring (empty-docstring) +arbitrage/classic_indicators/atr_strategy.py:159:0: C0112: Empty function docstring (empty-docstring) +arbitrage/classic_indicators/atr_strategy.py:162:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/atr_strategy.py:197:10: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/atr_strategy.py:199:10: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/atr_strategy.py:8:0: C0411: standard import "datetime" should be placed before third party import "pandas" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.bollingband +arbitrage/classic_indicators/bollingband.py:105:0: C0301: Line too long (158/100) (line-too-long) +arbitrage/classic_indicators/bollingband.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/classic_indicators/bollingband.py:9:0: C0112: Empty class docstring (empty-docstring) +arbitrage/classic_indicators/bollingband.py:9:30: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/bollingband.py:22:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/classic_indicators/bollingband.py:35:4: C0112: Empty method docstring (empty-docstring) +arbitrage/classic_indicators/bollingband.py:76:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/bollingband.py:79:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/bollingband.py:88:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/bollingband.py:91:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/classic_indicators/bollingband.py:109:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/classic_indicators/bollingband.py:126:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/bollingband.py:133:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/bollingband.py:140:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/bollingband.py:149:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/bollingband.py:162:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/bollingband.py:163:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/bollingband.py:168:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/bollingband.py:174:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/bollingband.py:174:38: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/bollingband.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy +arbitrage/classic_indicators/hurst_bollinger_strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:7:0: E0401: Unable to import 'seaborn' (import-error) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:10:0: C0112: Empty class docstring (empty-docstring) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:10:29: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:26:25: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:33:21: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:39:4: C0112: Empty method docstring (empty-docstring) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:167:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:148:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:157:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:172:0: C0112: Empty function docstring (empty-docstring) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:172:0: R0914: Too many local variables (16/15) (too-many-locals) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:260:4: W0612: Unused variable 'fig' (unused-variable) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:303:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:331:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:332:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:337:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:338:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:5:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/classic_indicators/hurst_bollinger_strategy.py:7:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.classic_indicators.rsi_strategy +arbitrage/classic_indicators/rsi_strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/classic_indicators/rsi_strategy.py:7:0: C0112: Empty class docstring (empty-docstring) +arbitrage/classic_indicators/rsi_strategy.py:7:27: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:23:30: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:31:4: C0112: Empty method docstring (empty-docstring) +arbitrage/classic_indicators/rsi_strategy.py:159:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/classic_indicators/rsi_strategy.py:140:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:149:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:164:0: C0112: Empty function docstring (empty-docstring) +arbitrage/classic_indicators/rsi_strategy.py:167:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:197:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:198:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:199:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/classic_indicators/rsi_strategy.py:202:10: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/rsi_strategy.py:204:10: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/classic_indicators/rsi_strategy.py:4:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:1:0: C0103: Module name "JM_J_strategy" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:6:0: E0401: Unable to import 'seaborn' (import-error) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:11:0: C0112: Empty class docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:11:30: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:25:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:37:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:110:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:113:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:116:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:129:4: W0621: Redefining name 'cerebro' from outer scope (line 237) (redefined-outer-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:129:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:157:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:159:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:160:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:165:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:165:51: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:123:0: W0613: Unused argument 'kwargs' (unused-argument) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:5:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy.py:6:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:1:0: C0103: Module name "JM_J_strategy_sharpe" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:11:0: C0112: Empty class docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:11:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:11:25: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:49:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:49:4: R0912: Too many branches (16/12) (too-many-branches) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:49:4: R0915: Too many statements (61/50) (too-many-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:217:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:223:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:345:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:326:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:335:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:357:4: W0621: Redefining name 'cerebro' from outer scope (line 431) (redefined-outer-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:357:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:376:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:377:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:377:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:379:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:380:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:385:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:386:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:389:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:389:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:351:0: W0613: Unused argument 'kwargs' (unused-argument) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:426:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:7:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe.py:7:0: W0611: Unused seaborn imported as sns (unused-import) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:1:0: C0103: Module name "JM_J_strategy_sharpe_grid" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:11:0: C0112: Empty class docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:11:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:11:25: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:49:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:49:4: R0912: Too many branches (16/12) (too-many-branches) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:49:4: R0915: Too many statements (61/50) (too-many-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:257:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:238:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:247:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:263:0: C0112: Empty function docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:263:0: R0914: Too many local variables (23/15) (too-many-locals) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:337:19: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:299:26: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:320:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:321:30: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:375:8: W0632: Possible unbalanced tuple unpacking with sequence defined at line 2 of : left side has 2 labels, right side has 1 value (unbalanced-tuple-unpacking) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:378:25: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:263:0: R0915: Too many statements (51/50) (too-many-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:263:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:348:4: W0612: Unused variable 'ax' (unused-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_sharpe_grid.py:7:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:1:0: C0103: Module name "JM_J_strategy_skewness" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:10:0: C0112: Empty class docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:10:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:10:32: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:49:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:49:4: R0912: Too many branches (15/12) (too-many-branches) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:49:4: R0915: Too many statements (60/50) (too-many-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:214:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:220:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:352:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:333:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:342:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:364:4: W0621: Redefining name 'cerebro' from outer scope (line 438) (redefined-outer-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:364:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:383:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:384:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:384:57: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:386:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:387:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:392:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:393:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:396:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:396:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:358:0: W0613: Unused argument 'kwargs' (unused-argument) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:406:20: W0621: Redefining name 'results' from outer scope (line 441) (redefined-outer-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:433:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:1:0: C0103: Module name "JM_J_strategy_skewness_grid" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:11:0: C0112: Empty class docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:11:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:11:32: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:50:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:50:4: R0912: Too many branches (15/12) (too-many-branches) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:50:4: R0915: Too many statements (59/50) (too-many-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:214:4: C0112: Empty method docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:330:11: W0718: Catching too general exception Exception (broad-exception-caught) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:327:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:328:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:336:0: C0112: Empty function docstring (empty-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:336:0: R0914: Too many local variables (20/15) (too-many-locals) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:371:22: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:441:4: W0632: Possible unbalanced tuple unpacking with sequence defined at line 2 of : left side has 2 labels, right side has 1 value (unbalanced-tuple-unpacking) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:336:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:419:4: W0612: Unused variable 'ax' (unused-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:4:0: C0411: third party import "matplotlib.pyplot" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:5:0: C0411: third party import "numpy" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:6:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +arbitrage/different_arbitrage_indicators/JM_J_strategy_skewness_grid.py:7:0: C0411: third party import "seaborn" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_CUSUM_GridSearch +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:1:0: C0103: Module name "JM_J_strategy_CUSUM_GridSearch" doesn't conform to snake_case naming style (invalid-name) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:3:8: E0602: Undefined variable 'bt' (undefined-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:3:37: E0602: Undefined variable 'df0' (undefined-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:4:8: E0602: Undefined variable 'bt' (undefined-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:4:37: E0602: Undefined variable 'df1' (undefined-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:6:9: E0602: Undefined variable 'cerebro' (undefined-variable) +arbitrage/different_arbitrage_indicators/JM_J_strategy_CUSUM_GridSearch.py:1:0: W0611: Unused seaborn imported as sns (unused-import) +************* Module backtrader.arbitrage.industry_chain_arbitrage_logic.JD_strategy +arbitrage/industry_chain_arbitrage_logic/JD_strategy.py:1:0: C0103: Module name "JD_strategy" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.industry_chain_arbitrage_logic.JM_J_strategy +arbitrage/industry_chain_arbitrage_logic/JM_J_strategy.py:1:0: C0103: Module name "JM_J_strategy" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.industry_chain_arbitrage_logic.JM_J_strategy_trailing_stop +arbitrage/industry_chain_arbitrage_logic/JM_J_strategy_trailing_stop.py:1:0: C0103: Module name "JM_J_strategy_trailing_stop" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.industry_chain_arbitrage_logic.MA_PP_strategy +arbitrage/industry_chain_arbitrage_logic/MA_PP_strategy.py:1:0: C0103: Module name "MA_PP_strategy" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.arbitrage.test.hold_rb +arbitrage/test/hold_rb.py:39:0: C0301: Line too long (110/100) (line-too-long) +arbitrage/test/hold_rb.py:1:0: C0114: Missing module docstring (missing-module-docstring) +arbitrage/test/hold_rb.py:10:0: C0112: Empty class docstring (empty-docstring) +arbitrage/test/hold_rb.py:10:27: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +arbitrage/test/hold_rb.py:20:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test/hold_rb.py:27:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test/hold_rb.py:41:4: C0112: Empty method docstring (empty-docstring) +arbitrage/test/hold_rb.py:46:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test/hold_rb.py:49:27: W0621: Redefining name 'trade' from outer scope (line 136) (redefined-outer-name) +arbitrage/test/hold_rb.py:57:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test/hold_rb.py:58:19: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/test/hold_rb.py:63:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +arbitrage/test/hold_rb.py:63:49: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/test/hold_rb.py:80:37: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/test/hold_rb.py:82:24: E1101: Module 'backtrader' has no 'num2date' member (no-member) +arbitrage/test/hold_rb.py:24:8: W0201: Attribute 'cash_start' defined outside __init__ (attribute-defined-outside-init) +arbitrage/test/hold_rb.py:44:8: W0201: Attribute 'roi' defined outside __init__ (attribute-defined-outside-init) +arbitrage/test/hold_rb.py:87:0: C0103: Constant name "output_file" doesn't conform to UPPER_CASE naming style (invalid-name) +arbitrage/test/hold_rb.py:97:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +arbitrage/test/hold_rb.py:100:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +arbitrage/test/hold_rb.py:112:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/test/hold_rb.py:113:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/test/hold_rb.py:117:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/test/hold_rb.py:118:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/test/hold_rb.py:119:20: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/test/hold_rb.py:125:4: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +arbitrage/test/hold_rb.py:125:38: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +arbitrage/test/hold_rb.py:2:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.backtest.feeds.datafeeds +backtest/feeds/datafeeds.py:5:0: E0401: Unable to import 'backtrader.feeds' (import-error) +backtest/feeds/datafeeds.py:5:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +backtest/feeds/datafeeds.py:8:0: C0112: Empty class docstring (empty-docstring) +backtest/feeds/datafeeds.py:8:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.backtest.tool.akshare-download +backtest/tool/akshare-download/__init__.py:1:0: C0103: Module name "akshare-download" doesn't conform to snake_case naming style (invalid-name) +************* Module backtrader.backtest.tool.akshare-download.fund +backtest/tool/akshare-download/fund.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtest/tool/akshare-download/fund.py:3:0: E0401: Unable to import 'akshare' (import-error) +backtest/tool/akshare-download/fund.py:120:4: C0415: Import outside toplevel (csv) (import-outside-toplevel) +backtest/tool/akshare-download/fund.py:124:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +backtest/tool/akshare-download/fund.py:142:4: E0401: Unable to import 'progress.bar' (import-error) +backtest/tool/akshare-download/fund.py:142:4: C0415: Import outside toplevel (progress.bar.IncrementalBar) (import-outside-toplevel) +backtest/tool/akshare-download/fund.py:146:4: C0104: Disallowed name "bar" (disallowed-name) +************* Module backtrader.backtest.tool.akshare-download.stock +backtest/tool/akshare-download/stock.py:1:0: C0114: Missing module docstring (missing-module-docstring) +backtest/tool/akshare-download/stock.py:211:4: W0622: Redefining built-in 'type' (redefined-builtin) +backtest/tool/akshare-download/stock.py:6:0: E0401: Unable to import 'akshare' (import-error) +backtest/tool/akshare-download/stock.py:8:0: E0401: Unable to import 'progress.bar' (import-error) +backtest/tool/akshare-download/stock.py:18:19: W0621: Redefining name 'type' from outer scope (line 211) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:28:9: W0123: Use of eval (eval-used) +backtest/tool/akshare-download/stock.py:55:4: W0621: Redefining name 'type' from outer scope (line 211) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:57:4: W0621: Redefining name 'start_date' from outer scope (line 212) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:80:4: W0622: Redefining built-in 'dir' (redefined-builtin) +backtest/tool/akshare-download/stock.py:95:21: W0123: Use of eval (eval-used) +backtest/tool/akshare-download/stock.py:126:21: W0123: Use of eval (eval-used) +backtest/tool/akshare-download/stock.py:59:4: W0613: Unused argument 'period' (unused-argument) +backtest/tool/akshare-download/stock.py:163:4: W0621: Redefining name 'stock_list' from outer scope (line 221) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:160:4: C0415: Import outside toplevel (csv) (import-outside-toplevel) +backtest/tool/akshare-download/stock.py:175:4: W0621: Redefining name 'stock_list' from outer scope (line 221) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:176:4: W0621: Redefining name 'type' from outer scope (line 211) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:177:4: W0621: Redefining name 'start_date' from outer scope (line 212) (redefined-outer-name) +backtest/tool/akshare-download/stock.py:196:4: C0104: Disallowed name "bar" (disallowed-name) +backtest/tool/akshare-download/stock.py:202:15: W0718: Catching too general exception Exception (broad-exception-caught) +backtest/tool/akshare-download/stock.py:211:4: C0103: Constant name "type" doesn't conform to UPPER_CASE naming style (invalid-name) +backtest/tool/akshare-download/stock.py:212:4: C0103: Constant name "start_date" doesn't conform to UPPER_CASE naming style (invalid-name) +backtest/tool/akshare-download/stock.py:226:4: C0103: Constant name "n" doesn't conform to UPPER_CASE naming style (invalid-name) +backtest/tool/akshare-download/stock.py:219:11: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +************* Module backtrader.contrib.samples.pair-trading.pair-trading +contrib/samples/pair-trading/pair-trading.py:1:0: C0114: Missing module docstring (missing-module-docstring) +contrib/samples/pair-trading/pair-trading.py:1:0: C0103: Module name "pair-trading" doesn't conform to snake_case naming style (invalid-name) +contrib/samples/pair-trading/pair-trading.py:20:0: E0401: Unable to import 'backtrader.feeds' (import-error) +contrib/samples/pair-trading/pair-trading.py:20:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +contrib/samples/pair-trading/pair-trading.py:21:0: E0401: Unable to import 'backtrader.indicators' (import-error) +contrib/samples/pair-trading/pair-trading.py:21:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +contrib/samples/pair-trading/pair-trading.py:24:0: C0112: Empty class docstring (empty-docstring) +contrib/samples/pair-trading/pair-trading.py:24:0: R0902: Too many instance attributes (11/7) (too-many-instance-attributes) +contrib/samples/pair-trading/pair-trading.py:24:26: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +contrib/samples/pair-trading/pair-trading.py:27:13: R1735: Consider using '{"period": 10, "stake": 10, "qty1": 0, "qty2": 0, "printout": True, ... }' instead of a call to 'dict'. (use-dict-literal) +contrib/samples/pair-trading/pair-trading.py:50:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +contrib/samples/pair-trading/pair-trading.py:51:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:59:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +contrib/samples/pair-trading/pair-trading.py:59:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +contrib/samples/pair-trading/pair-trading.py:64:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:67:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:71:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:72:12: W0107: Unnecessary pass statement (unnecessary-pass) +contrib/samples/pair-trading/pair-trading.py:101:4: C0112: Empty method docstring (empty-docstring) +contrib/samples/pair-trading/pair-trading.py:133:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:140:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:167:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:174:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:188:8: W0105: String statement has no effect (pointless-string-statement) +contrib/samples/pair-trading/pair-trading.py:196:4: C0112: Empty method docstring (empty-docstring) +contrib/samples/pair-trading/pair-trading.py:199:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:200:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/samples/pair-trading/pair-trading.py:204:0: C0112: Empty function docstring (empty-docstring) +contrib/samples/pair-trading/pair-trading.py:209:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +contrib/samples/pair-trading/pair-trading.py:252:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.contrib.utils.influxdb-import +contrib/utils/influxdb-import.py:1:0: C0114: Missing module docstring (missing-module-docstring) +contrib/utils/influxdb-import.py:1:0: C0103: Module name "influxdb-import" doesn't conform to snake_case naming style (invalid-name) +contrib/utils/influxdb-import.py:11:0: E0401: Unable to import 'influxdb' (import-error) +contrib/utils/influxdb-import.py:12:0: E0401: Unable to import 'influxdb.exceptions' (import-error) +contrib/utils/influxdb-import.py:15:0: C0112: Empty class docstring (empty-docstring) +contrib/utils/influxdb-import.py:15:0: R0205: Class 'InfluxDBTool' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +contrib/utils/influxdb-import.py:15:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +contrib/utils/influxdb-import.py:20:34: E0606: Possibly using variable 'args' before assignment (possibly-used-before-assignment) +contrib/utils/influxdb-import.py:36:37: W0621: Redefining name 'ticker' from outer scope (line 183) (redefined-outer-name) +contrib/utils/influxdb-import.py:43:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/influxdb-import.py:46:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy) +contrib/utils/influxdb-import.py:46:12: W4902: Using deprecated method warn() (deprecated-method) +contrib/utils/influxdb-import.py:46:12: W4902: Using deprecated method warn() (deprecated-method) +contrib/utils/influxdb-import.py:46:12: E0606: Possibly using variable 'log' before assignment (possibly-used-before-assignment) +contrib/utils/influxdb-import.py:46:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/influxdb-import.py:60:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy) +contrib/utils/influxdb-import.py:60:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/influxdb-import.py:71:8: W0621: Redefining name 'tickers' from outer scope (line 177) (redefined-outer-name) +contrib/utils/influxdb-import.py:73:16: W0621: Redefining name 'ticker' from outer scope (line 183) (redefined-outer-name) +contrib/utils/influxdb-import.py:72:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +************* Module backtrader.contrib.utils.iqfeed-to-influxdb +contrib/utils/iqfeed-to-influxdb.py:1:0: C0114: Missing module docstring (missing-module-docstring) +contrib/utils/iqfeed-to-influxdb.py:1:0: C0103: Module name "iqfeed-to-influxdb" doesn't conform to snake_case naming style (invalid-name) +contrib/utils/iqfeed-to-influxdb.py:14:0: E0401: Unable to import 'influxdb' (import-error) +contrib/utils/iqfeed-to-influxdb.py:15:0: E0401: Unable to import 'influxdb.exceptions' (import-error) +contrib/utils/iqfeed-to-influxdb.py:18:0: C0112: Empty class docstring (empty-docstring) +contrib/utils/iqfeed-to-influxdb.py:18:0: R0205: Class 'IQFeedTool' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +contrib/utils/iqfeed-to-influxdb.py:18:0: R0902: Too many instance attributes (15/7) (too-many-instance-attributes) +contrib/utils/iqfeed-to-influxdb.py:24:38: E0606: Possibly using variable 'args' before assignment (possibly-used-before-assignment) +contrib/utils/iqfeed-to-influxdb.py:56:12: E0606: Possibly using variable 'log' before assignment (possibly-used-before-assignment) +contrib/utils/iqfeed-to-influxdb.py:95:16: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +contrib/utils/iqfeed-to-influxdb.py:96:20: W4902: Using deprecated method warn() (deprecated-method) +contrib/utils/iqfeed-to-influxdb.py:96:20: W4902: Using deprecated method warn() (deprecated-method) +contrib/utils/iqfeed-to-influxdb.py:99:20: W0719: Raising too general exception: Exception (broad-exception-raised) +contrib/utils/iqfeed-to-influxdb.py:76:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +contrib/utils/iqfeed-to-influxdb.py:110:41: W0621: Redefining name 'ticker' from outer scope (line 301) (redefined-outer-name) +contrib/utils/iqfeed-to-influxdb.py:127:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/iqfeed-to-influxdb.py:128:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/iqfeed-to-influxdb.py:129:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/iqfeed-to-influxdb.py:133:19: W0718: Catching too general exception Exception (broad-exception-caught) +contrib/utils/iqfeed-to-influxdb.py:131:23: E0606: Possibly using variable 'iq' before assignment (possibly-used-before-assignment) +contrib/utils/iqfeed-to-influxdb.py:139:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy) +contrib/utils/iqfeed-to-influxdb.py:139:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +contrib/utils/iqfeed-to-influxdb.py:179:8: W0621: Redefining name 'tickers' from outer scope (line 295) (redefined-outer-name) +contrib/utils/iqfeed-to-influxdb.py:181:16: W0621: Redefining name 'ticker' from outer scope (line 301) (redefined-outer-name) +contrib/utils/iqfeed-to-influxdb.py:180:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +contrib/utils/iqfeed-to-influxdb.py:307:15: W0718: Catching too general exception Exception (broad-exception-caught) +************* Module backtrader.samples.analyzer-annualreturn.analyzer-annualreturn +samples/analyzer-annualreturn/analyzer-annualreturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/analyzer-annualreturn/analyzer-annualreturn.py:1:0: C0103: Module name "analyzer-annualreturn" doesn't conform to snake_case naming style (invalid-name) +samples/analyzer-annualreturn/analyzer-annualreturn.py:35:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/analyzer-annualreturn/analyzer-annualreturn.py:35:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/analyzer-annualreturn/analyzer-annualreturn.py:36:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/analyzer-annualreturn/analyzer-annualreturn.py:36:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/analyzer-annualreturn/analyzer-annualreturn.py:37:0: E0401: Unable to import 'backtrader.analyzers' (import-error) +samples/analyzer-annualreturn/analyzer-annualreturn.py:37:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +samples/analyzer-annualreturn/analyzer-annualreturn.py:46:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:55:13: R1735: Consider using '{"period": 15, "stake": 1, "printout": False, "onlylong": False, "csvcross": False, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/analyzer-annualreturn/analyzer-annualreturn.py:63:4: C0112: Empty method docstring (empty-docstring) +samples/analyzer-annualreturn/analyzer-annualreturn.py:66:4: C0112: Empty method docstring (empty-docstring) +samples/analyzer-annualreturn/analyzer-annualreturn.py:78:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:79:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:92:4: C0112: Empty method docstring (empty-docstring) +samples/analyzer-annualreturn/analyzer-annualreturn.py:99:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:102:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:107:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:111:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:120:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:120:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:125:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:128:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:132:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:133:12: W0107: Unnecessary pass statement (unnecessary-pass) +samples/analyzer-annualreturn/analyzer-annualreturn.py:145:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:148:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/analyzer-annualreturn/analyzer-annualreturn.py:151:0: C0112: Empty function docstring (empty-docstring) +samples/analyzer-annualreturn/analyzer-annualreturn.py:156:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:187:14: R1735: Consider using '{"days": bt.TimeFrame.Days, "weeks": bt.TimeFrame.Weeks, "months": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/analyzer-annualreturn/analyzer-annualreturn.py:188:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:189:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:190:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:191:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:205:22: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/analyzer-annualreturn/analyzer-annualreturn.py:215:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.gold-vs-sp500.gold-vs-sp500 +samples/gold-vs-sp500/gold-vs-sp500.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/gold-vs-sp500/gold-vs-sp500.py:1:0: C0103: Module name "gold-vs-sp500" doesn't conform to snake_case naming style (invalid-name) +samples/gold-vs-sp500/gold-vs-sp500.py:38:0: C0112: Empty class docstring (empty-docstring) +samples/gold-vs-sp500/gold-vs-sp500.py:38:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:46:4: C0112: Empty method docstring (empty-docstring) +samples/gold-vs-sp500/gold-vs-sp500.py:53:8: E1101: Instance of 'tuple' has no 'correlation' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:48:11: W0612: Unused variable 'p' (unused-variable) +samples/gold-vs-sp500/gold-vs-sp500.py:38:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/gold-vs-sp500/gold-vs-sp500.py:56:0: C0112: Empty class docstring (empty-docstring) +samples/gold-vs-sp500/gold-vs-sp500.py:56:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:60:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:56:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/gold-vs-sp500/gold-vs-sp500.py:80:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:83:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/gold-vs-sp500/gold-vs-sp500.py:93:8: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/gold-vs-sp500/gold-vs-sp500.py:93:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:95:8: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/gold-vs-sp500/gold-vs-sp500.py:95:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:100:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:104:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:108:13: W0123: Use of eval (eval-used) +samples/gold-vs-sp500/gold-vs-sp500.py:109:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:112:13: W0123: Use of eval (eval-used) +samples/gold-vs-sp500/gold-vs-sp500.py:113:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:116:7: W0125: Using a conditional statement with a constant value (using-constant-test) +samples/gold-vs-sp500/gold-vs-sp500.py:117:17: W0123: Use of eval (eval-used) +samples/gold-vs-sp500/gold-vs-sp500.py:121:8: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:121:44: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/gold-vs-sp500/gold-vs-sp500.py:125:19: W0123: Use of eval (eval-used) +samples/gold-vs-sp500/gold-vs-sp500.py:128:24: W0123: Use of eval (eval-used) +samples/gold-vs-sp500/gold-vs-sp500.py:32:0: C0411: third party import "scipy.stats" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.samples.sharpe-timereturn.sharpe-timereturn +samples/sharpe-timereturn/sharpe-timereturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/sharpe-timereturn/sharpe-timereturn.py:1:0: C0103: Module name "sharpe-timereturn" doesn't conform to snake_case naming style (invalid-name) +samples/sharpe-timereturn/sharpe-timereturn.py:45:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:55:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:62:24: E1101: Module 'backtrader.strategies' has no 'SMA_CrossOver' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:64:14: R1735: Consider using '{"days": bt.TimeFrame.Days, "weeks": bt.TimeFrame.Weeks, "months": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/sharpe-timereturn/sharpe-timereturn.py:65:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:66:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:67:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:68:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:72:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:74:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/sharpe-timereturn/sharpe-timereturn.py:91:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:95:22: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/sharpe-timereturn/sharpe-timereturn.py:101:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/sharpe-timereturn/sharpe-timereturn.py:103:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.yahoo-test.yahoo-test +samples/yahoo-test/yahoo-test.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/yahoo-test/yahoo-test.py:1:0: C0103: Module name "yahoo-test" doesn't conform to snake_case naming style (invalid-name) +samples/yahoo-test/yahoo-test.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/yahoo-test/yahoo-test.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/yahoo-test/yahoo-test.py:33:0: E0401: Unable to import 'yfinance' (import-error) +samples/yahoo-test/yahoo-test.py:36:0: C0112: Empty function docstring (empty-docstring) +samples/yahoo-test/yahoo-test.py:41:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/yahoo-test/yahoo-test.py:44:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/yahoo-test/yahoo-test.py:55:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/yahoo-test/yahoo-test.py:67:26: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/yahoo-test/yahoo-test.py:77:0: C0112: Empty function docstring (empty-docstring) +samples/yahoo-test/yahoo-test.py:33:0: C0411: third party import "yfinance" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.samples.bidask-to-ohlc.bidask-to-ohlc +samples/bidask-to-ohlc/bidask-to-ohlc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/bidask-to-ohlc/bidask-to-ohlc.py:1:0: C0103: Module name "bidask-to-ohlc" doesn't conform to snake_case naming style (invalid-name) +samples/bidask-to-ohlc/bidask-to-ohlc.py:30:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/bidask-to-ohlc/bidask-to-ohlc.py:30:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/bidask-to-ohlc/bidask-to-ohlc.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/bidask-to-ohlc/bidask-to-ohlc.py:35:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/bidask-to-ohlc/bidask-to-ohlc.py:38:4: C0112: Empty method docstring (empty-docstring) +samples/bidask-to-ohlc/bidask-to-ohlc.py:35:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/bidask-to-ohlc/bidask-to-ohlc.py:55:0: C0112: Empty function docstring (empty-docstring) +samples/bidask-to-ohlc/bidask-to-ohlc.py:59:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/bidask-to-ohlc/bidask-to-ohlc.py:73:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/bidask-to-ohlc/bidask-to-ohlc.py:77:24: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/bidask-to-ohlc/bidask-to-ohlc.py:87:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.bracket.bracket +samples/bracket/bracket.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/bracket/bracket.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/bracket/bracket.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/bracket/bracket.py:37:13: R1735: Consider using '{"ma": bt.ind.SMA, "p1": 5, "p2": 15, "limit": 0.005, "limdays": 3, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/bracket/bracket.py:38:11: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/bracket/bracket.py:56:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/bracket/bracket.py:66:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/bracket/bracket.py:81:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/bracket/bracket.py:83:21: R1734: Consider using [] instead of list() (use-list-literal) +samples/bracket/bracket.py:88:4: C0112: Empty method docstring (empty-docstring) +samples/bracket/bracket.py:109:33: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/bracket/bracket.py:116:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/bracket/bracket.py:122:33: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/bracket/bracket.py:130:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/bracket/bracket.py:136:33: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/bracket/bracket.py:144:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/bracket/bracket.py:156:33: R1735: Consider using '{"valid": valid2}' instead of a call to 'dict'. (use-dict-literal) +samples/bracket/bracket.py:158:34: R1735: Consider using '{"valid": valid3}' instead of a call to 'dict'. (use-dict-literal) +samples/bracket/bracket.py:73:12: W0201: Attribute 'holdstart' defined outside __init__ (attribute-defined-outside-init) +samples/bracket/bracket.py:176:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/bracket/bracket.py:179:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/bracket/bracket.py:189:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/bracket/bracket.py:193:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/bracket/bracket.py:193:45: W0123: Use of eval (eval-used) +samples/bracket/bracket.py:197:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/bracket/bracket.py:197:44: W0123: Use of eval (eval-used) +samples/bracket/bracket.py:200:30: W0123: Use of eval (eval-used) +samples/bracket/bracket.py:203:18: W0123: Use of eval (eval-used) +samples/bracket/bracket.py:206:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.btfd.btfd +samples/btfd/btfd.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/btfd/btfd.py:38:19: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/btfd/btfd.py:47:4: C0112: Empty method docstring (empty-docstring) +samples/btfd/btfd.py:49:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +samples/btfd/btfd.py:51:12: E1101: Instance of 'tuple' has no 'value_lever' member (no-member) +samples/btfd/btfd.py:51:40: W0212: Access to a protected member _valuelever of a client class (protected-access) +samples/btfd/btfd.py:54:12: E1101: Instance of 'tuple' has no 'asset' member (no-member) +samples/btfd/btfd.py:57:12: E1101: Instance of 'tuple' has no 'asset' member (no-member) +samples/btfd/btfd.py:57:43: E1101: Instance of 'tuple' has no 'asset' member (no-member) +samples/btfd/btfd.py:38:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/btfd/btfd.py:60:0: C0112: Empty class docstring (empty-docstring) +samples/btfd/btfd.py:60:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/btfd/btfd.py:84:4: C0112: Empty method docstring (empty-docstring) +samples/btfd/btfd.py:121:4: C0112: Empty method docstring (empty-docstring) +samples/btfd/btfd.py:87:28: E0203: Access to member 'barexit' before its definition line 105 (access-member-before-definition) +samples/btfd/btfd.py:105:16: W0201: Attribute 'barexit' defined outside __init__ (attribute-defined-outside-init) +samples/btfd/btfd.py:209:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/btfd/btfd.py:212:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/btfd/btfd.py:220:8: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/btfd/btfd.py:220:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/btfd/btfd.py:222:8: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/btfd/btfd.py:222:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/btfd/btfd.py:229:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/btfd/btfd.py:229:45: W0123: Use of eval (eval-used) +samples/btfd/btfd.py:232:35: W0123: Use of eval (eval-used) +samples/btfd/btfd.py:235:30: W0123: Use of eval (eval-used) +samples/btfd/btfd.py:238:40: W0123: Use of eval (eval-used) +samples/btfd/btfd.py:241:18: W0123: Use of eval (eval-used) +samples/btfd/btfd.py:244:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.calendar-days.calendar-days +samples/calendar-days/calendar-days.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/calendar-days/calendar-days.py:1:0: C0103: Module name "calendar-days" doesn't conform to snake_case naming style (invalid-name) +samples/calendar-days/calendar-days.py:32:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/calendar-days/calendar-days.py:32:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/calendar-days/calendar-days.py:33:0: E0401: Unable to import 'backtrader.filters' (import-error) +samples/calendar-days/calendar-days.py:33:0: E0611: No name 'filters' in module 'backtrader' (no-name-in-module) +samples/calendar-days/calendar-days.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/calendar-days/calendar-days.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/calendar-days/calendar-days.py:37:0: C0112: Empty function docstring (empty-docstring) +samples/calendar-days/calendar-days.py:42:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/calendar-days/calendar-days.py:45:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/calendar-days/calendar-days.py:72:26: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/calendar-days/calendar-days.py:82:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.calmar.calmar-test +samples/calmar/calmar-test.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/calmar/calmar-test.py:1:0: C0103: Module name "calmar-test" doesn't conform to snake_case naming style (invalid-name) +samples/calmar/calmar-test.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/calmar/calmar-test.py:34:9: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/calmar/calmar-test.py:44:12: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/calmar/calmar-test.py:44:35: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/calmar/calmar-test.py:45:24: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/calmar/calmar-test.py:45:47: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/calmar/calmar-test.py:47:4: C0112: Empty method docstring (empty-docstring) +samples/calmar/calmar-test.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/calmar/calmar-test.py:59:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/calmar/calmar-test.py:62:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/calmar/calmar-test.py:72:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/calmar/calmar-test.py:76:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/calmar/calmar-test.py:76:45: W0123: Use of eval (eval-used) +samples/calmar/calmar-test.py:78:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/calmar/calmar-test.py:80:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/calmar/calmar-test.py:80:44: W0123: Use of eval (eval-used) +samples/calmar/calmar-test.py:83:30: W0123: Use of eval (eval-used) +samples/calmar/calmar-test.py:86:24: W0123: Use of eval (eval-used) +samples/calmar/calmar-test.py:93:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.cheat-on-open.cheat-on-open +samples/cheat-on-open/cheat-on-open.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/cheat-on-open/cheat-on-open.py:1:0: C0103: Module name "cheat-on-open" doesn't conform to snake_case naming style (invalid-name) +samples/cheat-on-open/cheat-on-open.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/cheat-on-open/cheat-on-open.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/cheat-on-open/cheat-on-open.py:37:13: R1735: Consider using '{"periods": [10, 30], "matype": bt.ind.SMA}' instead of a call to 'dict'. (use-dict-literal) +samples/cheat-on-open/cheat-on-open.py:39:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/cheat-on-open/cheat-on-open.py:46:22: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/cheat-on-open/cheat-on-open.py:60:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/cheat-on-open/cheat-on-open.py:61:16: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/cheat-on-open/cheat-on-open.py:80:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/cheat-on-open/cheat-on-open.py:86:4: C0112: Empty method docstring (empty-docstring) +samples/cheat-on-open/cheat-on-open.py:89:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/cheat-on-open/cheat-on-open.py:98:4: C0112: Empty method docstring (empty-docstring) +samples/cheat-on-open/cheat-on-open.py:113:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/cheat-on-open/cheat-on-open.py:116:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/cheat-on-open/cheat-on-open.py:126:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/cheat-on-open/cheat-on-open.py:130:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/cheat-on-open/cheat-on-open.py:130:45: W0123: Use of eval (eval-used) +samples/cheat-on-open/cheat-on-open.py:133:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/cheat-on-open/cheat-on-open.py:133:44: W0123: Use of eval (eval-used) +samples/cheat-on-open/cheat-on-open.py:136:30: W0123: Use of eval (eval-used) +samples/cheat-on-open/cheat-on-open.py:139:18: W0123: Use of eval (eval-used) +samples/cheat-on-open/cheat-on-open.py:142:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.commission-schemes.commission-schemes +samples/commission-schemes/commission-schemes.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/commission-schemes/commission-schemes.py:1:0: C0103: Module name "commission-schemes" doesn't conform to snake_case naming style (invalid-name) +samples/commission-schemes/commission-schemes.py:32:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/commission-schemes/commission-schemes.py:32:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/commission-schemes/commission-schemes.py:33:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/commission-schemes/commission-schemes.py:33:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/commission-schemes/commission-schemes.py:36:0: C0112: Empty class docstring (empty-docstring) +samples/commission-schemes/commission-schemes.py:36:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/commission-schemes/commission-schemes.py:52:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:69:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:78:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:93:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:101:4: C0112: Empty method docstring (empty-docstring) +samples/commission-schemes/commission-schemes.py:104:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:108:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/commission-schemes/commission-schemes.py:112:0: C0112: Empty function docstring (empty-docstring) +samples/commission-schemes/commission-schemes.py:117:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/commission-schemes/commission-schemes.py:137:16: R1735: Consider using '{"none": None, "perc": bt.CommInfoBase.COMM_PERC, "fixed": bt.CommInfoBase.COMM_FIXED, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/commission-schemes/commission-schemes.py:139:13: E1101: Module 'backtrader' has no 'CommInfoBase' member (no-member) +samples/commission-schemes/commission-schemes.py:140:14: E1101: Module 'backtrader' has no 'CommInfoBase' member (no-member) +samples/commission-schemes/commission-schemes.py:161:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.credit-interest.credit-interest +samples/credit-interest/credit-interest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/credit-interest/credit-interest.py:1:0: C0103: Module name "credit-interest" doesn't conform to snake_case naming style (invalid-name) +samples/credit-interest/credit-interest.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/credit-interest/credit-interest.py:35:19: E1101: Module 'backtrader' has no 'Signal' member (no-member) +samples/credit-interest/credit-interest.py:45:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/credit-interest/credit-interest.py:46:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/credit-interest/credit-interest.py:47:28: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/credit-interest/credit-interest.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/credit-interest/credit-interest.py:50:0: C0112: Empty class docstring (empty-docstring) +samples/credit-interest/credit-interest.py:50:13: E1101: Module 'backtrader' has no 'Signal' member (no-member) +samples/credit-interest/credit-interest.py:53:4: C0112: Empty method docstring (empty-docstring) +samples/credit-interest/credit-interest.py:50:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/credit-interest/credit-interest.py:58:0: C0112: Empty class docstring (empty-docstring) +samples/credit-interest/credit-interest.py:58:9: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/credit-interest/credit-interest.py:69:27: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/credit-interest/credit-interest.py:71:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/credit-interest/credit-interest.py:72:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/credit-interest/credit-interest.py:85:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/credit-interest/credit-interest.py:99:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/credit-interest/credit-interest.py:103:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/credit-interest/credit-interest.py:113:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/credit-interest/credit-interest.py:117:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/credit-interest/credit-interest.py:119:14: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/credit-interest/credit-interest.py:121:18: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/credit-interest/credit-interest.py:123:18: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/credit-interest/credit-interest.py:129:31: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/credit-interest/credit-interest.py:131:31: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/credit-interest/credit-interest.py:133:15: E1101: Module 'backtrader' has no 'CommissionInfo' member (no-member) +samples/credit-interest/credit-interest.py:145:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/credit-interest/credit-interest.py:147:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.data-bid-ask.bidask +samples/data-bid-ask/bidask.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-bid-ask/bidask.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-bid-ask/bidask.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-bid-ask/bidask.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/data-bid-ask/bidask.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/data-bid-ask/bidask.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/data-bid-ask/bidask.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/data-bid-ask/bidask.py:49:0: C0112: Empty class docstring (empty-docstring) +samples/data-bid-ask/bidask.py:49:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-bid-ask/bidask.py:59:4: C0112: Empty method docstring (empty-docstring) +samples/data-bid-ask/bidask.py:62:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-bid-ask/bidask.py:67:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-bid-ask/bidask.py:49:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/data-bid-ask/bidask.py:71:0: C0112: Empty function docstring (empty-docstring) +samples/data-bid-ask/bidask.py:116:0: C0112: Empty function docstring (empty-docstring) +samples/data-bid-ask/bidask.py:120:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +************* Module backtrader.samples.data-filler.data-filler +samples/data-filler/data-filler.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-filler/data-filler.py:1:0: C0103: Module name "data-filler" doesn't conform to snake_case naming style (invalid-name) +samples/data-filler/data-filler.py:34:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-filler/data-filler.py:34:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-filler/data-filler.py:35:0: E0401: Unable to import 'backtrader.filters' (import-error) +samples/data-filler/data-filler.py:35:0: E0611: No name 'filters' in module 'backtrader' (no-name-in-module) +samples/data-filler/data-filler.py:36:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +samples/data-filler/data-filler.py:36:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/data-filler/data-filler.py:37:0: E0401: Unable to import 'relativevolume' (import-error) +samples/data-filler/data-filler.py:40:0: C0112: Empty function docstring (empty-docstring) +samples/data-filler/data-filler.py:45:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-filler/data-filler.py:61:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-filler/data-filler.py:83:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-filler/data-filler.py:87:26: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/data-filler/data-filler.py:97:0: C0112: Empty function docstring (empty-docstring) +samples/data-filler/data-filler.py:37:0: C0411: third party import "relativevolume.RelativeVolume" should be placed before first party imports "backtrader", "backtrader.feeds", "backtrader.filters", "backtrader.utils.flushfile" (wrong-import-order) +samples/data-filler/data-filler.py:36:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.samples.data-filler.relativevolume +samples/data-filler/relativevolume.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-filler/relativevolume.py:31:0: C0112: Empty class docstring (empty-docstring) +samples/data-filler/relativevolume.py:31:21: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/data-filler/relativevolume.py:50:21: E1101: Module 'backtrader' has no 'DivByZero' member (no-member) +samples/data-filler/relativevolume.py:31:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.samples.data-multitimeframe.data-multitimeframe +samples/data-multitimeframe/data-multitimeframe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-multitimeframe/data-multitimeframe.py:1:0: C0103: Module name "data-multitimeframe" doesn't conform to snake_case naming style (invalid-name) +samples/data-multitimeframe/data-multitimeframe.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-multitimeframe/data-multitimeframe.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/data-multitimeframe/data-multitimeframe.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ReplayerDaily' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ReplayerMonthly' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ReplayerWeekly' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ResamplerDaily' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ResamplerMonthly' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:33:0: E0611: No name 'ResamplerWeekly' in module 'backtrader' (no-name-in-module) +samples/data-multitimeframe/data-multitimeframe.py:43:0: C0112: Empty class docstring (empty-docstring) +samples/data-multitimeframe/data-multitimeframe.py:43:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:54:8: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:58:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:60:4: C0112: Empty method docstring (empty-docstring) +samples/data-multitimeframe/data-multitimeframe.py:64:4: C0112: Empty method docstring (empty-docstring) +samples/data-multitimeframe/data-multitimeframe.py:70:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +samples/data-multitimeframe/data-multitimeframe.py:72:4: C0112: Empty method docstring (empty-docstring) +samples/data-multitimeframe/data-multitimeframe.py:76:14: R1734: Consider using [] instead of list() (use-list-literal) +samples/data-multitimeframe/data-multitimeframe.py:78:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:80:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:81:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:85:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:92:18: R1734: Consider using [] instead of list() (use-list-literal) +samples/data-multitimeframe/data-multitimeframe.py:94:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:96:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:97:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:101:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-multitimeframe/data-multitimeframe.py:108:0: C0112: Empty function docstring (empty-docstring) +samples/data-multitimeframe/data-multitimeframe.py:113:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:117:28: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:130:14: R1735: Consider using '{"daily": bt.TimeFrame.Days, "weekly": bt.TimeFrame.Weeks, "monthly": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/data-multitimeframe/data-multitimeframe.py:131:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:132:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:133:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:144:24: E1101: Module 'backtrader' has no 'DataReplayer' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:150:24: E1101: Module 'backtrader' has no 'DataResampler' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:157:20: E1101: Module 'backtrader' has no 'DataClone' member (no-member) +samples/data-multitimeframe/data-multitimeframe.py:108:0: R0912: Too many branches (15/12) (too-many-branches) +samples/data-multitimeframe/data-multitimeframe.py:192:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.data-pandas.data_ploars_optix +samples/data-pandas/data_ploars_optix.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-pandas/data_ploars_optix.py:38:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-pandas/data_ploars_optix.py:38:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-pandas/data_ploars_optix.py:42:0: C0112: Empty class docstring (empty-docstring) +samples/data-pandas/data_ploars_optix.py:52:7: W0125: Using a conditional statement with a constant value (using-constant-test) +samples/data-pandas/data_ploars_optix.py:42:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/data-pandas/data_ploars_optix.py:59:0: C0112: Empty class docstring (empty-docstring) +samples/data-pandas/data_ploars_optix.py:59:20: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-pandas/data_ploars_optix.py:62:4: C0112: Empty method docstring (empty-docstring) +samples/data-pandas/data_ploars_optix.py:65:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-pandas/data_ploars_optix.py:59:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/data-pandas/data_ploars_optix.py:75:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data_ploars_optix.py:80:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-pandas/data_ploars_optix.py:90:4: W0104: Statement seems to have no effect (pointless-statement) +samples/data-pandas/data_ploars_optix.py:117:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data_ploars_optix.py:39:0: C0411: third party import "polars" should be placed before first party imports "backtrader", "backtrader.feeds" (wrong-import-order) +************* Module backtrader.samples.data-pandas.data-pandas-optix +samples/data-pandas/data-pandas-optix.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-pandas/data-pandas-optix.py:1:0: C0103: Module name "data-pandas-optix" doesn't conform to snake_case naming style (invalid-name) +samples/data-pandas/data-pandas-optix.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-pandas/data-pandas-optix.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-pandas/data-pandas-optix.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/data-pandas/data-pandas-optix.py:45:7: W0125: Using a conditional statement with a constant value (using-constant-test) +samples/data-pandas/data-pandas-optix.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/data-pandas/data-pandas-optix.py:52:0: C0112: Empty class docstring (empty-docstring) +samples/data-pandas/data-pandas-optix.py:52:20: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-pandas/data-pandas-optix.py:55:4: C0112: Empty method docstring (empty-docstring) +samples/data-pandas/data-pandas-optix.py:58:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-pandas/data-pandas-optix.py:52:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/data-pandas/data-pandas-optix.py:68:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data-pandas-optix.py:73:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-pandas/data-pandas-optix.py:111:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data-pandas-optix.py:32:0: C0411: third party import "pandas" should be placed before first party imports "backtrader", "backtrader.feeds" (wrong-import-order) +************* Module backtrader.samples.data-pandas.data-pandas +samples/data-pandas/data-pandas.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-pandas/data-pandas.py:1:0: C0103: Module name "data-pandas" doesn't conform to snake_case naming style (invalid-name) +samples/data-pandas/data-pandas.py:34:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data-pandas.py:39:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-pandas/data-pandas.py:42:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-pandas/data-pandas.py:66:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/data-pandas/data-pandas.py:81:0: C0112: Empty function docstring (empty-docstring) +samples/data-pandas/data-pandas.py:31:0: C0411: third party import "pandas" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.samples.data-replay.data-replay +samples/data-replay/data-replay.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-replay/data-replay.py:1:0: C0103: Module name "data-replay" doesn't conform to snake_case naming style (invalid-name) +samples/data-replay/data-replay.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-replay/data-replay.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-replay/data-replay.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/data-replay/data-replay.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/data-replay/data-replay.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/data-replay/data-replay.py:35:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-replay/data-replay.py:47:4: C0112: Empty method docstring (empty-docstring) +samples/data-replay/data-replay.py:51:4: C0112: Empty method docstring (empty-docstring) +samples/data-replay/data-replay.py:54:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-replay/data-replay.py:56:4: C0112: Empty method docstring (empty-docstring) +samples/data-replay/data-replay.py:59:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/data-replay/data-replay.py:49:8: W0201: Attribute 'counter' defined outside __init__ (attribute-defined-outside-init) +samples/data-replay/data-replay.py:62:0: C0112: Empty function docstring (empty-docstring) +samples/data-replay/data-replay.py:67:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-replay/data-replay.py:79:14: R1735: Consider using '{"daily": bt.TimeFrame.Days, "weekly": bt.TimeFrame.Weeks, "monthly": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/data-replay/data-replay.py:80:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-replay/data-replay.py:81:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-replay/data-replay.py:82:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-replay/data-replay.py:88:15: E1101: Module 'backtrader' has no 'DataReplayer' member (no-member) +samples/data-replay/data-replay.py:106:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.data-resample.data-resample +samples/data-resample/data-resample.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/data-resample/data-resample.py:1:0: C0103: Module name "data-resample" doesn't conform to snake_case naming style (invalid-name) +samples/data-resample/data-resample.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/data-resample/data-resample.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/data-resample/data-resample.py:34:0: C0112: Empty function docstring (empty-docstring) +samples/data-resample/data-resample.py:39:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/data-resample/data-resample.py:42:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/data-resample/data-resample.py:49:14: R1735: Consider using '{"daily": bt.TimeFrame.Days, "weekly": bt.TimeFrame.Weeks, "monthly": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/data-resample/data-resample.py:50:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-resample/data-resample.py:51:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-resample/data-resample.py:52:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/data-resample/data-resample.py:58:15: E1101: Module 'backtrader' has no 'DataResampler' member (no-member) +samples/data-resample/data-resample.py:81:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.daysteps.daysteps +samples/daysteps/daysteps.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/daysteps/daysteps.py:33:0: C0112: Empty class docstring (empty-docstring) +samples/daysteps/daysteps.py:33:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/daysteps/daysteps.py:41:4: C0112: Empty method docstring (empty-docstring) +samples/daysteps/daysteps.py:44:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/daysteps/daysteps.py:59:4: C0112: Empty method docstring (empty-docstring) +samples/daysteps/daysteps.py:63:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/daysteps/daysteps.py:64:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:65:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:66:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:68:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:69:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:70:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:71:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:72:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:73:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/daysteps/daysteps.py:43:8: W0201: Attribute 'callcounter' defined outside __init__ (attribute-defined-outside-init) +samples/daysteps/daysteps.py:57:8: W0201: Attribute 'lcontrol' defined outside __init__ (attribute-defined-outside-init) +samples/daysteps/daysteps.py:79:8: W0201: Attribute 'lcontrol' defined outside __init__ (attribute-defined-outside-init) +samples/daysteps/daysteps.py:82:0: C0112: Empty function docstring (empty-docstring) +samples/daysteps/daysteps.py:86:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/daysteps/daysteps.py:87:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/daysteps/daysteps.py:89:19: E1101: Module 'backtrader' has no 'filters' member (no-member) +samples/daysteps/daysteps.py:94:4: W0212: Access to a protected member _doreplay of a client class (protected-access) +samples/daysteps/daysteps.py:95:19: W0123: Use of eval (eval-used) +samples/daysteps/daysteps.py:97:24: W0123: Use of eval (eval-used) +************* Module backtrader.samples.future-spot.future-spot +samples/future-spot/future-spot.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/future-spot/future-spot.py:1:0: C0103: Module name "future-spot" doesn't conform to snake_case naming style (invalid-name) +samples/future-spot/future-spot.py:35:0: W0613: Unused argument 'args' (unused-argument) +samples/future-spot/future-spot.py:35:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/future-spot/future-spot.py:48:0: C0112: Empty class docstring (empty-docstring) +samples/future-spot/future-spot.py:48:20: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/future-spot/future-spot.py:51:16: R1735: Consider using '{"buy": dict(marker='$⇧$', markersize=12.0), "sell": dict(marker='$⇩$', markersize=12.0), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/future-spot/future-spot.py:52:12: R1735: Consider using '{"marker": '$⇧$', "markersize": 12.0}' instead of a call to 'dict'. (use-dict-literal) +samples/future-spot/future-spot.py:53:13: R1735: Consider using '{"marker": '$⇩$', "markersize": 12.0}' instead of a call to 'dict'. (use-dict-literal) +samples/future-spot/future-spot.py:48:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/future-spot/future-spot.py:57:0: C0112: Empty class docstring (empty-docstring) +samples/future-spot/future-spot.py:57:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/future-spot/future-spot.py:62:8: E1101: Module 'backtrader' has no 'obs' member (no-member) +samples/future-spot/future-spot.py:65:4: C0112: Empty method docstring (empty-docstring) +samples/future-spot/future-spot.py:70:16: W0201: Attribute 'entered' defined outside __init__ (attribute-defined-outside-init) +samples/future-spot/future-spot.py:57:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/future-spot/future-spot.py:84:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/future-spot/future-spot.py:88:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/future-spot/future-spot.py:91:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/future-spot/future-spot.py:102:24: E1101: Module 'backtrader' has no 'obs' member (no-member) +samples/future-spot/future-spot.py:103:24: E1101: Module 'backtrader' has no 'obs' member (no-member) +************* Module backtrader.samples.ib-cash-bid-ask.ib-cash-bid-ask +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:1:0: C0103: Module name "ib-cash-bid-ask" doesn't conform to snake_case naming style (invalid-name) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:39:0: C0112: Empty class docstring (empty-docstring) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:39:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:42:4: C0112: Empty method docstring (empty-docstring) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:45:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:46:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:47:35: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:48:35: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:49:35: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:50:35: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:51:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:52:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:53:36: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:54:36: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:55:33: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:69:38: W0212: Access to a protected member _getstatusname of a client class (protected-access) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:71:12: W0212: Access to a protected member _laststatus of a client class (protected-access) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:72:16: W0212: Access to a protected member _laststatus of a client class (protected-access) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:60:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:86:4: C0112: Empty method docstring (empty-docstring) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:86:4: R1711: Useless return at end of function or method (useless-return) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:100:0: C0103: Constant name "ib_symbol" doesn't conform to UPPER_CASE naming style (invalid-name) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:101:0: C0103: Constant name "compression" doesn't conform to UPPER_CASE naming style (invalid-name) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:110:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:111:12: E1101: Module 'backtrader' has no 'stores' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:118:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:120:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:122:56: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:123:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ib-cash-bid-ask/ib-cash-bid-ask.py:104:8: W0613: Unused argument 'args' (unused-argument) +************* Module backtrader.samples.ibtest.ibtest +samples/ibtest/ibtest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/ibtest/ibtest.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/ibtest/ibtest.py:35:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/ibtest/ibtest.py:38:13: R1735: Consider using '{"smaperiod": 5, "trade": False, "stake": 10, "exectype": bt.Order.Market, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/ibtest/ibtest.py:42:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:59:23: R1734: Consider using [] instead of list() (use-list-literal) +samples/ibtest/ibtest.py:66:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/ibtest/ibtest.py:81:38: W0212: Access to a protected member _getstatusname of a client class (protected-access) +samples/ibtest/ibtest.py:72:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/ibtest/ibtest.py:86:0: W0613: Unused argument 'args' (unused-argument) +samples/ibtest/ibtest.py:86:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/ibtest/ibtest.py:119:4: C0112: Empty method docstring (empty-docstring) +samples/ibtest/ibtest.py:129:14: R1734: Consider using [] instead of list() (use-list-literal) +samples/ibtest/ibtest.py:131:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:133:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:134:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:135:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:136:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:137:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:138:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:139:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:140:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:141:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:145:18: R1734: Consider using [] instead of list() (use-list-literal) +samples/ibtest/ibtest.py:147:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:149:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:150:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:151:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:152:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:153:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:154:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:155:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:156:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:157:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:170:62: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:187:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:197:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:207:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:215:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:227:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:239:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:123:4: R0912: Too many branches (14/12) (too-many-branches) +samples/ibtest/ibtest.py:123:4: R0915: Too many statements (59/50) (too-many-statements) +samples/ibtest/ibtest.py:123:19: W0613: Unused argument 'frompre' (unused-argument) +samples/ibtest/ibtest.py:250:4: C0112: Empty method docstring (empty-docstring) +samples/ibtest/ibtest.py:254:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/ibtest/ibtest.py:271:8: W0201: Attribute 'done' defined outside __init__ (attribute-defined-outside-init) +samples/ibtest/ibtest.py:274:0: C0112: Empty function docstring (empty-docstring) +samples/ibtest/ibtest.py:274:0: R0914: Too many local variables (20/15) (too-many-locals) +samples/ibtest/ibtest.py:279:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/ibtest/ibtest.py:281:18: R1735: Consider using '{"host": args.host, "port": args.port, "clientId": args.clientId, "timeoffset": not args.no_timeoffset, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/ibtest/ibtest.py:293:18: E1101: Module 'backtrader' has no 'stores' member (no-member) +samples/ibtest/ibtest.py:299:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/ibtest/ibtest.py:303:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:306:10: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:311:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:324:4: C0103: Variable name "IBDataFactory" doesn't conform to snake_case naming style (invalid-name) +samples/ibtest/ibtest.py:324:58: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/ibtest/ibtest.py:326:17: R1735: Consider using '{"timeframe": datatf, "compression": datacomp, "historical": args.historical, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/ibtest/ibtest.py:354:15: R1735: Consider using '{"timeframe": timeframe, "compression": args.compression, "bar2edge": not args.no_bar2edge, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/ibtest/ibtest.py:390:8: E0602: Undefined variable 'TestStrategy' (undefined-variable) +samples/ibtest/ibtest.py:393:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:274:0: R0912: Too many branches (20/12) (too-many-branches) +samples/ibtest/ibtest.py:274:0: R0915: Too many statements (67/50) (too-many-statements) +samples/ibtest/ibtest.py:415:0: C0112: Empty function docstring (empty-docstring) +samples/ibtest/ibtest.py:634:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:635:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:653:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/ibtest/ibtest.py:720:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:721:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/ibtest/ibtest.py:415:0: R0915: Too many statements (53/50) (too-many-statements) +************* Module backtrader.samples.kselrsi.ksignal +samples/kselrsi/ksignal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/kselrsi/ksignal.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/kselrsi/ksignal.py:34:18: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/kselrsi/ksignal.py:37:13: R1735: Consider using '{"rsi_per": 14, "rsi_upper": 65.0, "rsi_lower": 35.0, "rsi_out": 50.0, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/kselrsi/ksignal.py:45:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +samples/kselrsi/ksignal.py:48:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/kselrsi/ksignal.py:57:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/kselrsi/ksignal.py:63:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/kselrsi/ksignal.py:65:14: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/kselrsi/ksignal.py:71:18: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/kselrsi/ksignal.py:72:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/kselrsi/ksignal.py:73:24: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT' member (no-member) +samples/kselrsi/ksignal.py:75:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/kselrsi/ksignal.py:76:24: E1101: Module 'backtrader' has no 'SIGNAL_SHORT' member (no-member) +samples/kselrsi/ksignal.py:77:24: E1101: Module 'backtrader' has no 'SIGNAL_SHORTEXIT' member (no-member) +samples/kselrsi/ksignal.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/kselrsi/ksignal.py:88:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/kselrsi/ksignal.py:91:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/kselrsi/ksignal.py:100:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/kselrsi/ksignal.py:101:40: W0123: Use of eval (eval-used) +samples/kselrsi/ksignal.py:102:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/kselrsi/ksignal.py:103:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/kselrsi/ksignal.py:104:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/kselrsi/ksignal.py:108:24: W0123: Use of eval (eval-used) +************* Module backtrader.samples.lineplotter.lineplotter +samples/lineplotter/lineplotter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/lineplotter/lineplotter.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/lineplotter/lineplotter.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/lineplotter/lineplotter.py:46:12: E1101: Module 'backtrader' has no 'LinePlotterIndicator' member (no-member) +samples/lineplotter/lineplotter.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/lineplotter/lineplotter.py:58:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/lineplotter/lineplotter.py:60:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/lineplotter/lineplotter.py:69:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/lineplotter/lineplotter.py:77:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/lineplotter/lineplotter.py:79:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.lrsi.lrsi-test +samples/lrsi/lrsi-test.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/lrsi/lrsi-test.py:1:0: C0103: Module name "lrsi-test" doesn't conform to snake_case naming style (invalid-name) +samples/lrsi/lrsi-test.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/lrsi/lrsi-test.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/lrsi/lrsi-test.py:42:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/lrsi/lrsi-test.py:43:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/lrsi/lrsi-test.py:44:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/lrsi/lrsi-test.py:46:4: C0112: Empty method docstring (empty-docstring) +samples/lrsi/lrsi-test.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/lrsi/lrsi-test.py:58:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/lrsi/lrsi-test.py:61:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/lrsi/lrsi-test.py:71:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/lrsi/lrsi-test.py:75:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/lrsi/lrsi-test.py:75:45: W0123: Use of eval (eval-used) +samples/lrsi/lrsi-test.py:78:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/lrsi/lrsi-test.py:78:44: W0123: Use of eval (eval-used) +samples/lrsi/lrsi-test.py:81:30: W0123: Use of eval (eval-used) +samples/lrsi/lrsi-test.py:84:18: W0123: Use of eval (eval-used) +samples/lrsi/lrsi-test.py:87:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.macd-settings.macd-settings +samples/macd-settings/macd-settings.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/macd-settings/macd-settings.py:1:0: C0103: Module name "macd-settings" doesn't conform to snake_case naming style (invalid-name) +samples/macd-settings/macd-settings.py:33:34: E1101: Module 'backtrader' has no '__version__' member (no-member) +samples/macd-settings/macd-settings.py:36:16: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +samples/macd-settings/macd-settings.py:41:47: W0613: Unused argument 'isbuy' (unused-argument) +samples/macd-settings/macd-settings.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/macd-settings/macd-settings.py:58:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/macd-settings/macd-settings.py:104:20: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/macd-settings/macd-settings.py:112:22: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/macd-settings/macd-settings.py:115:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/macd-settings/macd-settings.py:118:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/macd-settings/macd-settings.py:121:4: C0112: Empty method docstring (empty-docstring) +samples/macd-settings/macd-settings.py:125:4: C0112: Empty method docstring (empty-docstring) +samples/macd-settings/macd-settings.py:131:15: R1716: Simplify chained comparison between the operands (chained-comparison) +samples/macd-settings/macd-settings.py:100:12: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/macd-settings/macd-settings.py:123:8: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/macd-settings/macd-settings.py:132:16: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/macd-settings/macd-settings.py:134:16: W0201: Attribute 'pstop' defined outside __init__ (attribute-defined-outside-init) +samples/macd-settings/macd-settings.py:145:16: W0201: Attribute 'pstop' defined outside __init__ (attribute-defined-outside-init) +samples/macd-settings/macd-settings.py:163:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/macd-settings/macd-settings.py:165:15: E1101: Module 'backtrader' has no 'commissions' member (no-member) +samples/macd-settings/macd-settings.py:171:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/macd-settings/macd-settings.py:182:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/macd-settings/macd-settings.py:200:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/macd-settings/macd-settings.py:202:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/macd-settings/macd-settings.py:206:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/macd-settings/macd-settings.py:209:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/macd-settings/macd-settings.py:213:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/macd-settings/macd-settings.py:213:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/macd-settings/macd-settings.py:216:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/macd-settings/macd-settings.py:217:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/macd-settings/macd-settings.py:222:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/macd-settings/macd-settings.py:223:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/macd-settings/macd-settings.py:232:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/macd-settings/macd-settings.py:234:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.memory-savings.memory-savings +samples/memory-savings/memory-savings.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/memory-savings/memory-savings.py:1:0: C0103: Module name "memory-savings" doesn't conform to snake_case naming style (invalid-name) +samples/memory-savings/memory-savings.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/memory-savings/memory-savings.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/memory-savings/memory-savings.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/memory-savings/memory-savings.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/memory-savings/memory-savings.py:33:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +samples/memory-savings/memory-savings.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/memory-savings/memory-savings.py:36:0: C0112: Empty class docstring (empty-docstring) +samples/memory-savings/memory-savings.py:36:14: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/memory-savings/memory-savings.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/memory-savings/memory-savings.py:47:0: C0112: Empty class docstring (empty-docstring) +samples/memory-savings/memory-savings.py:47:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/memory-savings/memory-savings.py:64:4: C0112: Empty method docstring (empty-docstring) +samples/memory-savings/memory-savings.py:69:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/memory-savings/memory-savings.py:70:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/memory-savings/memory-savings.py:86:4: C0112: Empty method docstring (empty-docstring) +samples/memory-savings/memory-savings.py:88:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +samples/memory-savings/memory-savings.py:117:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/memory-savings/memory-savings.py:146:0: C0112: Empty function docstring (empty-docstring) +samples/memory-savings/memory-savings.py:150:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/memory-savings/memory-savings.py:160:0: C0112: Empty function docstring (empty-docstring) +samples/memory-savings/memory-savings.py:33:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.samples.mixing-timeframes.mixing-timeframes +samples/mixing-timeframes/mixing-timeframes.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/mixing-timeframes/mixing-timeframes.py:1:0: C0103: Module name "mixing-timeframes" doesn't conform to snake_case naming style (invalid-name) +samples/mixing-timeframes/mixing-timeframes.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/mixing-timeframes/mixing-timeframes.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/mixing-timeframes/mixing-timeframes.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/mixing-timeframes/mixing-timeframes.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/mixing-timeframes/mixing-timeframes.py:33:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +samples/mixing-timeframes/mixing-timeframes.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/mixing-timeframes/mixing-timeframes.py:36:0: C0112: Empty class docstring (empty-docstring) +samples/mixing-timeframes/mixing-timeframes.py:36:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/mixing-timeframes/mixing-timeframes.py:39:13: R1735: Consider using '{"multi": True}' instead of a call to 'dict'. (use-dict-literal) +samples/mixing-timeframes/mixing-timeframes.py:52:4: C0112: Empty method docstring (empty-docstring) +samples/mixing-timeframes/mixing-timeframes.py:56:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:57:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:58:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:60:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:61:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:62:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/mixing-timeframes/mixing-timeframes.py:36:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/mixing-timeframes/mixing-timeframes.py:69:0: C0112: Empty function docstring (empty-docstring) +samples/mixing-timeframes/mixing-timeframes.py:73:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/mixing-timeframes/mixing-timeframes.py:76:41: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/mixing-timeframes/mixing-timeframes.py:85:0: C0112: Empty function docstring (empty-docstring) +samples/mixing-timeframes/mixing-timeframes.py:33:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.samples.multi-copy.multi-copy +samples/multi-copy/multi-copy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multi-copy/multi-copy.py:1:0: C0103: Module name "multi-copy" doesn't conform to snake_case naming style (invalid-name) +samples/multi-copy/multi-copy.py:34:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/multi-copy/multi-copy.py:73:20: W0212: Access to a protected member _name of a client class (protected-access) +samples/multi-copy/multi-copy.py:87:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/multi-copy/multi-copy.py:88:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/multi-copy/multi-copy.py:89:22: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/multi-copy/multi-copy.py:91:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/multi-copy/multi-copy.py:99:23: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/multi-copy/multi-copy.py:101:4: C0112: Empty method docstring (empty-docstring) +samples/multi-copy/multi-copy.py:115:4: C0112: Empty method docstring (empty-docstring) +samples/multi-copy/multi-copy.py:66:16: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/multi-copy/multi-copy.py:103:8: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/multi-copy/multi-copy.py:169:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/multi-copy/multi-copy.py:172:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-copy/multi-copy.py:182:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/multi-copy/multi-copy.py:185:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-copy/multi-copy.py:187:18: W0123: Use of eval (eval-used) +samples/multi-copy/multi-copy.py:200:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-copy/multi-copy.py:202:18: W0123: Use of eval (eval-used) +samples/multi-copy/multi-copy.py:210:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-copy/multi-copy.py:212:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.multi-example.mult-values +samples/multi-example/mult-values.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multi-example/mult-values.py:1:0: C0103: Module name "mult-values" doesn't conform to snake_case naming style (invalid-name) +samples/multi-example/mult-values.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/multi-example/mult-values.py:34:16: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +samples/multi-example/mult-values.py:37:13: R1735: Consider using '{"stake": 1}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:48:47: W0212: Access to a protected member _id of a client class (protected-access) +samples/multi-example/mult-values.py:51:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:52:20: W0212: Access to a protected member _name of a client class (protected-access) +samples/multi-example/mult-values.py:39:25: W0613: Unused argument 'comminfo' (unused-argument) +samples/multi-example/mult-values.py:39:35: W0613: Unused argument 'cash' (unused-argument) +samples/multi-example/mult-values.py:48:12: W0612: Unused variable 'i' (unused-variable) +samples/multi-example/mult-values.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/multi-example/mult-values.py:59:0: C0112: Empty class docstring (empty-docstring) +samples/multi-example/mult-values.py:59:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/multi-example/mult-values.py:62:13: R1735: Consider using '{"enter": [1, 3, 4], "hold": [7, 10, 15], "usebracket": True, "rawbracket": True, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:81:39: W0212: Access to a protected member _name of a client class (protected-access) +samples/multi-example/mult-values.py:83:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:91:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:98:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:99:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:101:4: C0112: Empty method docstring (empty-docstring) +samples/multi-example/mult-values.py:104:43: W0212: Access to a protected member _name of a client class (protected-access) +samples/multi-example/mult-values.py:106:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:112:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:123:41: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multi-example/mult-values.py:131:41: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multi-example/mult-values.py:140:41: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multi-example/mult-values.py:155:38: R1735: Consider using '{"valid": valid}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:159:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:171:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:174:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multi-example/mult-values.py:185:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/multi-example/mult-values.py:188:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/multi-example/mult-values.py:198:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/multi-example/mult-values.py:201:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/multi-example/mult-values.py:205:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/multi-example/mult-values.py:210:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/multi-example/mult-values.py:210:45: W0123: Use of eval (eval-used) +samples/multi-example/mult-values.py:215:34: W0123: Use of eval (eval-used) +samples/multi-example/mult-values.py:218:30: W0123: Use of eval (eval-used) +samples/multi-example/mult-values.py:221:18: W0123: Use of eval (eval-used) +samples/multi-example/mult-values.py:224:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.multidata-strategy.multidata-strategy-unaligned +samples/multidata-strategy/multidata-strategy-unaligned.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multidata-strategy/multidata-strategy-unaligned.py:1:0: C0103: Module name "multidata-strategy-unaligned" doesn't conform to snake_case naming style (invalid-name) +samples/multidata-strategy/multidata-strategy-unaligned.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/multidata-strategy/multidata-strategy-unaligned.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/multidata-strategy/multidata-strategy-unaligned.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/multidata-strategy/multidata-strategy-unaligned.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/multidata-strategy/multidata-strategy-unaligned.py:37:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/multidata-strategy/multidata-strategy-unaligned.py:50:13: R1735: Consider using '{"period": 15, "stake": 10, "printout": True}' instead of a call to 'dict'. (use-dict-literal) +samples/multidata-strategy/multidata-strategy-unaligned.py:65:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/multidata-strategy/multidata-strategy-unaligned.py:66:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:74:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multidata-strategy/multidata-strategy-unaligned.py:74:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multidata-strategy/multidata-strategy-unaligned.py:79:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:82:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:86:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:87:12: W0107: Unnecessary pass statement (unnecessary-pass) +samples/multidata-strategy/multidata-strategy-unaligned.py:102:4: C0112: Empty method docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy-unaligned.py:118:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:123:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:126:4: C0112: Empty method docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy-unaligned.py:129:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:130:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy-unaligned.py:134:0: C0112: Empty function docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy-unaligned.py:139:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/multidata-strategy/multidata-strategy-unaligned.py:182:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.multidata-strategy.multidata-strategy +samples/multidata-strategy/multidata-strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multidata-strategy/multidata-strategy.py:1:0: C0103: Module name "multidata-strategy" doesn't conform to snake_case naming style (invalid-name) +samples/multidata-strategy/multidata-strategy.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/multidata-strategy/multidata-strategy.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/multidata-strategy/multidata-strategy.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/multidata-strategy/multidata-strategy.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/multidata-strategy/multidata-strategy.py:37:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/multidata-strategy/multidata-strategy.py:50:13: R1735: Consider using '{"period": 15, "stake": 10, "printout": True}' instead of a call to 'dict'. (use-dict-literal) +samples/multidata-strategy/multidata-strategy.py:65:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/multidata-strategy/multidata-strategy.py:66:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:74:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multidata-strategy/multidata-strategy.py:74:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multidata-strategy/multidata-strategy.py:79:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:82:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:86:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:87:12: W0107: Unnecessary pass statement (unnecessary-pass) +samples/multidata-strategy/multidata-strategy.py:102:4: C0112: Empty method docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy.py:118:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:124:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:128:4: C0112: Empty method docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy.py:131:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:132:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multidata-strategy/multidata-strategy.py:136:0: C0112: Empty function docstring (empty-docstring) +samples/multidata-strategy/multidata-strategy.py:141:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/multidata-strategy/multidata-strategy.py:184:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.multitrades.multitrades +samples/multitrades/multitrades.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multitrades/multitrades.py:34:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/multitrades/multitrades.py:34:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/multitrades/multitrades.py:35:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/multitrades/multitrades.py:35:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/multitrades/multitrades.py:36:0: E0401: Unable to import 'mtradeobserver' (import-error) +samples/multitrades/multitrades.py:39:25: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/multitrades/multitrades.py:48:13: R1735: Consider using '{"period": 15, "stake": 1, "printout": False, "onlylong": False, "mtrade": False, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/multitrades.py:65:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/multitrades/multitrades.py:66:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:84:4: C0112: Empty method docstring (empty-docstring) +samples/multitrades/multitrades.py:91:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:94:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:100:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:104:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:114:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multitrades/multitrades.py:114:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/multitrades/multitrades.py:119:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:122:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:126:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:127:12: W0107: Unnecessary pass statement (unnecessary-pass) +samples/multitrades/multitrades.py:139:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:142:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/multitrades/multitrades.py:92:35: E0203: Access to member 'curtradeid' before its definition line 95 (access-member-before-definition) +samples/multitrades/multitrades.py:95:12: W0201: Attribute 'curtradeid' defined outside __init__ (attribute-defined-outside-init) +samples/multitrades/multitrades.py:105:16: W0201: Attribute 'curtradeid' defined outside __init__ (attribute-defined-outside-init) +samples/multitrades/multitrades.py:145:0: C0112: Empty function docstring (empty-docstring) +samples/multitrades/multitrades.py:150:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/multitrades/multitrades.py:193:0: C0112: Empty function docstring (empty-docstring) +samples/multitrades/multitrades.py:36:0: C0411: third party import "mtradeobserver" should be placed before first party imports "backtrader", "backtrader.feeds", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.samples.multitrades.mtradeobserver +samples/multitrades/mtradeobserver.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/multitrades/mtradeobserver.py:31:0: C0112: Empty class docstring (empty-docstring) +samples/multitrades/mtradeobserver.py:31:21: E1101: Module 'backtrader' has no 'observer' member (no-member) +samples/multitrades/mtradeobserver.py:36:15: R1735: Consider using '{"plot": True, "subplot": True, "plotlinelabels": True}' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/mtradeobserver.py:38:16: R1735: Consider using '{"Id_0": dict(marker='*', markersize=8.0, color='lime', fillstyle='full'), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/mtradeobserver.py:39:13: R1735: Consider using '{"marker": '*', "markersize": 8.0, "color": 'lime', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/mtradeobserver.py:40:13: R1735: Consider using '{"marker": 'o', "markersize": 8.0, "color": 'red', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/mtradeobserver.py:41:13: R1735: Consider using '{"marker": 's', "markersize": 8.0, "color": 'blue', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +samples/multitrades/mtradeobserver.py:44:4: C0112: Empty method docstring (empty-docstring) +samples/multitrades/mtradeobserver.py:46:21: W0212: Access to a protected member _tradespending of a client class (protected-access) +samples/multitrades/mtradeobserver.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.samples.oandatest.oandatest +samples/oandatest/oandatest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/oandatest/oandatest.py:34:11: E1101: Module 'backtrader' has no 'stores' member (no-member) +samples/oandatest/oandatest.py:35:10: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/oandatest/oandatest.py:39:0: C0112: Empty class docstring (empty-docstring) +samples/oandatest/oandatest.py:39:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/oandatest/oandatest.py:42:13: R1735: Consider using '{"smaperiod": 5, "trade": False, "stake": 10, "exectype": bt.Order.Market, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/oandatest/oandatest.py:46:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:58:23: R1734: Consider using [] instead of list() (use-list-literal) +samples/oandatest/oandatest.py:65:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/oandatest/oandatest.py:80:38: W0212: Access to a protected member _getstatusname of a client class (protected-access) +samples/oandatest/oandatest.py:71:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/oandatest/oandatest.py:85:0: W0613: Unused argument 'args' (unused-argument) +samples/oandatest/oandatest.py:85:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/oandatest/oandatest.py:118:4: C0112: Empty method docstring (empty-docstring) +samples/oandatest/oandatest.py:128:14: R1734: Consider using [] instead of list() (use-list-literal) +samples/oandatest/oandatest.py:130:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:132:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:133:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:134:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:135:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:136:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:137:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:138:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:139:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:140:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:144:18: R1734: Consider using [] instead of list() (use-list-literal) +samples/oandatest/oandatest.py:146:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:148:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:149:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:150:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:151:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:152:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:153:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:154:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:155:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:156:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oandatest/oandatest.py:194:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:207:33: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:213:33: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:122:4: R0912: Too many branches (16/12) (too-many-branches) +samples/oandatest/oandatest.py:122:4: R0915: Too many statements (60/50) (too-many-statements) +samples/oandatest/oandatest.py:122:19: W0613: Unused argument 'frompre' (unused-argument) +samples/oandatest/oandatest.py:226:4: C0112: Empty method docstring (empty-docstring) +samples/oandatest/oandatest.py:244:8: W0201: Attribute 'done' defined outside __init__ (attribute-defined-outside-init) +samples/oandatest/oandatest.py:247:0: C0112: Empty function docstring (empty-docstring) +samples/oandatest/oandatest.py:247:0: R0914: Too many local variables (22/15) (too-many-locals) +samples/oandatest/oandatest.py:252:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/oandatest/oandatest.py:254:18: R1735: Consider using '{"token": args.token, "account": args.account, "practice": not args.live, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/oandatest/oandatest.py:261:21: E0602: Undefined variable 'BrokerCls' (undefined-variable) +samples/oandatest/oandatest.py:263:21: E0606: Possibly using variable 'store' before assignment (possibly-used-before-assignment) +samples/oandatest/oandatest.py:267:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:270:10: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:275:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:288:4: C0103: Variable name "DataFactory" doesn't conform to snake_case naming style (invalid-name) +samples/oandatest/oandatest.py:290:17: R1735: Consider using '{"timeframe": datatf, "compression": datacomp, "qcheck": args.qcheck, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/oandatest/oandatest.py:317:15: R1735: Consider using '{"timeframe": timeframe, "compression": args.compression, "bar2edge": not args.no_bar2edge, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/oandatest/oandatest.py:353:8: E0602: Undefined variable 'TestStrategy' (undefined-variable) +samples/oandatest/oandatest.py:356:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:370:22: R1735: Consider using '{"style": 'line'}' instead of a call to 'dict'. (use-dict-literal) +samples/oandatest/oandatest.py:372:27: W0123: Use of eval (eval-used) +samples/oandatest/oandatest.py:247:0: R0912: Too many branches (22/12) (too-many-branches) +samples/oandatest/oandatest.py:247:0: R0915: Too many statements (72/50) (too-many-statements) +samples/oandatest/oandatest.py:549:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:550:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:568:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/oandatest/oandatest.py:645:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oandatest/oandatest.py:646:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +************* Module backtrader.samples.observer-benchmark.observer-benchmark +samples/observer-benchmark/observer-benchmark.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/observer-benchmark/observer-benchmark.py:1:0: C0103: Module name "observer-benchmark" doesn't conform to snake_case naming style (invalid-name) +samples/observer-benchmark/observer-benchmark.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/observer-benchmark/observer-benchmark.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/observer-benchmark/observer-benchmark.py:45:14: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/observer-benchmark/observer-benchmark.py:46:25: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/observer-benchmark/observer-benchmark.py:48:4: C0112: Empty method docstring (empty-docstring) +samples/observer-benchmark/observer-benchmark.py:51:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/observer-benchmark/observer-benchmark.py:62:4: C0112: Empty method docstring (empty-docstring) +samples/observer-benchmark/observer-benchmark.py:66:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/observer-benchmark/observer-benchmark.py:67:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:69:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:70:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:71:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:72:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:73:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:74:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:80:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:80:49: E0602: Undefined variable 'size' (undefined-variable) +samples/observer-benchmark/observer-benchmark.py:87:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observer-benchmark/observer-benchmark.py:92:12: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/observer-benchmark/observer-benchmark.py:93:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/observer-benchmark/observer-benchmark.py:94:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/observer-benchmark/observer-benchmark.py:95:13: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/observer-benchmark/observer-benchmark.py:96:19: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/observer-benchmark/observer-benchmark.py:108:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/observer-benchmark/observer-benchmark.py:111:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/observer-benchmark/observer-benchmark.py:120:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/observer-benchmark/observer-benchmark.py:129:12: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/observer-benchmark/observer-benchmark.py:134:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/observer-benchmark/observer-benchmark.py:139:12: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/observer-benchmark/observer-benchmark.py:147:18: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/observer-benchmark/observer-benchmark.py:149:22: W0123: Use of eval (eval-used) +************* Module backtrader.samples.observers.observers-default +samples/observers/observers-default.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/observers/observers-default.py:1:0: C0103: Module name "observers-default" doesn't conform to snake_case naming style (invalid-name) +samples/observers/observers-default.py:31:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/observers/observers-default.py:32:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/observers/observers-default.py:34:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +************* Module backtrader.samples.observers.observers-orderobserver +samples/observers/observers-orderobserver.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/observers/observers-orderobserver.py:1:0: C0103: Module name "observers-orderobserver" doesn't conform to snake_case naming style (invalid-name) +samples/observers/observers-orderobserver.py:31:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/observers/observers-orderobserver.py:31:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/observers/observers-orderobserver.py:32:0: E0401: Unable to import 'orderobserver' (import-error) +samples/observers/observers-orderobserver.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/observers/observers-orderobserver.py:35:17: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/observers/observers-orderobserver.py:53:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/observers/observers-orderobserver.py:54:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-orderobserver.py:74:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-orderobserver.py:84:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-orderobserver.py:107:4: C0112: Empty method docstring (empty-docstring) +samples/observers/observers-orderobserver.py:116:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-orderobserver.py:122:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-orderobserver.py:123:30: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/observers/observers-orderobserver.py:126:0: C0112: Empty function docstring (empty-docstring) +samples/observers/observers-orderobserver.py:128:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/observers/observers-orderobserver.py:130:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/observers/observers-orderobserver.py:32:0: C0411: third party import "orderobserver.OrderObserver" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.samples.observers.orderobserver +samples/observers/orderobserver.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/observers/orderobserver.py:31:0: C0112: Empty class docstring (empty-docstring) +samples/observers/orderobserver.py:31:20: E1101: Module 'backtrader' has no 'observer' member (no-member) +samples/observers/orderobserver.py:39:15: R1735: Consider using '{"plot": True, "subplot": True, "plotlinelabels": True}' instead of a call to 'dict'. (use-dict-literal) +samples/observers/orderobserver.py:41:16: R1735: Consider using '{"created": dict(marker='*', markersize=8.0, color='lime', fillstyle='full'), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/observers/orderobserver.py:42:16: R1735: Consider using '{"marker": '*', "markersize": 8.0, "color": 'lime', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +samples/observers/orderobserver.py:43:16: R1735: Consider using '{"marker": 's', "markersize": 8.0, "color": 'red', "fillstyle": 'full', ... }' instead of a call to 'dict'. (use-dict-literal) +samples/observers/orderobserver.py:46:4: C0112: Empty method docstring (empty-docstring) +samples/observers/orderobserver.py:48:21: W0212: Access to a protected member _orderspending of a client class (protected-access) +samples/observers/orderobserver.py:59:32: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/observers/orderobserver.py:59:51: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/observers/orderobserver.py:60:16: E1101: Instance of 'tuple' has no 'created' member (no-member) +samples/observers/orderobserver.py:62:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/observers/orderobserver.py:63:16: E1101: Instance of 'tuple' has no 'expired' member (no-member) +samples/observers/orderobserver.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.samples.observers.observers-default-drawdown +samples/observers/observers-default-drawdown.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/observers/observers-default-drawdown.py:1:0: C0103: Module name "observers-default-drawdown" doesn't conform to snake_case naming style (invalid-name) +samples/observers/observers-default-drawdown.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/observers/observers-default-drawdown.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/observers/observers-default-drawdown.py:32:0: C0112: Empty class docstring (empty-docstring) +samples/observers/observers-default-drawdown.py:32:17: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/observers/observers-default-drawdown.py:46:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/observers/observers-default-drawdown.py:47:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-default-drawdown.py:61:4: C0112: Empty method docstring (empty-docstring) +samples/observers/observers-default-drawdown.py:64:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-default-drawdown.py:65:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-default-drawdown.py:70:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-default-drawdown.py:74:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/observers/observers-default-drawdown.py:78:0: C0112: Empty function docstring (empty-docstring) +samples/observers/observers-default-drawdown.py:80:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/observers/observers-default-drawdown.py:82:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/observers/observers-default-drawdown.py:85:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +samples/observers/observers-default-drawdown.py:86:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +************* Module backtrader.samples.oco.oco +samples/oco/oco.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/oco/oco.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/oco/oco.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/oco/oco.py:37:13: R1735: Consider using '{"ma": bt.ind.SMA, "p1": 5, "p2": 15, "limit": 0.005, "limdays": 3, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/oco/oco.py:38:11: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/oco/oco.py:58:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oco/oco.py:75:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/oco/oco.py:77:21: R1734: Consider using [] instead of list() (use-list-literal) +samples/oco/oco.py:87:4: C0112: Empty method docstring (empty-docstring) +samples/oco/oco.py:107:24: R1735: Consider using '{"exectype": bt.Order.Limit}' instead of a call to 'dict'. (use-dict-literal) +samples/oco/oco.py:107:38: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/oco/oco.py:112:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oco/oco.py:119:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oco/oco.py:130:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/oco/oco.py:67:12: W0201: Attribute 'holdstart' defined outside __init__ (attribute-defined-outside-init) +samples/oco/oco.py:148:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/oco/oco.py:151:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/oco/oco.py:161:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/oco/oco.py:165:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/oco/oco.py:165:45: W0123: Use of eval (eval-used) +samples/oco/oco.py:168:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/oco/oco.py:168:44: W0123: Use of eval (eval-used) +samples/oco/oco.py:171:30: W0123: Use of eval (eval-used) +samples/oco/oco.py:174:18: W0123: Use of eval (eval-used) +samples/oco/oco.py:177:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.optimization.optimization +samples/optimization/optimization.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/optimization/optimization.py:35:0: W0622: Redefining built-in 'range' (redefined-builtin) +samples/optimization/optimization.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/optimization/optimization.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/optimization/optimization.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/optimization/optimization.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/optimization/optimization.py:35:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +samples/optimization/optimization.py:35:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/optimization/optimization.py:38:0: C0112: Empty class docstring (empty-docstring) +samples/optimization/optimization.py:38:23: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/optimization/optimization.py:38:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/optimization/optimization.py:60:0: C0112: Empty function docstring (empty-docstring) +samples/optimization/optimization.py:65:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/optimization/optimization.py:95:13: E1101: Module 'time' has no 'clock' member (no-member) +samples/optimization/optimization.py:101:11: E1101: Module 'time' has no 'clock' member (no-member) +samples/optimization/optimization.py:108:18: W0212: Access to a protected member _getkwargs of a client class (protected-access) +samples/optimization/optimization.py:115:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.order-close.close-daily +samples/order-close/close-daily.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/order-close/close-daily.py:1:0: C0103: Module name "close-daily" doesn't conform to snake_case naming style (invalid-name) +samples/order-close/close-daily.py:32:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/order-close/close-daily.py:32:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/order-close/close-daily.py:33:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +samples/order-close/close-daily.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/order-close/close-daily.py:38:0: C0112: Empty class docstring (empty-docstring) +samples/order-close/close-daily.py:38:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/order-close/close-daily.py:53:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/order-close/close-daily.py:55:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-daily.py:57:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-daily.py:61:4: C0112: Empty method docstring (empty-docstring) +samples/order-close/close-daily.py:70:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-daily.py:71:49: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-close/close-daily.py:73:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-daily.py:74:47: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-close/close-daily.py:77:38: E1101: Module 'backtrader' has no 'metabase' member (no-member) +samples/order-close/close-daily.py:101:16: E1101: Module 'datetime' has no 'combine' member (no-member) +samples/order-close/close-daily.py:77:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/order-close/close-daily.py:106:0: C0112: Empty function docstring (empty-docstring) +samples/order-close/close-daily.py:110:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/order-close/close-daily.py:126:17: R1735: Consider using '{"bt": btfeeds.BacktraderCSVData, "visualchart": btfeeds.VChartCSVData, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/order-close/close-daily.py:134:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order-close/close-daily.py:144:29: E0602: Undefined variable 'todate' (undefined-variable) +samples/order-close/close-daily.py:162:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.order-close.close-minute +samples/order-close/close-minute.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/order-close/close-minute.py:1:0: C0103: Module name "close-minute" doesn't conform to snake_case naming style (invalid-name) +samples/order-close/close-minute.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/order-close/close-minute.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/order-close/close-minute.py:36:0: C0112: Empty class docstring (empty-docstring) +samples/order-close/close-minute.py:36:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/order-close/close-minute.py:53:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/order-close/close-minute.py:55:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-minute.py:58:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-minute.py:60:4: C0112: Empty method docstring (empty-docstring) +samples/order-close/close-minute.py:69:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-minute.py:70:32: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-close/close-minute.py:73:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-close/close-minute.py:74:43: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-close/close-minute.py:78:0: C0112: Empty function docstring (empty-docstring) +samples/order-close/close-minute.py:82:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/order-close/close-minute.py:98:17: R1735: Consider using '{"bt": btfeeds.BacktraderCSVData, "visualchart": btfeeds.VChartCSVData, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/order-close/close-minute.py:106:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order-close/close-minute.py:116:29: E0602: Undefined variable 'todate' (undefined-variable) +samples/order-close/close-minute.py:130:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.order-execution.order-execution +samples/order-execution/order-execution.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/order-execution/order-execution.py:1:0: C0103: Module name "order-execution" doesn't conform to snake_case naming style (invalid-name) +samples/order-execution/order-execution.py:32:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/order-execution/order-execution.py:32:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/order-execution/order-execution.py:33:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/order-execution/order-execution.py:33:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/order-execution/order-execution.py:36:0: C0112: Empty class docstring (empty-docstring) +samples/order-execution/order-execution.py:36:29: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/order-execution/order-execution.py:56:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/order-execution/order-execution.py:57:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:77:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:87:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:110:4: C0112: Empty method docstring (empty-docstring) +samples/order-execution/order-execution.py:120:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:133:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-execution/order-execution.py:135:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:138:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-execution/order-execution.py:140:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-execution/order-execution.py:145:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-execution/order-execution.py:157:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-execution/order-execution.py:172:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/order-execution/order-execution.py:110:4: R0912: Too many branches (17/12) (too-many-branches) +samples/order-execution/order-execution.py:189:0: C0112: Empty function docstring (empty-docstring) +samples/order-execution/order-execution.py:193:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/order-execution/order-execution.py:219:17: R1735: Consider using '{"bt": btfeeds.BacktraderCSVData, "visualchart": btfeeds.VChartCSVData, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/order-execution/order-execution.py:227:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order-execution/order-execution.py:237:29: E0602: Undefined variable 'todate' (undefined-variable) +samples/order-execution/order-execution.py:246:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.order-history.order-history +samples/order-history/order-history.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/order-history/order-history.py:1:0: C0103: Module name "order-history" doesn't conform to snake_case naming style (invalid-name) +samples/order-history/order-history.py:64:0: C0112: Empty class docstring (empty-docstring) +samples/order-history/order-history.py:64:15: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/order-history/order-history.py:67:13: R1735: Consider using '{"sma1": 10, "sma2": 20}' instead of a call to 'dict'. (use-dict-literal) +samples/order-history/order-history.py:94:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-history/order-history.py:99:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/order-history/order-history.py:99:33: E1101: Instance of 'dict' has no 'sma1' member (no-member) +samples/order-history/order-history.py:100:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/order-history/order-history.py:100:33: E1101: Instance of 'dict' has no 'sma2' member (no-member) +samples/order-history/order-history.py:101:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/order-history/order-history.py:102:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/order-history/order-history.py:105:0: C0112: Empty class docstring (empty-docstring) +samples/order-history/order-history.py:105:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/order-history/order-history.py:108:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order-history/order-history.py:135:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order-history/order-history.py:141:4: C0112: Empty method docstring (empty-docstring) +samples/order-history/order-history.py:153:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/order-history/order-history.py:156:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order-history/order-history.py:165:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/order-history/order-history.py:169:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/order-history/order-history.py:169:45: W0123: Use of eval (eval-used) +samples/order-history/order-history.py:172:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/order-history/order-history.py:172:44: W0123: Use of eval (eval-used) +samples/order-history/order-history.py:176:40: W0123: Use of eval (eval-used) +samples/order-history/order-history.py:178:34: W0123: Use of eval (eval-used) +samples/order-history/order-history.py:181:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/order-history/order-history.py:181:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/order-history/order-history.py:182:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/order-history/order-history.py:182:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/order-history/order-history.py:183:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/order-history/order-history.py:186:18: W0123: Use of eval (eval-used) +samples/order-history/order-history.py:189:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.order_target.order_target +samples/order_target/order_target.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/order_target/order_target.py:34:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/order_target/order_target.py:73:4: C0112: Empty method docstring (empty-docstring) +samples/order_target/order_target.py:77:4: C0112: Empty method docstring (empty-docstring) +samples/order_target/order_target.py:83:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:91:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:97:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:109:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:119:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:129:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/order_target/order_target.py:71:12: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/order_target/order_target.py:75:8: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/order_target/order_target.py:113:12: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/order_target/order_target.py:123:12: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/order_target/order_target.py:133:12: W0201: Attribute 'order' defined outside __init__ (attribute-defined-outside-init) +samples/order_target/order_target.py:144:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/order_target/order_target.py:147:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/order_target/order_target.py:154:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/order_target/order_target.py:168:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/order_target/order_target.py:170:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.partial-plot.partial-plot +samples/partial-plot/partial-plot.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/partial-plot/partial-plot.py:1:0: C0103: Module name "partial-plot" doesn't conform to snake_case naming style (invalid-name) +samples/partial-plot/partial-plot.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/partial-plot/partial-plot.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/partial-plot/partial-plot.py:46:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/partial-plot/partial-plot.py:47:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/partial-plot/partial-plot.py:48:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/partial-plot/partial-plot.py:50:4: C0112: Empty method docstring (empty-docstring) +samples/partial-plot/partial-plot.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/partial-plot/partial-plot.py:62:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/partial-plot/partial-plot.py:65:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/partial-plot/partial-plot.py:75:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/partial-plot/partial-plot.py:78:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/partial-plot/partial-plot.py:81:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/partial-plot/partial-plot.py:81:45: W0123: Use of eval (eval-used) +samples/partial-plot/partial-plot.py:84:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/partial-plot/partial-plot.py:84:44: W0123: Use of eval (eval-used) +samples/partial-plot/partial-plot.py:87:30: W0123: Use of eval (eval-used) +samples/partial-plot/partial-plot.py:90:18: W0123: Use of eval (eval-used) +samples/partial-plot/partial-plot.py:93:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.pinkfish-challenge.pinkfish-challenge +samples/pinkfish-challenge/pinkfish-challenge.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/pinkfish-challenge/pinkfish-challenge.py:1:0: C0103: Module name "pinkfish-challenge" doesn't conform to snake_case naming style (invalid-name) +samples/pinkfish-challenge/pinkfish-challenge.py:32:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/pinkfish-challenge/pinkfish-challenge.py:32:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/pinkfish-challenge/pinkfish-challenge.py:35:26: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:35:44: E1101: Module 'backtrader' has no 'MetaParams' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:56:23: W0613: Unused argument 'data' (unused-argument) +samples/pinkfish-challenge/pinkfish-challenge.py:106:12: W0212: Access to a protected member _add2stack of a client class (protected-access) +samples/pinkfish-challenge/pinkfish-challenge.py:113:27: E1101: Module 'backtrader' has no 'with_metaclass' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:113:45: E1101: Module 'backtrader' has no 'MetaParams' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:136:23: W0613: Unused argument 'data' (unused-argument) +samples/pinkfish-challenge/pinkfish-challenge.py:113:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/pinkfish-challenge/pinkfish-challenge.py:196:0: C0112: Empty class docstring (empty-docstring) +samples/pinkfish-challenge/pinkfish-challenge.py:196:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:208:4: C0112: Empty method docstring (empty-docstring) +samples/pinkfish-challenge/pinkfish-challenge.py:211:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/pinkfish-challenge/pinkfish-challenge.py:245:4: C0112: Empty method docstring (empty-docstring) +samples/pinkfish-challenge/pinkfish-challenge.py:249:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/pinkfish-challenge/pinkfish-challenge.py:250:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:251:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:252:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:254:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:255:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:256:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:257:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:258:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:259:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:266:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pinkfish-challenge/pinkfish-challenge.py:274:25: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:274:63: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:210:8: W0201: Attribute 'callcounter' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:224:8: W0201: Attribute 'lcontrol' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:282:8: W0201: Attribute 'lcontrol' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:225:8: W0201: Attribute 'inmarket' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:276:20: W0201: Attribute 'inmarket' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:228:8: W0201: Attribute 'highest' defined outside __init__ (attribute-defined-outside-init) +samples/pinkfish-challenge/pinkfish-challenge.py:285:0: C0112: Empty function docstring (empty-docstring) +samples/pinkfish-challenge/pinkfish-challenge.py:289:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:293:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/pinkfish-challenge/pinkfish-challenge.py:303:15: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:305:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:312:15: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:314:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:319:43: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pinkfish-challenge/pinkfish-challenge.py:330:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/pinkfish-challenge/pinkfish-challenge.py:332:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.pivot-point.pivotpoint +samples/pivot-point/pivotpoint.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/pivot-point/pivotpoint.py:32:0: C0112: Empty class docstring (empty-docstring) +samples/pivot-point/pivotpoint.py:32:18: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/pivot-point/pivotpoint.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/pivot-point/pivotpoint.py:60:0: C0112: Empty class docstring (empty-docstring) +samples/pivot-point/pivotpoint.py:60:17: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/pivot-point/pivotpoint.py:70:15: R1735: Consider using '{"subplot": False}' instead of a call to 'dict'. (use-dict-literal) +samples/pivot-point/pivotpoint.py:60:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.samples.pivot-point.ppsample +samples/pivot-point/ppsample.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/pivot-point/ppsample.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/pivot-point/ppsample.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/pivot-point/ppsample.py:32:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +samples/pivot-point/ppsample.py:32:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/pivot-point/ppsample.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/pivot-point/ppsample.py:35:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/pivot-point/ppsample.py:43:23: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/pivot-point/ppsample.py:43:18: W0612: Unused variable 'pp' (unused-variable) +samples/pivot-point/ppsample.py:45:4: C0112: Empty method docstring (empty-docstring) +samples/pivot-point/ppsample.py:49:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pivot-point/ppsample.py:50:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pivot-point/ppsample.py:51:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pivot-point/ppsample.py:53:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pivot-point/ppsample.py:54:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pivot-point/ppsample.py:35:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/pivot-point/ppsample.py:61:0: C0112: Empty function docstring (empty-docstring) +samples/pivot-point/ppsample.py:65:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/pivot-point/ppsample.py:68:41: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pivot-point/ppsample.py:76:0: C0112: Empty function docstring (empty-docstring) +samples/pivot-point/ppsample.py:32:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.samples.plot-same-axis.plot-same-axis +samples/plot-same-axis/plot-same-axis.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/plot-same-axis/plot-same-axis.py:1:0: C0103: Module name "plot-same-axis" doesn't conform to snake_case naming style (invalid-name) +samples/plot-same-axis/plot-same-axis.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/plot-same-axis/plot-same-axis.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/plot-same-axis/plot-same-axis.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/plot-same-axis/plot-same-axis.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/plot-same-axis/plot-same-axis.py:37:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/plot-same-axis/plot-same-axis.py:40:13: R1735: Consider using '{"smasubplot": False, "nomacdplot": False, "rsioverstoc": False, "rsioversma": False, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/plot-same-axis/plot-same-axis.py:51:32: E1101: Instance of 'dict' has no 'smasubplot' member (no-member) +samples/plot-same-axis/plot-same-axis.py:56:33: E1101: Instance of 'dict' has no 'nomacdplot' member (no-member) +samples/plot-same-axis/plot-same-axis.py:61:11: E1101: Instance of 'dict' has no 'stocrsi' member (no-member) +samples/plot-same-axis/plot-same-axis.py:64:13: E1101: Instance of 'dict' has no 'rsioverstoc' member (no-member) +samples/plot-same-axis/plot-same-axis.py:66:13: E1101: Instance of 'dict' has no 'rsioversma' member (no-member) +samples/plot-same-axis/plot-same-axis.py:37:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/plot-same-axis/plot-same-axis.py:70:0: C0112: Empty function docstring (empty-docstring) +samples/plot-same-axis/plot-same-axis.py:75:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/plot-same-axis/plot-same-axis.py:107:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.psar.psar-intraday +samples/psar/psar-intraday.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/psar/psar-intraday.py:1:0: C0103: Module name "psar-intraday" doesn't conform to snake_case naming style (invalid-name) +samples/psar/psar-intraday.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/psar/psar-intraday.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/psar/psar-intraday.py:41:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/psar/psar-intraday.py:42:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/psar/psar-intraday.py:44:4: C0112: Empty method docstring (empty-docstring) +samples/psar/psar-intraday.py:47:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:48:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:50:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:52:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:54:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:56:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:58:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar-intraday.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/psar/psar-intraday.py:71:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/psar/psar-intraday.py:74:13: R1735: Consider using '{"timeframe": bt.TimeFrame.Minutes, "compression": 5}' instead of a call to 'dict'. (use-dict-literal) +samples/psar/psar-intraday.py:75:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/psar/psar-intraday.py:87:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/psar/psar-intraday.py:90:42: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/psar/psar-intraday.py:93:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/psar/psar-intraday.py:93:45: W0123: Use of eval (eval-used) +samples/psar/psar-intraday.py:96:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/psar/psar-intraday.py:96:44: W0123: Use of eval (eval-used) +samples/psar/psar-intraday.py:99:30: W0123: Use of eval (eval-used) +samples/psar/psar-intraday.py:102:18: W0123: Use of eval (eval-used) +samples/psar/psar-intraday.py:105:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.psar.psar +samples/psar/psar.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/psar/psar.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/psar/psar.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/psar/psar.py:41:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/psar/psar.py:43:4: C0112: Empty method docstring (empty-docstring) +samples/psar/psar.py:45:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar.py:46:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar.py:47:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/psar/psar.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/psar/psar.py:59:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/psar/psar.py:62:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/psar/psar.py:72:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/psar/psar.py:76:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/psar/psar.py:76:45: W0123: Use of eval (eval-used) +samples/psar/psar.py:79:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/psar/psar.py:79:44: W0123: Use of eval (eval-used) +samples/psar/psar.py:82:30: W0123: Use of eval (eval-used) +samples/psar/psar.py:85:18: W0123: Use of eval (eval-used) +samples/psar/psar.py:88:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.pyfolio2.pyfoliotest +samples/pyfolio2/pyfoliotest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/pyfolio2/pyfoliotest.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/pyfolio2/pyfoliotest.py:35:9: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/pyfolio2/pyfoliotest.py:48:21: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/pyfolio2/pyfoliotest.py:49:21: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/pyfolio2/pyfoliotest.py:50:21: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/pyfolio2/pyfoliotest.py:52:28: E1101: Module 'backtrader' has no 'SIGNAL_LONGSHORT' member (no-member) +samples/pyfolio2/pyfoliotest.py:54:28: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/pyfolio2/pyfoliotest.py:56:4: C0112: Empty method docstring (empty-docstring) +samples/pyfolio2/pyfoliotest.py:58:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +samples/pyfolio2/pyfoliotest.py:60:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/pyfolio2/pyfoliotest.py:71:4: C0112: Empty method docstring (empty-docstring) +samples/pyfolio2/pyfoliotest.py:73:8: E1003: Bad first argument 'self.__class__' given to super() (bad-super-call) +samples/pyfolio2/pyfoliotest.py:76:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/pyfolio2/pyfoliotest.py:77:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:79:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:80:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:81:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:82:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:83:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:84:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:90:20: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:91:17: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:92:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:93:19: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:94:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:101:0: R0914: Too many local variables (18/15) (too-many-locals) +samples/pyfolio2/pyfoliotest.py:109:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/pyfolio2/pyfoliotest.py:112:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/pyfolio2/pyfoliotest.py:128:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pyfolio2/pyfoliotest.py:132:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/pyfolio2/pyfoliotest.py:135:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/pyfolio2/pyfoliotest.py:135:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:136:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/pyfolio2/pyfoliotest.py:136:60: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/pyfolio2/pyfoliotest.py:138:8: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/pyfolio2/pyfoliotest.py:143:12: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/pyfolio2/pyfoliotest.py:159:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:164:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:169:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfolio2/pyfoliotest.py:187:11: W0125: Using a conditional statement with a constant value (using-constant-test) +samples/pyfolio2/pyfoliotest.py:188:12: C0415: Import outside toplevel (pyfolio) (import-outside-toplevel) +samples/pyfolio2/pyfoliotest.py:188:12: E0401: Unable to import 'pyfolio' (import-error) +samples/pyfolio2/pyfoliotest.py:199:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/pyfolio2/pyfoliotest.py:201:22: W0123: Use of eval (eval-used) +samples/pyfolio2/pyfoliotest.py:101:0: R0912: Too many branches (15/12) (too-many-branches) +samples/pyfolio2/pyfoliotest.py:101:0: R0915: Too many statements (59/50) (too-many-statements) +************* Module backtrader.samples.pyfoliotest.pyfoliotest +samples/pyfoliotest/pyfoliotest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/pyfoliotest/pyfoliotest.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/pyfoliotest/pyfoliotest.py:35:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/pyfoliotest/pyfoliotest.py:46:4: C0112: Empty method docstring (empty-docstring) +samples/pyfoliotest/pyfoliotest.py:49:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/pyfoliotest/pyfoliotest.py:60:4: C0112: Empty method docstring (empty-docstring) +samples/pyfoliotest/pyfoliotest.py:64:24: R1734: Consider using [] instead of list() (use-list-literal) +samples/pyfoliotest/pyfoliotest.py:65:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:67:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:68:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:69:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:70:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:71:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:72:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:84:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:89:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/pyfoliotest/pyfoliotest.py:92:0: R0914: Too many local variables (16/15) (too-many-locals) +samples/pyfoliotest/pyfoliotest.py:100:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/pyfoliotest/pyfoliotest.py:103:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/pyfoliotest/pyfoliotest.py:112:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pyfoliotest/pyfoliotest.py:115:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pyfoliotest/pyfoliotest.py:118:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/pyfoliotest/pyfoliotest.py:123:28: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/pyfoliotest/pyfoliotest.py:141:8: C0415: Import outside toplevel (pyfolio) (import-outside-toplevel) +samples/pyfoliotest/pyfoliotest.py:141:8: E0401: Unable to import 'pyfolio' (import-error) +samples/pyfoliotest/pyfoliotest.py:239:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +************* Module backtrader.samples.relative-volume.relative-volume +samples/relative-volume/relative-volume.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/relative-volume/relative-volume.py:1:0: C0103: Module name "relative-volume" doesn't conform to snake_case naming style (invalid-name) +samples/relative-volume/relative-volume.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/relative-volume/relative-volume.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/relative-volume/relative-volume.py:34:0: E0401: Unable to import 'relvolbybar' (import-error) +samples/relative-volume/relative-volume.py:37:0: C0112: Empty function docstring (empty-docstring) +samples/relative-volume/relative-volume.py:42:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/relative-volume/relative-volume.py:59:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/relative-volume/relative-volume.py:71:26: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/relative-volume/relative-volume.py:81:0: C0112: Empty function docstring (empty-docstring) +samples/relative-volume/relative-volume.py:34:0: C0411: third party import "relvolbybar.RelativeVolumeByBar" should be placed before first party imports "backtrader", "backtrader.feeds" (wrong-import-order) +************* Module backtrader.samples.relative-volume.relvolbybar +samples/relative-volume/relvolbybar.py:32:26: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/relative-volume/relvolbybar.py:61:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/relative-volume/relvolbybar.py:65:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +samples/relative-volume/relvolbybar.py:104:50: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/relative-volume/relvolbybar.py:108:21: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +************* Module backtrader.samples.renko.renko +samples/renko/renko.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/renko/renko.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/renko/renko.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/renko/renko.py:37:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/renko/renko.py:42:12: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/renko/renko.py:44:4: C0112: Empty method docstring (empty-docstring) +samples/renko/renko.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/renko/renko.py:56:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/renko/renko.py:59:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/renko/renko.py:68:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/renko/renko.py:70:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/renko/renko.py:71:21: W0123: Use of eval (eval-used) +samples/renko/renko.py:74:24: E1101: Module 'backtrader' has no 'filters' member (no-member) +samples/renko/renko.py:79:24: E1101: Module 'backtrader' has no 'filters' member (no-member) +samples/renko/renko.py:83:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/renko/renko.py:83:45: W0123: Use of eval (eval-used) +samples/renko/renko.py:86:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/renko/renko.py:86:44: W0123: Use of eval (eval-used) +samples/renko/renko.py:89:30: W0123: Use of eval (eval-used) +samples/renko/renko.py:92:13: R1735: Consider using '{"stdstats": False}' instead of a call to 'dict'. (use-dict-literal) +samples/renko/renko.py:93:20: W0123: Use of eval (eval-used) +samples/renko/renko.py:97:17: R1735: Consider using '{"style": 'candle'}' instead of a call to 'dict'. (use-dict-literal) +samples/renko/renko.py:98:24: W0123: Use of eval (eval-used) +************* Module backtrader.samples.resample-tickdata.resample-tickdata +samples/resample-tickdata/resample-tickdata.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/resample-tickdata/resample-tickdata.py:1:0: C0103: Module name "resample-tickdata" doesn't conform to snake_case naming style (invalid-name) +samples/resample-tickdata/resample-tickdata.py:31:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/resample-tickdata/resample-tickdata.py:31:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/resample-tickdata/resample-tickdata.py:34:0: C0112: Empty function docstring (empty-docstring) +samples/resample-tickdata/resample-tickdata.py:39:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/resample-tickdata/resample-tickdata.py:42:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/resample-tickdata/resample-tickdata.py:50:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:54:14: R1735: Consider using '{"ticks": bt.TimeFrame.Ticks, "microseconds": bt.TimeFrame.MicroSeconds, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/resample-tickdata/resample-tickdata.py:55:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:56:21: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:57:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:58:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:59:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:60:15: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:61:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/resample-tickdata/resample-tickdata.py:76:26: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/resample-tickdata/resample-tickdata.py:85:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.rollover.rollover +samples/rollover/rollover.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/rollover/rollover.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/rollover/rollover.py:35:18: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/rollover/rollover.py:38:4: C0112: Empty method docstring (empty-docstring) +samples/rollover/rollover.py:55:4: C0112: Empty method docstring (empty-docstring) +samples/rollover/rollover.py:57:14: R1734: Consider using [] instead of list() (use-list-literal) +samples/rollover/rollover.py:58:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:59:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:59:31: W0212: Access to a protected member _dataname of a client class (protected-access) +samples/rollover/rollover.py:61:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:61:31: W0212: Access to a protected member _dataname of a client class (protected-access) +samples/rollover/rollover.py:61:31: W0212: Access to a protected member _d of a client class (protected-access) +samples/rollover/rollover.py:62:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:63:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:64:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:65:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:66:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:67:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:68:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:69:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/rollover/rollover.py:85:4: C0103: Variable name "MONTHS" doesn't conform to snake_case naming style (invalid-name) +samples/rollover/rollover.py:85:13: R1735: Consider using '{"H": 3, "M": 6, "U": 9, "Z": 12}' instead of a call to 'dict'. (use-dict-literal) +samples/rollover/rollover.py:87:4: C0103: Variable name "M" doesn't conform to snake_case naming style (invalid-name) +samples/rollover/rollover.py:87:15: W0212: Access to a protected member _dataname of a client class (protected-access) +samples/rollover/rollover.py:92:4: C0103: Variable name "YCode" doesn't conform to snake_case naming style (invalid-name) +samples/rollover/rollover.py:92:16: W0212: Access to a protected member _dataname of a client class (protected-access) +samples/rollover/rollover.py:93:4: C0103: Variable name "Y" doesn't conform to snake_case naming style (invalid-name) +samples/rollover/rollover.py:95:8: C0103: Variable name "Y" doesn't conform to snake_case naming style (invalid-name) +samples/rollover/rollover.py:89:14: W0612: Unused variable 'year' (unused-variable) +samples/rollover/rollover.py:129:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/rollover/rollover.py:132:12: E1101: Module 'backtrader' has no 'stores' member (no-member) +samples/rollover/rollover.py:135:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/rollover/rollover.py:148:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/rollover/rollover.py:155:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/rollover/rollover.py:157:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.signals-strategy.signals-strategy +samples/signals-strategy/signals-strategy.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/signals-strategy/signals-strategy.py:1:0: C0103: Module name "signals-strategy" doesn't conform to snake_case naming style (invalid-name) +samples/signals-strategy/signals-strategy.py:36:22: E1101: Module 'backtrader' has no 'SIGNAL_LONGSHORT' member (no-member) +samples/signals-strategy/signals-strategy.py:37:21: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/signals-strategy/signals-strategy.py:38:22: E1101: Module 'backtrader' has no 'SIGNAL_SHORT' member (no-member) +samples/signals-strategy/signals-strategy.py:43:16: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT' member (no-member) +samples/signals-strategy/signals-strategy.py:44:17: E1101: Module 'backtrader' has no 'SIGNAL_LONGEXIT' member (no-member) +samples/signals-strategy/signals-strategy.py:48:0: C0112: Empty class docstring (empty-docstring) +samples/signals-strategy/signals-strategy.py:48:21: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/signals-strategy/signals-strategy.py:56:40: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/signals-strategy/signals-strategy.py:48:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/signals-strategy/signals-strategy.py:59:0: C0112: Empty class docstring (empty-docstring) +samples/signals-strategy/signals-strategy.py:59:20: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/signals-strategy/signals-strategy.py:70:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/signals-strategy/signals-strategy.py:71:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/signals-strategy/signals-strategy.py:59:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/signals-strategy/signals-strategy.py:83:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/signals-strategy/signals-strategy.py:86:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/signals-strategy/signals-strategy.py:96:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/signals-strategy/signals-strategy.py:111:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/signals-strategy/signals-strategy.py:113:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.sigsmacross.sigsmacross +samples/sigsmacross/sigsmacross.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/sigsmacross/sigsmacross.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/sigsmacross/sigsmacross.py:34:15: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/sigsmacross/sigsmacross.py:37:13: R1735: Consider using '{"sma1": 10, "sma2": 20}' instead of a call to 'dict'. (use-dict-literal) +samples/sigsmacross/sigsmacross.py:47:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/sigsmacross/sigsmacross.py:48:20: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/sigsmacross/sigsmacross.py:62:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/sigsmacross/sigsmacross.py:66:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross.py:66:33: E1101: Instance of 'dict' has no 'sma1' member (no-member) +samples/sigsmacross/sigsmacross.py:67:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross.py:67:33: E1101: Instance of 'dict' has no 'sma2' member (no-member) +samples/sigsmacross/sigsmacross.py:68:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross.py:69:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/sigsmacross/sigsmacross.py:80:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/sigsmacross/sigsmacross.py:83:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/sigsmacross/sigsmacross.py:90:37: W0123: Use of eval (eval-used) +samples/sigsmacross/sigsmacross.py:91:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/sigsmacross/sigsmacross.py:95:24: W0123: Use of eval (eval-used) +************* Module backtrader.samples.sigsmacross.sigsmacross2 +samples/sigsmacross/sigsmacross2.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/sigsmacross/sigsmacross2.py:26:0: C0112: Empty class docstring (empty-docstring) +samples/sigsmacross/sigsmacross2.py:26:15: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/sigsmacross/sigsmacross2.py:31:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross2.py:32:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross2.py:33:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/sigsmacross/sigsmacross2.py:34:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/sigsmacross/sigsmacross2.py:26:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/sigsmacross/sigsmacross2.py:37:10: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/sigsmacross/sigsmacross2.py:40:8: E1101: Module 'backtrader' has no 'feeds' member (no-member) +************* Module backtrader.samples.sizertest.sizertest +samples/sizertest/sizertest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/sizertest/sizertest.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/sizertest/sizertest.py:34:15: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/sizertest/sizertest.py:41:14: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/sizertest/sizertest.py:42:25: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/sizertest/sizertest.py:44:4: C0112: Empty method docstring (empty-docstring) +samples/sizertest/sizertest.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/sizertest/sizertest.py:53:0: C0112: Empty class docstring (empty-docstring) +samples/sizertest/sizertest.py:53:15: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +samples/sizertest/sizertest.py:58:25: W0613: Unused argument 'comminfo' (unused-argument) +samples/sizertest/sizertest.py:58:35: W0613: Unused argument 'cash' (unused-argument) +samples/sizertest/sizertest.py:53:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/sizertest/sizertest.py:78:0: C0112: Empty class docstring (empty-docstring) +samples/sizertest/sizertest.py:78:20: E1101: Module 'backtrader' has no 'Sizer' member (no-member) +samples/sizertest/sizertest.py:83:25: W0613: Unused argument 'comminfo' (unused-argument) +samples/sizertest/sizertest.py:83:35: W0613: Unused argument 'cash' (unused-argument) +samples/sizertest/sizertest.py:83:47: W0613: Unused argument 'isbuy' (unused-argument) +samples/sizertest/sizertest.py:78:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/sizertest/sizertest.py:105:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/sizertest/sizertest.py:108:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/sizertest/sizertest.py:117:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/sizertest/sizertest.py:125:25: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/sizertest/sizertest.py:129:18: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/sizertest/sizertest.py:131:22: W0123: Use of eval (eval-used) +************* Module backtrader.samples.slippage.slippage +samples/slippage/slippage.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/slippage/slippage.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/slippage/slippage.py:35:19: E1101: Module 'backtrader' has no 'Indicator' member (no-member) +samples/slippage/slippage.py:46:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/slippage/slippage.py:47:15: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/slippage/slippage.py:48:28: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/slippage/slippage.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/slippage/slippage.py:51:0: C0112: Empty class docstring (empty-docstring) +samples/slippage/slippage.py:51:13: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/slippage/slippage.py:62:27: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/slippage/slippage.py:64:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/slippage/slippage.py:65:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/slippage/slippage.py:51:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/slippage/slippage.py:79:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/slippage/slippage.py:82:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/slippage/slippage.py:92:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/slippage/slippage.py:97:16: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/slippage/slippage.py:99:16: E1101: Module 'backtrader' has no 'signal' member (no-member) +samples/slippage/slippage.py:121:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/slippage/slippage.py:123:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.sratio.sratio +samples/sratio/sratio.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/sratio/sratio.py:18:4: W0622: Redefining built-in 'map' (redefined-builtin) +samples/sratio/sratio.py:18:10: E1101: Module 'itertools' has no 'imap' member (no-member) +************* Module backtrader.samples.stop-trading.stop-loss-approaches +samples/stop-trading/stop-loss-approaches.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/stop-trading/stop-loss-approaches.py:1:0: C0103: Module name "stop-loss-approaches" doesn't conform to snake_case naming style (invalid-name) +samples/stop-trading/stop-loss-approaches.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:34:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/stop-trading/stop-loss-approaches.py:37:13: R1735: Consider using '{"fast_ma": 10, "slow_ma": 20}' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:45:18: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/stop-trading/stop-loss-approaches.py:46:18: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/stop-trading/stop-loss-approaches.py:48:23: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/stop-trading/stop-loss-approaches.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/stop-trading/stop-loss-approaches.py:51:0: C0112: Empty class docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:54:13: R1735: Consider using '{"stop_loss": 0.02, "trail": False}' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:69:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:73:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:77:31: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:79:31: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:81:4: C0112: Empty method docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:88:0: C0112: Empty class docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:91:13: R1735: Consider using '{"stop_loss": 0.02, "trail": False}' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:111:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:115:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:117:4: C0112: Empty method docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:125:35: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:127:35: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:130:0: C0112: Empty class docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:133:13: R1735: Consider using '{"stop_loss": 0.02, "trail": False, "buy_limit": False}' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:149:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:159:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:163:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/stop-trading/stop-loss-approaches.py:165:4: C0112: Empty method docstring (empty-docstring) +samples/stop-trading/stop-loss-approaches.py:179:42: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:186:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:192:29: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stop-trading/stop-loss-approaches.py:198:13: R1735: Consider using '{"manual": ManualStopOrStopTrail, "manualcheat": ManualStopOrStopTrailCheat, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:213:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/stop-trading/stop-loss-approaches.py:216:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/stop-trading/stop-loss-approaches.py:225:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/stop-trading/stop-loss-approaches.py:229:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/stop-trading/stop-loss-approaches.py:229:45: W0123: Use of eval (eval-used) +samples/stop-trading/stop-loss-approaches.py:232:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/stop-trading/stop-loss-approaches.py:232:44: W0123: Use of eval (eval-used) +samples/stop-trading/stop-loss-approaches.py:235:4: C0103: Variable name "StClass" doesn't conform to snake_case naming style (invalid-name) +samples/stop-trading/stop-loss-approaches.py:236:35: W0123: Use of eval (eval-used) +samples/stop-trading/stop-loss-approaches.py:239:18: W0123: Use of eval (eval-used) +samples/stop-trading/stop-loss-approaches.py:242:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.stoptrail.trail +samples/stoptrail/trail.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/stoptrail/trail.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/stoptrail/trail.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/stoptrail/trail.py:37:13: R1735: Consider using '{"ma": bt.ind.SMA, "p1": 10, "p2": 30, "stoptype": bt.Order.StopTrail, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/stoptrail/trail.py:38:11: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/stoptrail/trail.py:41:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stoptrail/trail.py:50:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/stoptrail/trail.py:53:4: C0112: Empty method docstring (empty-docstring) +samples/stoptrail/trail.py:62:34: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/stoptrail/trail.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/stoptrail/trail.py:123:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/stoptrail/trail.py:126:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/stoptrail/trail.py:136:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/stoptrail/trail.py:140:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/stoptrail/trail.py:140:45: W0123: Use of eval (eval-used) +samples/stoptrail/trail.py:143:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/stoptrail/trail.py:143:44: W0123: Use of eval (eval-used) +samples/stoptrail/trail.py:146:30: W0123: Use of eval (eval-used) +samples/stoptrail/trail.py:149:18: W0123: Use of eval (eval-used) +samples/stoptrail/trail.py:152:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.strategy-selection.strategy-selection +samples/strategy-selection/strategy-selection.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/strategy-selection/strategy-selection.py:1:0: C0103: Module name "strategy-selection" doesn't conform to snake_case naming style (invalid-name) +samples/strategy-selection/strategy-selection.py:33:0: C0112: Empty class docstring (empty-docstring) +samples/strategy-selection/strategy-selection.py:33:10: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/strategy-selection/strategy-selection.py:38:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/strategy-selection/strategy-selection.py:38:44: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/strategy-selection/strategy-selection.py:39:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/strategy-selection/strategy-selection.py:40:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/strategy-selection/strategy-selection.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/strategy-selection/strategy-selection.py:43:0: C0112: Empty class docstring (empty-docstring) +samples/strategy-selection/strategy-selection.py:43:10: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +samples/strategy-selection/strategy-selection.py:48:15: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/strategy-selection/strategy-selection.py:49:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/strategy-selection/strategy-selection.py:50:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +samples/strategy-selection/strategy-selection.py:43:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/strategy-selection/strategy-selection.py:53:0: C0112: Empty class docstring (empty-docstring) +samples/strategy-selection/strategy-selection.py:53:0: R0205: Class 'StFetcher' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +samples/strategy-selection/strategy-selection.py:53:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/strategy-selection/strategy-selection.py:79:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/strategy-selection/strategy-selection.py:80:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/strategy-selection/strategy-selection.py:83:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/strategy-selection/strategy-selection.py:91:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.samples.talib.tablibsartest +samples/talib/tablibsartest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/talib/tablibsartest.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/talib/tablibsartest.py:34:20: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/talib/tablibsartest.py:39:8: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/tablibsartest.py:40:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/talib/tablibsartest.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/talib/tablibsartest.py:51:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/talib/tablibsartest.py:53:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/talib/tablibsartest.py:62:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/talib/tablibsartest.py:68:18: R1735: Consider using '{"style": 'candle'}' instead of a call to 'dict'. (use-dict-literal) +samples/talib/tablibsartest.py:70:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.talib.talibtest +samples/talib/talibtest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/talib/talibtest.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/talib/talibtest.py:34:20: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/talib/talibtest.py:64:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:69:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:70:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:72:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:73:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:75:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:85:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:88:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:89:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:90:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:92:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:93:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:96:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:97:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:100:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:101:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:104:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:110:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:113:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:114:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:117:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:123:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:126:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:127:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:130:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:131:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:134:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:135:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:135:48: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:138:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:139:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:142:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:143:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:144:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:145:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:146:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:147:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:148:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:151:12: E1101: Module 'backtrader' has no 'talib' member (no-member) +samples/talib/talibtest.py:157:12: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/talib/talibtest.py:61:4: R0912: Too many branches (17/12) (too-many-branches) +samples/talib/talibtest.py:61:4: R0915: Too many statements (57/50) (too-many-statements) +samples/talib/talibtest.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/talib/talibtest.py:168:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/talib/talibtest.py:170:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/talib/talibtest.py:179:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/talib/talibtest.py:186:18: R1735: Consider using '{"style": 'candle'}' instead of a call to 'dict'. (use-dict-literal) +samples/talib/talibtest.py:188:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.timers.scheduled-min +samples/timers/scheduled-min.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/timers/scheduled-min.py:1:0: C0103: Module name "scheduled-min" doesn't conform to snake_case naming style (invalid-name) +samples/timers/scheduled-min.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/timers/scheduled-min.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/timers/scheduled-min.py:37:13: R1735: Consider using '{"when": bt.timer.SESSION_START, "timer": True, "cheat": False, "offset": datetime.timedelta(), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/timers/scheduled-min.py:38:13: E1101: Module 'backtrader' has no 'timer' member (no-member) +samples/timers/scheduled-min.py:51:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/timers/scheduled-min.py:78:4: C0112: Empty method docstring (empty-docstring) +samples/timers/scheduled-min.py:82:4: C0112: Empty method docstring (empty-docstring) +samples/timers/scheduled-min.py:85:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled-min.py:108:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled-min.py:114:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled-min.py:98:0: W0613: Unused argument 'args' (unused-argument) +samples/timers/scheduled-min.py:98:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/timers/scheduled-min.py:125:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled-min.py:138:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/timers/scheduled-min.py:141:13: R1735: Consider using '{"timeframe": bt.TimeFrame.Minutes, "compression": 5, "sessionstart": datetime.time(9, 0), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/timers/scheduled-min.py:142:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/timers/scheduled-min.py:156:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/timers/scheduled-min.py:160:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/timers/scheduled-min.py:160:45: W0123: Use of eval (eval-used) +samples/timers/scheduled-min.py:163:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/timers/scheduled-min.py:163:44: W0123: Use of eval (eval-used) +samples/timers/scheduled-min.py:166:30: W0123: Use of eval (eval-used) +samples/timers/scheduled-min.py:169:18: W0123: Use of eval (eval-used) +samples/timers/scheduled-min.py:172:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.timers.scheduled +samples/timers/scheduled.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/timers/scheduled.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/timers/scheduled.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/timers/scheduled.py:37:13: R1735: Consider using '{"when": bt.timer.SESSION_START, "timer": True, "cheat": False, "offset": datetime.timedelta(), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/timers/scheduled.py:38:13: E1101: Module 'backtrader' has no 'timer' member (no-member) +samples/timers/scheduled.py:48:8: E1101: Module 'backtrader' has no 'ind' member (no-member) +samples/timers/scheduled.py:66:4: C0112: Empty method docstring (empty-docstring) +samples/timers/scheduled.py:70:4: C0112: Empty method docstring (empty-docstring) +samples/timers/scheduled.py:73:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled.py:96:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled.py:102:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled.py:86:0: W0613: Unused argument 'args' (unused-argument) +samples/timers/scheduled.py:86:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/timers/scheduled.py:113:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/timers/scheduled.py:127:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/timers/scheduled.py:130:13: R1735: Consider using '{"timeframe": bt.TimeFrame.Days, "compression": 1, "sessionstart": datetime.time(9, 0), ... }' instead of a call to 'dict'. (use-dict-literal) +samples/timers/scheduled.py:131:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/timers/scheduled.py:145:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/timers/scheduled.py:149:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/timers/scheduled.py:149:45: W0123: Use of eval (eval-used) +samples/timers/scheduled.py:152:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/timers/scheduled.py:152:44: W0123: Use of eval (eval-used) +samples/timers/scheduled.py:155:30: W0123: Use of eval (eval-used) +samples/timers/scheduled.py:158:18: W0123: Use of eval (eval-used) +samples/timers/scheduled.py:161:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.tradingcalendar.tcal-intra +samples/tradingcalendar/tcal-intra.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/tradingcalendar/tcal-intra.py:1:0: C0103: Module name "tcal-intra" doesn't conform to snake_case naming style (invalid-name) +samples/tradingcalendar/tcal-intra.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/tradingcalendar/tcal-intra.py:34:0: C0103: Class name "NYSE_2016" doesn't conform to PascalCase naming style (invalid-name) +samples/tradingcalendar/tcal-intra.py:34:16: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +samples/tradingcalendar/tcal-intra.py:37:13: R1735: Consider using '{"holidays": [datetime.date(2016, 1, 1), datetime.date(2016, 1, 18), datetime.date(2016, 2, 15), datetime.date(2016, 3, 25), datetime.date(2016, 5, 30), datetime.date(2016, 7, 4), datetime.date(2016, 9, 5), datetime.date(2016, 11, 24), datetime.date(2016, 12, 26)], ... }' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal-intra.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/tradingcalendar/tcal-intra.py:61:0: C0112: Empty class docstring (empty-docstring) +samples/tradingcalendar/tcal-intra.py:61:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/tradingcalendar/tcal-intra.py:64:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal-intra.py:69:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal-intra.py:73:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal-intra.py:76:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal-intra.py:81:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal-intra.py:89:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal-intra.py:105:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/tradingcalendar/tcal-intra.py:114:13: R1735: Consider using '{"tzinput": tzinput, "tz": tz}' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal-intra.py:124:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/tradingcalendar/tcal-intra.py:127:55: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/tradingcalendar/tcal-intra.py:137:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/tradingcalendar/tcal-intra.py:137:45: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal-intra.py:140:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/tradingcalendar/tcal-intra.py:140:44: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal-intra.py:143:30: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal-intra.py:146:18: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal-intra.py:149:23: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal-intra.py:127:4: W0612: Unused variable 'd1' (unused-variable) +************* Module backtrader.samples.tradingcalendar.tcal +samples/tradingcalendar/tcal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/tradingcalendar/tcal.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/tradingcalendar/tcal.py:34:0: C0103: Class name "NYSE_2016" doesn't conform to PascalCase naming style (invalid-name) +samples/tradingcalendar/tcal.py:34:16: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +samples/tradingcalendar/tcal.py:37:13: R1735: Consider using '{"holidays": [datetime.date(2016, 1, 1), datetime.date(2016, 1, 18), datetime.date(2016, 2, 15), datetime.date(2016, 3, 25), datetime.date(2016, 5, 30), datetime.date(2016, 7, 4), datetime.date(2016, 9, 5), datetime.date(2016, 11, 24), datetime.date(2016, 12, 26)], ... }' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal.py:34:0: R0903: Too few public methods (0/2) (too-few-public-methods) +samples/tradingcalendar/tcal.py:52:0: C0112: Empty class docstring (empty-docstring) +samples/tradingcalendar/tcal.py:52:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/tradingcalendar/tcal.py:55:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal.py:60:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal.py:64:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal.py:69:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal.py:73:4: C0112: Empty method docstring (empty-docstring) +samples/tradingcalendar/tcal.py:76:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal.py:81:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal.py:89:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/tradingcalendar/tcal.py:62:8: W0201: Attribute 't0' defined outside __init__ (attribute-defined-outside-init) +samples/tradingcalendar/tcal.py:105:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/tradingcalendar/tcal.py:108:13: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/tradingcalendar/tcal.py:117:4: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/tradingcalendar/tcal.py:117:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/tradingcalendar/tcal.py:119:8: C0103: Variable name "YahooData" doesn't conform to snake_case naming style (invalid-name) +samples/tradingcalendar/tcal.py:119:20: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/tradingcalendar/tcal.py:125:55: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/tradingcalendar/tcal.py:135:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/tradingcalendar/tcal.py:135:45: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal.py:138:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +samples/tradingcalendar/tcal.py:138:44: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal.py:141:30: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal.py:144:18: W0123: Use of eval (eval-used) +samples/tradingcalendar/tcal.py:147:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.vctest.vctest +samples/vctest/vctest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/vctest/vctest.py:35:0: C0112: Empty class docstring (empty-docstring) +samples/vctest/vctest.py:35:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/vctest/vctest.py:38:13: R1735: Consider using '{"smaperiod": 5, "trade": False, "stake": 10, "exectype": bt.Order.Market, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/vctest/vctest.py:42:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/vctest/vctest.py:54:23: R1734: Consider using [] instead of list() (use-list-literal) +samples/vctest/vctest.py:61:19: E1101: Module 'backtrader' has no 'indicators' member (no-member) +samples/vctest/vctest.py:76:38: W0212: Access to a protected member _getstatusname of a client class (protected-access) +samples/vctest/vctest.py:67:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/vctest/vctest.py:81:0: W0613: Unused argument 'args' (unused-argument) +samples/vctest/vctest.py:81:0: W0613: Unused argument 'kwargs' (unused-argument) +samples/vctest/vctest.py:114:4: C0112: Empty method docstring (empty-docstring) +samples/vctest/vctest.py:124:14: R1734: Consider using [] instead of list() (use-list-literal) +samples/vctest/vctest.py:125:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:127:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:128:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:129:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:130:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:131:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:132:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:133:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:134:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:138:18: R1734: Consider using [] instead of list() (use-list-literal) +samples/vctest/vctest.py:139:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:141:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:142:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:143:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:144:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:145:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:146:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:147:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:148:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/vctest/vctest.py:176:59: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/vctest/vctest.py:118:19: W0613: Unused argument 'frompre' (unused-argument) +samples/vctest/vctest.py:185:4: C0112: Empty method docstring (empty-docstring) +samples/vctest/vctest.py:199:8: W0201: Attribute 'done' defined outside __init__ (attribute-defined-outside-init) +samples/vctest/vctest.py:202:0: C0112: Empty function docstring (empty-docstring) +samples/vctest/vctest.py:202:0: R0914: Too many local variables (18/15) (too-many-locals) +samples/vctest/vctest.py:207:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/vctest/vctest.py:209:18: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/vctest/vctest.py:212:18: E1101: Module 'backtrader' has no 'stores' member (no-member) +samples/vctest/vctest.py:215:21: R1735: Consider using '{"account": args.account, **storekwargs}' instead of a call to 'dict'. (use-dict-literal) +samples/vctest/vctest.py:219:21: E1101: Module 'backtrader' has no 'brokers' member (no-member) +samples/vctest/vctest.py:223:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vctest/vctest.py:225:17: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vctest/vctest.py:241:4: C0103: Variable name "VCDataFactory" doesn't conform to snake_case naming style (invalid-name) +samples/vctest/vctest.py:241:61: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/vctest/vctest.py:243:17: R1735: Consider using '{"timeframe": datatf, "compression": datacomp, "fromdate": fromdate, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/vctest/vctest.py:262:15: R1735: Consider using '{"timeframe": timeframe, "compression": args.compression, "bar2edge": not args.no_bar2edge, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/vctest/vctest.py:292:15: W0718: Catching too general exception BaseException (broad-exception-caught) +samples/vctest/vctest.py:300:8: E0602: Undefined variable 'TestStrategy' (undefined-variable) +samples/vctest/vctest.py:303:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/vctest/vctest.py:202:0: R0912: Too many branches (21/12) (too-many-branches) +samples/vctest/vctest.py:202:0: R0915: Too many statements (63/50) (too-many-statements) +samples/vctest/vctest.py:320:0: C0112: Empty function docstring (empty-docstring) +samples/vctest/vctest.py:455:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vctest/vctest.py:456:16: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vctest/vctest.py:523:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/vctest/vctest.py:524:16: E1101: Module 'backtrader' has no 'Order' member (no-member) +************* Module backtrader.samples.volumefilling.volumefilling +samples/volumefilling/volumefilling.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/volumefilling/volumefilling.py:34:0: C0112: Empty class docstring (empty-docstring) +samples/volumefilling/volumefilling.py:34:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/volumefilling/volumefilling.py:60:4: C0112: Empty method docstring (empty-docstring) +samples/volumefilling/volumefilling.py:63:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/volumefilling/volumefilling.py:76:4: C0112: Empty method docstring (empty-docstring) +samples/volumefilling/volumefilling.py:78:20: R1734: Consider using [] instead of list() (use-list-literal) +samples/volumefilling/volumefilling.py:79:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:81:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:82:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:83:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:84:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:85:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:86:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/volumefilling/volumefilling.py:55:12: W0201: Attribute 'doop' defined outside __init__ (attribute-defined-outside-init) +samples/volumefilling/volumefilling.py:74:8: W0201: Attribute 'doop' defined outside __init__ (attribute-defined-outside-init) +samples/volumefilling/volumefilling.py:62:8: W0201: Attribute 'callcounter' defined outside __init__ (attribute-defined-outside-init) +samples/volumefilling/volumefilling.py:103:17: E1101: Module 'backtrader' has no 'broker' member (no-member) +samples/volumefilling/volumefilling.py:104:20: E1101: Module 'backtrader' has no 'broker' member (no-member) +samples/volumefilling/volumefilling.py:105:20: E1101: Module 'backtrader' has no 'broker' member (no-member) +samples/volumefilling/volumefilling.py:109:0: C0112: Empty function docstring (empty-docstring) +samples/volumefilling/volumefilling.py:113:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/volumefilling/volumefilling.py:122:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/volumefilling/volumefilling.py:124:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/volumefilling/volumefilling.py:129:23: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/volumefilling/volumefilling.py:131:27: W0123: Use of eval (eval-used) +samples/volumefilling/volumefilling.py:143:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.vwr.vwr +samples/vwr/vwr.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/vwr/vwr.py:33:10: R1735: Consider using '{"days": bt.TimeFrame.Days, "weeks": bt.TimeFrame.Weeks, "months": bt.TimeFrame.Months, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/vwr/vwr.py:34:9: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:35:10: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:36:11: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:37:10: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:50:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/vwr/vwr.py:55:14: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/vwr/vwr.py:65:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/vwr/vwr.py:68:24: E1101: Module 'backtrader.strategies' has no 'SMA_CrossOver' member (no-member) +samples/vwr/vwr.py:70:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/vwr/vwr.py:77:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:79:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +samples/vwr/vwr.py:92:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:93:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:94:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:96:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:96:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:97:24: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +samples/vwr/vwr.py:97:59: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +samples/vwr/vwr.py:100:22: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/vwr/vwr.py:106:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +samples/vwr/vwr.py:108:23: W0123: Use of eval (eval-used) +************* Module backtrader.samples.weekdays-filler.weekdaysaligner +samples/weekdays-filler/weekdaysaligner.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/weekdays-filler/weekdaysaligner.py:32:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/weekdays-filler/weekdaysaligner.py:32:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/weekdays-filler/weekdaysaligner.py:33:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/weekdays-filler/weekdaysaligner.py:33:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/weekdays-filler/weekdaysaligner.py:34:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +samples/weekdays-filler/weekdaysaligner.py:34:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +samples/weekdays-filler/weekdaysaligner.py:37:0: E0401: Unable to import 'weekdaysfiller' (import-error) +samples/weekdays-filler/weekdaysaligner.py:40:0: C0112: Empty class docstring (empty-docstring) +samples/weekdays-filler/weekdaysaligner.py:40:9: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/weekdays-filler/weekdaysaligner.py:51:4: C0112: Empty method docstring (empty-docstring) +samples/weekdays-filler/weekdaysaligner.py:56:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/weekdays-filler/weekdaysaligner.py:57:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/weekdays-filler/weekdaysaligner.py:58:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/weekdays-filler/weekdaysaligner.py:40:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/weekdays-filler/weekdaysaligner.py:62:0: C0112: Empty function docstring (empty-docstring) +samples/weekdays-filler/weekdaysaligner.py:69:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/weekdays-filler/weekdaysaligner.py:71:4: C0103: Variable name "DataFeed" doesn't conform to snake_case naming style (invalid-name) +samples/weekdays-filler/weekdaysaligner.py:73:8: C0103: Variable name "DataFeed" doesn't conform to snake_case naming style (invalid-name) +samples/weekdays-filler/weekdaysaligner.py:98:0: C0112: Empty function docstring (empty-docstring) +samples/weekdays-filler/weekdaysaligner.py:37:0: C0411: third party import "weekdaysfiller.WeekDaysFiller" should be placed before first party imports "backtrader", "backtrader.feeds", "backtrader.indicators", "backtrader.utils.flushfile" (wrong-import-order) +samples/weekdays-filler/weekdaysaligner.py:34:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.samples.weekdays-filler.weekdaysfiller +samples/weekdays-filler/weekdaysfiller.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/weekdays-filler/weekdaysfiller.py:31:0: R0205: Class 'WeekDaysFiller' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +samples/weekdays-filler/weekdaysfiller.py:63:36: E0203: Access to member 'lastclose' before its definition line 72 (access-member-before-definition) +samples/weekdays-filler/weekdaysfiller.py:72:8: W0201: Attribute 'lastclose' defined outside __init__ (attribute-defined-outside-init) +samples/weekdays-filler/weekdaysfiller.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods) +************* Module backtrader.samples.writer-test.writer-test +samples/writer-test/writer-test.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/writer-test/writer-test.py:1:0: C0103: Module name "writer-test" doesn't conform to snake_case naming style (invalid-name) +samples/writer-test/writer-test.py:33:0: E0401: Unable to import 'backtrader.feeds' (import-error) +samples/writer-test/writer-test.py:33:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +samples/writer-test/writer-test.py:34:0: E0401: Unable to import 'backtrader.indicators' (import-error) +samples/writer-test/writer-test.py:34:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +samples/writer-test/writer-test.py:35:0: E0401: Unable to import 'backtrader.analyzers' (import-error) +samples/writer-test/writer-test.py:35:0: E0611: No name 'analyzers' in module 'backtrader' (no-name-in-module) +samples/writer-test/writer-test.py:38:24: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/writer-test/writer-test.py:47:13: R1735: Consider using '{"period": 15, "stake": 1, "printout": False, "onlylong": False, "csvcross": False, ... }' instead of a call to 'dict'. (use-dict-literal) +samples/writer-test/writer-test.py:55:4: C0112: Empty method docstring (empty-docstring) +samples/writer-test/writer-test.py:58:4: C0112: Empty method docstring (empty-docstring) +samples/writer-test/writer-test.py:70:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +samples/writer-test/writer-test.py:71:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:84:4: C0112: Empty method docstring (empty-docstring) +samples/writer-test/writer-test.py:91:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:94:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:99:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:103:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:112:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/writer-test/writer-test.py:112:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +samples/writer-test/writer-test.py:117:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:120:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:124:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:125:12: W0107: Unnecessary pass statement (unnecessary-pass) +samples/writer-test/writer-test.py:137:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:140:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +samples/writer-test/writer-test.py:143:0: C0112: Empty function docstring (empty-docstring) +samples/writer-test/writer-test.py:148:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/writer-test/writer-test.py:181:22: E1101: Module 'backtrader' has no 'WriterFile' member (no-member) +samples/writer-test/writer-test.py:191:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.samples.srl_strategies +samples/srl_strategies/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.samples.srl_strategies.buy_and_hold_simple +samples/srl_strategies/buy_and_hold_simple.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/srl_strategies/buy_and_hold_simple.py:9:0: C0112: Empty class docstring (empty-docstring) +samples/srl_strategies/buy_and_hold_simple.py:9:17: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/srl_strategies/buy_and_hold_simple.py:16:4: C0112: Empty method docstring (empty-docstring) +samples/srl_strategies/buy_and_hold_simple.py:9:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/srl_strategies/buy_and_hold_simple.py:23:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/srl_strategies/buy_and_hold_simple.py:26:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +************* Module backtrader.samples.srl_strategies.cost_average +samples/srl_strategies/cost_average.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/srl_strategies/cost_average.py:6:0: C0112: Empty class docstring (empty-docstring) +samples/srl_strategies/cost_average.py:6:26: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/srl_strategies/cost_average.py:15:4: C0112: Empty method docstring (empty-docstring) +samples/srl_strategies/cost_average.py:6:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/srl_strategies/cost_average.py:23:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/srl_strategies/cost_average.py:26:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +************* Module backtrader.samples.srl_strategies.momentum +samples/srl_strategies/momentum.py:1:0: C0114: Missing module docstring (missing-module-docstring) +samples/srl_strategies/momentum.py:8:0: E0401: Unable to import 'yfinance' (import-error) +samples/srl_strategies/momentum.py:14:0: C0112: Empty class docstring (empty-docstring) +samples/srl_strategies/momentum.py:14:23: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +samples/srl_strategies/momentum.py:27:4: C0112: Empty method docstring (empty-docstring) +samples/srl_strategies/momentum.py:14:0: R0903: Too few public methods (1/2) (too-few-public-methods) +samples/srl_strategies/momentum.py:45:16: E1101: Module 'backtrader' has no 'feeds' member (no-member) +samples/srl_strategies/momentum.py:48:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +samples/srl_strategies/momentum.py:8:0: C0411: third party import "yfinance" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.src.anoroa.models +src/anoroa/models.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.tests.test_bbroker_try_exec_limit +tests/test_bbroker_try_exec_limit.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_bbroker_try_exec_limit.py:31:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_bbroker_try_exec_limit.py:32:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_bbroker_try_exec_limit.py:34:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_bbroker_try_exec_limit.py:37:0: C0112: Empty class docstring (empty-docstring) +tests/test_bbroker_try_exec_limit.py:37:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +tests/test_bbroker_try_exec_limit.py:37:23: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +tests/test_bbroker_try_exec_limit.py:55:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_bbroker_try_exec_limit.py:56:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:58:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:66:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_bbroker_try_exec_limit.py:66:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_bbroker_try_exec_limit.py:70:33: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_bbroker_try_exec_limit.py:72:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:74:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:78:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:81:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:86:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:98:4: C0112: Empty method docstring (empty-docstring) +tests/test_bbroker_try_exec_limit.py:104:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:110:25: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_bbroker_try_exec_limit.py:111:26: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_bbroker_try_exec_limit.py:112:23: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_bbroker_try_exec_limit.py:113:24: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_bbroker_try_exec_limit.py:115:4: C0112: Empty method docstring (empty-docstring) +tests/test_bbroker_try_exec_limit.py:119:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:120:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:121:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:126:4: C0112: Empty method docstring (empty-docstring) +tests/test_bbroker_try_exec_limit.py:130:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:139:4: C0112: Empty method docstring (empty-docstring) +tests/test_bbroker_try_exec_limit.py:144:44: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_bbroker_try_exec_limit.py:146:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_bbroker_try_exec_limit.py:108:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_bbroker_try_exec_limit.py:110:8: W0201: Attribute 'buycreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_bbroker_try_exec_limit.py:111:8: W0201: Attribute 'sellcreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_bbroker_try_exec_limit.py:112:8: W0201: Attribute 'buyexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_bbroker_try_exec_limit.py:113:8: W0201: Attribute 'sellexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_bbroker_try_exec_limit.py:157:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_bbroker_try_exec_limit.py:160:23: R1735: Consider using '{"printdata": True, "printops": True}' instead of a call to 'dict'. (use-dict-literal) +tests/test_bbroker_try_exec_limit.py:162:23: R1735: Consider using '{"printdata": False, "printops": False}' instead of a call to 'dict'. (use-dict-literal) +tests/test_bbroker_try_exec_limit.py:172:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_bbroker_try_exec_limit.py:175:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_bbroker_try_exec_limit.py:194:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.tests.test_multidata_optimize +tests/test_multidata_optimize.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_multidata_optimize.py:7:0: C0112: Empty class docstring (empty-docstring) +tests/test_multidata_optimize.py:7:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_multidata_optimize.py:7:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/test_multidata_optimize.py:17:0: C0112: Empty function docstring (empty-docstring) +tests/test_multidata_optimize.py:19:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_multidata_optimize.py:23:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_multidata_optimize.py:32:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_multidata_optimize.py:4:0: C0411: third party import "testcommon.getdatadir" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_pickle_datatrades +tests/test_pickle_datatrades.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_pickle_datatrades.py:9:0: C0112: Empty class docstring (empty-docstring) +tests/test_pickle_datatrades.py:9:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_pickle_datatrades.py:9:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/test_pickle_datatrades.py:19:0: C0112: Empty function docstring (empty-docstring) +tests/test_pickle_datatrades.py:21:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_pickle_datatrades.py:23:24: E1101: Module 'backtrader' has no 'observers' member (no-member) +tests/test_pickle_datatrades.py:27:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_pickle_datatrades.py:6:0: C0411: third party import "testcommon.getdatadir" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_resample_live +tests/test_resample_live.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_resample_live.py:14:0: E0401: Unable to import 'freezegun' (import-error) +tests/test_resample_live.py:28:10: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_resample_live.py:35:0: R0913: Too many arguments (9/5) (too-many-arguments) +tests/test_resample_live.py:35:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +tests/test_resample_live.py:45:5: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_resample_live.py:61:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_resample_live.py:62:24: E1101: Module 'backtrader.strategies' has no 'NullStrategy' member (no-member) +tests/test_resample_live.py:64:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_resample_live.py:83:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:87:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:89:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:103:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:107:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:109:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:135:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:139:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:142:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:160:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:164:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:167:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:185:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:190:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:192:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:226:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:228:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:258:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:262:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:264:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:283:0: C0112: Empty function docstring (empty-docstring) +tests/test_resample_live.py:287:23: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:289:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resample_live.py:14:0: C0411: third party import "freezegun.freeze_time" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_resample_live.py:15:0: C0411: third party import "util_asserts.assert_data" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_stores_ibstore_dt_plus_duration +tests/test_stores_ibstore_dt_plus_duration.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_stores_ibstore_dt_plus_duration.py:5:8: E1101: Module 'backtrader' has no 'stores' member (no-member) +tests/test_stores_ibstore_dt_plus_duration.py:8:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.tests.test_tradingcalendar +tests/test_tradingcalendar.py:123:0: C0301: Line too long (109/100) (line-too-long) +tests/test_tradingcalendar.py:145:0: C0301: Line too long (104/100) (line-too-long) +tests/test_tradingcalendar.py:181:0: C0301: Line too long (158/100) (line-too-long) +tests/test_tradingcalendar.py:182:0: C0301: Line too long (130/100) (line-too-long) +tests/test_tradingcalendar.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_tradingcalendar.py:27:10: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_tradingcalendar.py:50:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_tradingcalendar.py:51:24: E1101: Module 'backtrader.strategies' has no 'NullStrategy' member (no-member) +tests/test_tradingcalendar.py:62:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_tradingcalendar.py:65:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_tradingcalendar.py:68:41: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_tradingcalendar.py:37:4: W0613: Unused argument 'open_minute' (unused-argument) +tests/test_tradingcalendar.py:73:0: C0112: Empty function docstring (empty-docstring) +tests/test_tradingcalendar.py:122:25: W0613: Unused argument 'main' (unused-argument) +tests/test_tradingcalendar.py:150:17: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_tradingcalendar.py:157:0: C0112: Empty function docstring (empty-docstring) +tests/test_tradingcalendar.py:159:17: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_tradingcalendar.py:186:17: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_tradingcalendar.py:13:0: C0411: third party import "pytest" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_tradingcalendar.py:14:0: C0411: third party import "pytz" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_tradingcalendar.py:15:0: C0411: third party import "testcommon.getdatadir" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_tradingcalendar.py:16:0: C0411: third party import "util_asserts.assert_data" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_analyzer-sqn +tests/test_analyzer-sqn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_analyzer-sqn.py:1:0: C0103: Module name "test_analyzer-sqn" doesn't conform to snake_case naming style (invalid-name) +tests/test_analyzer-sqn.py:32:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_analyzer-sqn.py:33:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_analyzer-sqn.py:35:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-sqn.py:36:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_analyzer-sqn.py:36:0: C0413: Import "import backtrader.indicators as btind" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-sqn.py:36:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_analyzer-sqn.py:37:0: C0413: Import "import testcommon" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-sqn.py:40:0: C0112: Empty class docstring (empty-docstring) +tests/test_analyzer-sqn.py:40:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes) +tests/test_analyzer-sqn.py:40:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_analyzer-sqn.py:61:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_analyzer-sqn.py:62:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:64:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:81:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_analyzer-sqn.py:81:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_analyzer-sqn.py:85:33: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_analyzer-sqn.py:87:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:89:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:93:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:96:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:101:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:114:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-sqn.py:122:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:128:25: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-sqn.py:129:26: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-sqn.py:130:23: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-sqn.py:131:24: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-sqn.py:134:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-sqn.py:138:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:139:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:140:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:145:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-sqn.py:149:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:158:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:168:33: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:171:31: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:176:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:179:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-sqn.py:132:8: W0201: Attribute 'tradecount' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:126:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:128:8: W0201: Attribute 'buycreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:129:8: W0201: Attribute 'sellcreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:130:8: W0201: Attribute 'buyexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:131:8: W0201: Attribute 'sellexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-sqn.py:183:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_analyzer-sqn.py:203:22: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +tests/test_analyzer-sqn.py:214:19: R1714: Consider merging these comparisons with 'in' by using 'maxtrades in (0, 1)'. Use a set instead if elements are hashable. (consider-using-in) +tests/test_analyzer-sqn.py:37:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_analyzer-timereturn +tests/test_analyzer-timereturn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_analyzer-timereturn.py:1:0: C0103: Module name "test_analyzer-timereturn" doesn't conform to snake_case naming style (invalid-name) +tests/test_analyzer-timereturn.py:32:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_analyzer-timereturn.py:33:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_analyzer-timereturn.py:35:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-timereturn.py:36:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_analyzer-timereturn.py:36:0: C0413: Import "import backtrader.indicators as btind" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-timereturn.py:36:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_analyzer-timereturn.py:37:0: C0413: Import "import testcommon" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-timereturn.py:38:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +tests/test_analyzer-timereturn.py:38:0: C0413: Import "from backtrader.utils.py3 import PY2" should be placed at the top of the module (wrong-import-position) +tests/test_analyzer-timereturn.py:38:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +tests/test_analyzer-timereturn.py:41:0: C0112: Empty class docstring (empty-docstring) +tests/test_analyzer-timereturn.py:41:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +tests/test_analyzer-timereturn.py:41:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_analyzer-timereturn.py:61:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_analyzer-timereturn.py:62:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:64:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:72:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_analyzer-timereturn.py:72:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_analyzer-timereturn.py:76:33: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_analyzer-timereturn.py:78:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:80:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:84:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:87:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:92:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:105:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-timereturn.py:113:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:119:25: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-timereturn.py:120:26: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-timereturn.py:121:23: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-timereturn.py:122:24: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_analyzer-timereturn.py:124:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-timereturn.py:128:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:129:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:130:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:135:4: C0112: Empty method docstring (empty-docstring) +tests/test_analyzer-timereturn.py:139:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:148:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:157:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:160:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:165:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:168:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_analyzer-timereturn.py:117:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-timereturn.py:119:8: W0201: Attribute 'buycreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-timereturn.py:120:8: W0201: Attribute 'sellcreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-timereturn.py:121:8: W0201: Attribute 'buyexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-timereturn.py:122:8: W0201: Attribute 'sellexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_analyzer-timereturn.py:172:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_analyzer-timereturn.py:189:18: E1101: Module 'backtrader' has no 'analyzers' member (no-member) +tests/test_analyzer-timereturn.py:189:43: R1735: Consider using '{"timeframe": bt.TimeFrame.Years}' instead of a call to 'dict'. (use-dict-literal) +tests/test_analyzer-timereturn.py:189:58: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_analyzer-timereturn.py:37:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_order +tests/test_order.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_order.py:29:0: E0611: No name 'Position' in module 'backtrader' (no-name-in-module) +tests/test_order.py:32:0: C0112: Empty class docstring (empty-docstring) +tests/test_order.py:32:0: R0205: Class 'FakeCommInfo' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +tests/test_order.py:35:27: W0613: Unused argument 'size' (unused-argument) +tests/test_order.py:35:33: W0613: Unused argument 'price' (unused-argument) +tests/test_order.py:44:28: W0613: Unused argument 'size' (unused-argument) +tests/test_order.py:44:34: W0613: Unused argument 'price' (unused-argument) +tests/test_order.py:44:41: W0613: Unused argument 'newprice' (unused-argument) +tests/test_order.py:54:31: W0613: Unused argument 'size' (unused-argument) +tests/test_order.py:54:37: W0613: Unused argument 'price' (unused-argument) +tests/test_order.py:63:28: W0613: Unused argument 'size' (unused-argument) +tests/test_order.py:63:34: W0613: Unused argument 'price' (unused-argument) +tests/test_order.py:73:0: R0205: Class 'FakeData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +tests/test_order.py:85:4: C0112: Empty method docstring (empty-docstring) +tests/test_order.py:90:4: C0112: Empty method docstring (empty-docstring) +tests/test_order.py:95:0: R0914: Too many local variables (17/15) (too-many-locals) +tests/test_order.py:149:12: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_order.py:153:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_order.py:141:13: W0613: Unused argument 'main' (unused-argument) +************* Module backtrader.tests.test_strategy_unoptimized +tests/test_strategy_unoptimized.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_strategy_unoptimized.py:32:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_strategy_unoptimized.py:33:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_strategy_unoptimized.py:35:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_unoptimized.py:36:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_strategy_unoptimized.py:36:0: C0413: Import "import backtrader.indicators as btind" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_unoptimized.py:36:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_strategy_unoptimized.py:37:0: C0413: Import "import testcommon" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_unoptimized.py:98:0: C0112: Empty class docstring (empty-docstring) +tests/test_strategy_unoptimized.py:98:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +tests/test_strategy_unoptimized.py:98:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_strategy_unoptimized.py:118:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_strategy_unoptimized.py:119:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:121:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:129:28: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_strategy_unoptimized.py:129:48: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_strategy_unoptimized.py:133:33: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_strategy_unoptimized.py:135:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:137:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:141:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:144:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:149:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:162:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_unoptimized.py:170:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:176:25: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_unoptimized.py:177:26: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_unoptimized.py:178:23: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_unoptimized.py:179:24: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_unoptimized.py:181:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_unoptimized.py:185:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:186:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:187:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:201:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:202:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:204:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:205:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:212:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_unoptimized.py:216:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:225:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:234:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:237:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:242:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:245:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_unoptimized.py:174:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_unoptimized.py:176:8: W0201: Attribute 'buycreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_unoptimized.py:177:8: W0201: Attribute 'sellcreate' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_unoptimized.py:178:8: W0201: Attribute 'buyexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_unoptimized.py:179:8: W0201: Attribute 'sellexec' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_unoptimized.py:249:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_strategy_unoptimized.py:37:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_trade +tests/test_trade.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_trade.py:29:0: E0611: No name 'trade' in module 'backtrader' (no-name-in-module) +tests/test_trade.py:32:0: C0112: Empty class docstring (empty-docstring) +tests/test_trade.py:32:0: R0205: Class 'FakeCommInfo' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +tests/test_trade.py:35:27: W0613: Unused argument 'size' (unused-argument) +tests/test_trade.py:35:33: W0613: Unused argument 'price' (unused-argument) +tests/test_trade.py:44:28: W0613: Unused argument 'size' (unused-argument) +tests/test_trade.py:44:34: W0613: Unused argument 'price' (unused-argument) +tests/test_trade.py:44:41: W0613: Unused argument 'newprice' (unused-argument) +tests/test_trade.py:55:0: R0205: Class 'FakeData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +tests/test_trade.py:67:4: C0112: Empty method docstring (empty-docstring) +tests/test_trade.py:72:4: C0112: Empty method docstring (empty-docstring) +tests/test_trade.py:85:12: E1101: Module 'backtrader' has no 'BuyOrder' member (no-member) +tests/test_trade.py:89:17: E1101: Module 'backtrader' has no 'Order' member (no-member) +tests/test_trade.py:77:13: W0613: Unused argument 'main' (unused-argument) +************* Module backtrader.tests.testcommon +tests/testcommon.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/testcommon.py:34:0: E0401: Unable to import 'backtrader.utils.flushfile' (import-error) +tests/testcommon.py:34:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +tests/testcommon.py:35:0: E0401: Unable to import 'backtrader.metabase' (import-error) +tests/testcommon.py:35:0: E0611: No name 'metabase' in module 'backtrader' (no-name-in-module) +tests/testcommon.py:41:0: C0103: Constant name "dataspath" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/testcommon.py:47:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/testcommon.py:77:0: R0913: Too many arguments (10/5) (too-many-arguments) +tests/testcommon.py:77:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +tests/testcommon.py:77:0: R0914: Too many local variables (23/15) (too-many-locals) +tests/testcommon.py:110:15: R1734: Consider using [] instead of list() (use-list-literal) +tests/testcommon.py:113:16: R1704: Redefining argument with the local name 'exbar' (redefined-argument-from-local) +tests/testcommon.py:114:26: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/testcommon.py:122:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:124:37: E1101: Module 'backtrader' has no 'LineSeries' member (no-member) +tests/testcommon.py:154:0: C0112: Empty class docstring (empty-docstring) +tests/testcommon.py:154:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/testcommon.py:157:13: R1735: Consider using '{"main": False, "chkind": [], "inddata": [], "chkmin": 1, "chknext": 0, ... }' instead of a call to 'dict'. (use-dict-literal) +tests/testcommon.py:164:16: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/testcommon.py:190:4: C0112: Empty method docstring (empty-docstring) +tests/testcommon.py:193:4: C0112: Empty method docstring (empty-docstring) +tests/testcommon.py:196:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +tests/testcommon.py:198:4: C0112: Empty method docstring (empty-docstring) +tests/testcommon.py:204:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:214:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:216:4: C0112: Empty method docstring (empty-docstring) +tests/testcommon.py:220:4: C0112: Empty method docstring (empty-docstring) +tests/testcommon.py:228:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:229:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:230:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:235:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:238:26: R1734: Consider using [] instead of list() (use-list-literal) +tests/testcommon.py:241:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:242:30: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:264:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/testcommon.py:220:4: R0912: Too many branches (13/12) (too-many-branches) +tests/testcommon.py:195:8: W0201: Attribute 'chkmin' defined outside __init__ (attribute-defined-outside-init) +tests/testcommon.py:218:8: W0201: Attribute 'nextcalls' defined outside __init__ (attribute-defined-outside-init) +tests/testcommon.py:286:21: E0602: Undefined variable 'factorial' (undefined-variable) +tests/testcommon.py:274:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/testcommon.py:34:0: W0611: Unused import backtrader.utils.flushfile (unused-import) +************* Module backtrader.tests.test_metaclass +tests/test_metaclass.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_metaclass.py:32:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation) +tests/test_metaclass.py:34:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +tests/test_metaclass.py:24:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/test_metaclass.py:38:13: W0613: Unused argument 'main' (unused-argument) +************* Module backtrader.tests.test_comminfo +tests/test_comminfo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_comminfo.py:29:0: E0611: No name 'Position' in module 'backtrader' (no-name-in-module) +tests/test_comminfo.py:32:0: C0112: Empty function docstring (empty-docstring) +tests/test_comminfo.py:35:11: E1101: Module 'backtrader' has no 'CommissionInfo' member (no-member) +tests/test_comminfo.py:58:0: C0112: Empty function docstring (empty-docstring) +tests/test_comminfo.py:63:11: E1101: Module 'backtrader' has no 'CommissionInfo' member (no-member) +tests/test_comminfo.py:86:13: W0613: Unused argument 'main' (unused-argument) +************* Module backtrader.tests.test_data_multiframe +tests/test_data_multiframe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_data_multiframe.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_data_multiframe.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_data_multiframe.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_multiframe.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_multiframe.py:36:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/test_data_multiframe.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_data_replay +tests/test_data_replay.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_data_replay.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_data_replay.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_data_replay.py:32:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_replay.py:33:0: C0103: Constant name "chknext" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_replay.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_replay.py:38:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/test_data_replay.py:41:25: W0621: Redefining name 'exbar' from outer scope (line 68) (redefined-outer-name) +tests/test_data_replay.py:49:26: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_data_replay.py:30:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_data_resample +tests/test_data_resample.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_data_resample.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_data_resample.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_data_resample.py:32:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_resample.py:35:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_resample.py:37:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/test_data_resample.py:48:32: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_data_resample.py:30:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_accdecosc +tests/test_ind_accdecosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_accdecosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_accdecosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_accdecosc.py:35:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_accdecosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_aroonoscillator +tests/test_ind_aroonoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_aroonoscillator.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_aroonoscillator.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_aroonoscillator.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_aroonoscillator.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_aroonoscillator.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_aroonupdown +tests/test_ind_aroonupdown.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_aroonupdown.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_aroonupdown.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_aroonupdown.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_aroonupdown.py:37:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_aroonupdown.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_atr +tests/test_ind_atr.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_atr.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_atr.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_atr.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_atr.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_atr.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_awesomeoscillator +tests/test_ind_awesomeoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_awesomeoscillator.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_awesomeoscillator.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_awesomeoscillator.py:35:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_awesomeoscillator.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_bbands +tests/test_ind_bbands.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_bbands.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_bbands.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_bbands.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_bbands.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_bbands.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_cci +tests/test_ind_cci.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_cci.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_cci.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_cci.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_cci.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_cci.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_dema +tests/test_ind_dema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_dema.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_dema.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_dema.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dema.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dema.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_demaenvelope +tests/test_ind_demaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_demaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_demaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_demaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_demaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_demaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_demaosc +tests/test_ind_demaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_demaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_demaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_demaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_demaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_demaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_dm +tests/test_ind_dm.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_dm.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_dm.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_dm.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dm.py:39:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dm.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_dma +tests/test_ind_dma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_dma.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_dma.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_dma.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dma.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dma.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_downmove +tests/test_ind_downmove.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_downmove.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_downmove.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_downmove.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_downmove.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_downmove.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_dpo +tests/test_ind_dpo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_dpo.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_dpo.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_dpo.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dpo.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dpo.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_dv2 +tests/test_ind_dv2.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_dv2.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_dv2.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_dv2.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dv2.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_dv2.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_ema +tests/test_ind_ema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_ema.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_ema.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_ema.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ema.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ema.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_emaenvelope +tests/test_ind_emaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_emaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_emaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_emaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_emaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_emaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_emaosc +tests/test_ind_emaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_emaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_emaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_emaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_emaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_emaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_envelope +tests/test_ind_envelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_envelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_envelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_envelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_envelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_envelope.py:42:0: C0112: Empty class docstring (empty-docstring) +tests/test_ind_envelope.py:49:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +tests/test_ind_envelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_heikinashi +tests/test_ind_heikinashi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_heikinashi.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_heikinashi.py:39:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_heikinashi.py:40:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_heikinashi.py:49:7: W0125: Using a conditional statement with a constant value (using-constant-test) +tests/test_ind_heikinashi.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_highest +tests/test_ind_highest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_highest.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_highest.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_highest.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_highest.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_highest.py:38:10: R1735: Consider using '{"period": 14}' instead of a call to 'dict'. (use-dict-literal) +tests/test_ind_highest.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_hma +tests/test_ind_hma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_hma.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_hma.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_hma.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_hma.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_hma.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_ichimoku +tests/test_ind_ichimoku.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_ichimoku.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ichimoku.py:40:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ichimoku.py:41:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_ichimoku.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_kama +tests/test_ind_kama.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_kama.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_kama.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_kama.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kama.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kama.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_kamaenvelope +tests/test_ind_kamaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_kamaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_kamaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_kamaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kamaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kamaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_kamaosc +tests/test_ind_kamaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_kamaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_kamaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_kamaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kamaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kamaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_kst +tests/test_ind_kst.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_kst.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kst.py:37:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_kst.py:38:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_kst.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_lowest +tests/test_ind_lowest.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_lowest.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_lowest.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_lowest.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_lowest.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_lowest.py:38:10: R1735: Consider using '{"period": 14}' instead of a call to 'dict'. (use-dict-literal) +tests/test_ind_lowest.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_lrsi +tests/test_ind_lrsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_lrsi.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_lrsi.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_lrsi.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_lrsi.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_lrsi.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_macdhisto +tests/test_ind_macdhisto.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_macdhisto.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_macdhisto.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_macdhisto.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_macdhisto.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_macdhisto.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_minperiod +tests/test_ind_minperiod.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_minperiod.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_minperiod.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_minperiod.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_minperiod.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_minperiod.py:36:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/test_ind_minperiod.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_momentum +tests/test_ind_momentum.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_momentum.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_momentum.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_momentum.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_momentum.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_momentum.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_momentumoscillator +tests/test_ind_momentumoscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_momentumoscillator.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_momentumoscillator.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_momentumoscillator.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_momentumoscillator.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_momentumoscillator.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_oscillator +tests/test_ind_oscillator.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_oscillator.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_oscillator.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_oscillator.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_oscillator.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_oscillator.py:38:0: C0112: Empty class docstring (empty-docstring) +tests/test_ind_oscillator.py:45:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +tests/test_ind_oscillator.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_pctchange +tests/test_ind_pctchange.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_pctchange.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_pctchange.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_pctchange.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pctchange.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pctchange.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_pctrank +tests/test_ind_pctrank.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_pctrank.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_pctrank.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_pctrank.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pctrank.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pctrank.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_pgo +tests/test_ind_pgo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_pgo.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_pgo.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_pgo.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pgo.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pgo.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_ppo +tests/test_ind_ppo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_ppo.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_ppo.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_ppo.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ppo.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ppo.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_pposhort +tests/test_ind_pposhort.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_pposhort.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_pposhort.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_pposhort.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pposhort.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_pposhort.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_priceosc +tests/test_ind_priceosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_priceosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_priceosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_priceosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_priceosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_priceosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_rmi +tests/test_ind_rmi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_rmi.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rmi.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rmi.py:35:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_rmi.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_roc +tests/test_ind_roc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_roc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_roc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_roc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_roc.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_roc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_rsi +tests/test_ind_rsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_rsi.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_rsi.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_rsi.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rsi.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rsi.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_rsi_safe +tests/test_ind_rsi_safe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_rsi_safe.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_rsi_safe.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_rsi_safe.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rsi_safe.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_rsi_safe.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_sma +tests/test_ind_sma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_sma.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_sma.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_sma.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_sma.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_sma.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_smaenvelope +tests/test_ind_smaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_smaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_smaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_smaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_smaosc +tests/test_ind_smaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_smaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_smaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_smaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_smma +tests/test_ind_smma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_smma.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_smma.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_smma.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smma.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smma.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_smmaenvelope +tests/test_ind_smmaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_smmaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_smmaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_smmaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smmaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smmaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_smmaosc +tests/test_ind_smmaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_smmaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_smmaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_smmaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smmaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_smmaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_stochastic +tests/test_ind_stochastic.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_stochastic.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_stochastic.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_stochastic.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_stochastic.py:37:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_stochastic.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_stochasticfull +tests/test_ind_stochasticfull.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_stochasticfull.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_stochasticfull.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_stochasticfull.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_stochasticfull.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_stochasticfull.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_sumn +tests/test_ind_sumn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_sumn.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_sumn.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_sumn.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_sumn.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_sumn.py:38:10: R1735: Consider using '{"period": 14}' instead of a call to 'dict'. (use-dict-literal) +tests/test_ind_sumn.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_tema +tests/test_ind_tema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_tema.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_tema.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_tema.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_tema.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_tema.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_temaenvelope +tests/test_ind_temaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_temaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_temaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_temaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_temaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_temaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_temaosc +tests/test_ind_temaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_temaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_temaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_temaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_temaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_temaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_trix +tests/test_ind_trix.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_trix.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_trix.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_trix.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_trix.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_trix.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_tsi +tests/test_ind_tsi.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_tsi.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_tsi.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_tsi.py:35:9: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_ind_tsi.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_ultosc +tests/test_ind_ultosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_ultosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ultosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_ultosc.py:35:9: E1101: Module 'backtrader' has no 'indicators' member (no-member) +tests/test_ind_ultosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_ind_upmove +tests/test_ind_upmove.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_upmove.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_upmove.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_upmove.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_upmove.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_upmove.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_vortex +tests/test_ind_vortex.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_vortex.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_vortex.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_vortex.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_vortex.py:37:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_vortex.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_williamsad +tests/test_ind_williamsad.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_williamsad.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_williamsad.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_williamsad.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_williamsad.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_williamsad.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_williamsr +tests/test_ind_williamsr.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_williamsr.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_williamsr.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_williamsr.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_williamsr.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_williamsr.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_wma +tests/test_ind_wma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_wma.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_wma.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_wma.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wma.py:36:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wma.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_wmaenvelope +tests/test_ind_wmaenvelope.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_wmaenvelope.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_wmaenvelope.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_wmaenvelope.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wmaenvelope.py:38:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wmaenvelope.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_wmaosc +tests/test_ind_wmaosc.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_wmaosc.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_wmaosc.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_wmaosc.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wmaosc.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_wmaosc.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_zlema +tests/test_ind_zlema.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_zlema.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_zlema.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_zlema.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_zlema.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_zlema.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_ind_zlind +tests/test_ind_zlind.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_ind_zlind.py:28:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_ind_zlind.py:28:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_ind_zlind.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_zlind.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_ind_zlind.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_position +tests/test_position.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_position.py:28:0: E0611: No name 'position' in module 'backtrader' (no-name-in-module) +************* Module backtrader.tests.test_study_fractal +tests/test_study_fractal.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_study_fractal.py:31:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_study_fractal.py:34:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_study_fractal.py:35:9: E1101: Module 'backtrader' has no 'studies' member (no-member) +tests/test_study_fractal.py:29:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_writer +tests/test_writer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_writer.py:29:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_writer.py:29:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_writer.py:32:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_writer.py:35:0: C0112: Empty class docstring (empty-docstring) +tests/test_writer.py:35:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_writer.py:38:13: R1735: Consider using '{"main": False}' instead of a call to 'dict'. (use-dict-literal) +tests/test_writer.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/test_writer.py:57:16: E1101: Module 'backtrader' has no 'WriterStringIO' member (no-member) +tests/test_writer.py:57:35: R1735: Consider using '{"csv": True}' instead of a call to 'dict'. (use-dict-literal) +tests/test_writer.py:30:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.util_asserts +tests/util_asserts.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/util_asserts.py:4:0: R0913: Too many arguments (7/5) (too-many-arguments) +tests/util_asserts.py:4:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +tests/util_asserts.py:4:38: W0622: Redefining built-in 'open' (redefined-builtin) +tests/util_asserts.py:24:11: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/util_asserts.py:4:38: W0613: Unused argument 'open' (unused-argument) +tests/util_asserts.py:4:49: W0613: Unused argument 'high' (unused-argument) +tests/util_asserts.py:4:60: W0613: Unused argument 'low' (unused-argument) +tests/util_asserts.py:4:70: W0613: Unused argument 'close' (unused-argument) +************* Module backtrader.tests.test_data_pandas +tests/test_data_pandas.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_data_pandas.py:31:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_data_pandas.py:31:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_data_pandas.py:34:0: E0611: No name 'feeds' in module 'backtrader' (no-name-in-module) +tests/test_data_pandas.py:36:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_pandas.py:39:0: C0103: Constant name "chkmin" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_pandas.py:41:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tests/test_data_pandas.py:44:0: C0103: Constant name "dataspath" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_data_pandas.py:54:0: C0112: Empty class docstring (empty-docstring) +tests/test_data_pandas.py:54:0: R0903: Too few public methods (0/2) (too-few-public-methods) +tests/test_data_pandas.py:32:0: C0411: third party import "pandas" should be placed before first party import "backtrader.indicators" (wrong-import-order) +tests/test_data_pandas.py:33:0: C0411: third party import "testcommon" should be placed before first party import "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_data_resample_optimize +tests/test_data_resample_optimize.py:34:0: C0301: Line too long (150/100) (line-too-long) +tests/test_data_resample_optimize.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_data_resample_optimize.py:6:0: C0112: Empty class docstring (empty-docstring) +tests/test_data_resample_optimize.py:6:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_data_resample_optimize.py:23:13: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_data_resample_optimize.py:24:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_data_resample_optimize.py:29:4: C0112: Empty method docstring (empty-docstring) +tests/test_data_resample_optimize.py:42:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_data_resample_optimize.py:44:41: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_data_resample_optimize.py:33:19: W0613: Unused argument 'main' (unused-argument) +tests/test_data_resample_optimize.py:2:0: C0411: third party import "pytest" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_data_resample_optimize.py:3:0: C0411: third party import "testcommon" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tests.test_math_function_scalar +tests/test_math_function_scalar.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_math_function_scalar.py:32:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_math_function_scalar.py:33:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_math_function_scalar.py:35:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_math_function_scalar.py:38:0: C0112: Empty class docstring (empty-docstring) +tests/test_math_function_scalar.py:38:0: R0902: Too many instance attributes (8/7) (too-many-instance-attributes) +tests/test_math_function_scalar.py:38:23: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +tests/test_math_function_scalar.py:56:17: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_math_function_scalar.py:57:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_math_function_scalar.py:59:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_math_function_scalar.py:63:18: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_math_function_scalar.py:64:21: E1101: Module 'backtrader' has no 'ind' member (no-member) +tests/test_math_function_scalar.py:66:18: E1101: Module 'backtrader' has no 'Log' member (no-member) +tests/test_math_function_scalar.py:67:18: E1101: Module 'backtrader' has no 'Ceiling' member (no-member) +tests/test_math_function_scalar.py:68:18: E1101: Module 'backtrader' has no 'Floor' member (no-member) +tests/test_math_function_scalar.py:69:25: E1101: Module 'backtrader' has no 'Abs' member (no-member) +tests/test_math_function_scalar.py:72:18: E1101: Module 'backtrader' has no 'Max' member (no-member) +tests/test_math_function_scalar.py:74:4: C0112: Empty method docstring (empty-docstring) +tests/test_math_function_scalar.py:83:4: C0112: Empty method docstring (empty-docstring) +tests/test_math_function_scalar.py:87:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_math_function_scalar.py:92:4: C0112: Empty method docstring (empty-docstring) +tests/test_math_function_scalar.py:96:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_math_function_scalar.py:81:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_math_function_scalar.py:129:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_math_function_scalar.py:132:23: R1735: Consider using '{"printdata": True, "printops": True}' instead of a call to 'dict'. (use-dict-literal) +tests/test_math_function_scalar.py:134:23: R1735: Consider using '{"printdata": False, "printops": False}' instead of a call to 'dict'. (use-dict-literal) +tests/test_math_function_scalar.py:142:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_math_function_scalar.py:145:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +************* Module backtrader.tests.test_strategy_optimized +tests/test_strategy_optimized.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_strategy_optimized.py:39:0: W0622: Redefining built-in 'range' (redefined-builtin) +tests/test_strategy_optimized.py:33:7: W0718: Catching too general exception BaseException (broad-exception-caught) +tests/test_strategy_optimized.py:34:17: E1101: Module 'time' has no 'clock' member (no-member) +tests/test_strategy_optimized.py:36:0: C0413: Import "import backtrader as bt" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_optimized.py:37:0: E0401: Unable to import 'backtrader.indicators' (import-error) +tests/test_strategy_optimized.py:37:0: C0413: Import "import backtrader.indicators as btind" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_optimized.py:37:0: E0611: No name 'indicators' in module 'backtrader' (no-name-in-module) +tests/test_strategy_optimized.py:38:0: C0413: Import "import testcommon" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_optimized.py:39:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +tests/test_strategy_optimized.py:39:0: C0413: Import "from backtrader.utils.py3 import range" should be placed at the top of the module (wrong-import-position) +tests/test_strategy_optimized.py:39:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +tests/test_strategy_optimized.py:131:0: C0112: Empty class docstring (empty-docstring) +tests/test_strategy_optimized.py:131:21: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_strategy_optimized.py:148:13: E1101: Module 'backtrader' has no 'num2date' member (no-member) +tests/test_strategy_optimized.py:149:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_optimized.py:159:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_optimized.py:165:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_optimized.py:167:8: W0602: Using global for '_chkvalues' but no assignment is done (global-variable-not-assigned) +tests/test_strategy_optimized.py:168:8: W0602: Using global for '_chkcash' but no assignment is done (global-variable-not-assigned) +tests/test_strategy_optimized.py:173:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_optimized.py:182:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_optimized.py:185:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tests/test_strategy_optimized.py:188:4: C0112: Empty method docstring (empty-docstring) +tests/test_strategy_optimized.py:162:8: W0201: Attribute 'tstart' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_optimized.py:163:8: W0201: Attribute 'buy_create_idx' defined outside __init__ (attribute-defined-outside-init) +tests/test_strategy_optimized.py:203:0: C0103: Constant name "chkdatas" doesn't conform to UPPER_CASE naming style (invalid-name) +tests/test_strategy_optimized.py:212:4: W0603: Using the global statement (global-statement) +tests/test_strategy_optimized.py:213:4: W0603: Using the global statement (global-statement) +tests/test_strategy_optimized.py:218:29: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_optimized.py:219:27: R1734: Consider using [] instead of list() (use-list-literal) +tests/test_strategy_optimized.py:38:0: C0411: third party import "testcommon" should be placed before first party imports "backtrader", "backtrader.indicators" (wrong-import-order) +************* Module backtrader.tests.test_resampler +tests/test_resampler.py:201:0: C0301: Line too long (149/100) (line-too-long) +tests/test_resampler.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tests/test_resampler.py:12:0: E0401: Unable to import 'freezegun' (import-error) +tests/test_resampler.py:18:0: R0913: Too many arguments (14/5) (too-many-arguments) +tests/test_resampler.py:18:0: R0917: Too many positional arguments (14/5) (too-many-positional-arguments) +tests/test_resampler.py:18:0: R0914: Too many local variables (17/15) (too-many-locals) +tests/test_resampler.py:33:5: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tests/test_resampler.py:57:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tests/test_resampler.py:58:24: E1101: Module 'backtrader.strategies' has no 'NullStrategy' member (no-member) +tests/test_resampler.py:61:15: E1101: Module 'backtrader' has no 'TradingCalendar' member (no-member) +tests/test_resampler.py:67:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tests/test_resampler.py:89:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:91:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:113:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:116:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:118:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:165:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:168:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:170:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:203:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:205:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:229:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:232:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:234:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:265:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:268:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:270:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:301:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:304:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:306:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:335:11: W0212: Access to a protected member _nexteos of a client class (protected-access) +tests/test_resampler.py:335:11: W0212: Access to a protected member _filters of a client class (protected-access) +tests/test_resampler.py:339:0: C0112: Empty function docstring (empty-docstring) +tests/test_resampler.py:342:8: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:344:27: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tests/test_resampler.py:373:11: W0212: Access to a protected member _nexteos of a client class (protected-access) +tests/test_resampler.py:373:11: W0212: Access to a protected member _filters of a client class (protected-access) +tests/test_resampler.py:12:0: C0411: third party import "freezegun.freeze_time" should be placed before first party import "backtrader" (wrong-import-order) +tests/test_resampler.py:13:0: C0411: third party import "util_asserts.assert_data" should be placed before first party import "backtrader" (wrong-import-order) +************* Module backtrader.tools.bt-run +tools/bt-run.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tools/bt-run.py:1:0: C0103: Module name "bt-run" doesn't conform to snake_case naming style (invalid-name) +tools/bt-run.py:24:0: R0402: Use 'from backtrader import btrun' instead (consider-using-from-import) +tools/bt-run.py:24:0: E0401: Unable to import 'backtrader.btrun' (import-error) +tools/bt-run.py:24:0: E0611: No name 'btrun' in module 'backtrader' (no-name-in-module) +************* Module backtrader.tools.yahoodownload +tools/yahoodownload.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tools/yahoodownload.py:44:0: C0112: Empty class docstring (empty-docstring) +tools/yahoodownload.py:44:0: R0205: Class 'YahooDownload' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +tools/yahoodownload.py:51:4: R0913: Too many arguments (6/5) (too-many-arguments) +tools/yahoodownload.py:51:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +tools/yahoodownload.py:51:4: R0914: Too many local variables (25/15) (too-many-locals) +tools/yahoodownload.py:51:31: W0621: Redefining name 'fromdate' from outer scope (line 216) (redefined-outer-name) +tools/yahoodownload.py:51:41: W0621: Redefining name 'todate' from outer scope (line 224) (redefined-outer-name) +tools/yahoodownload.py:51:61: W0621: Redefining name 'reverse' from outer scope (line 231) (redefined-outer-name) +tools/yahoodownload.py:62:12: C0415: Import outside toplevel (requests) (import-outside-toplevel) +tools/yahoodownload.py:69:12: W0707: Consider explicitly re-raising using 'except ImportError as exc' and 'raise Exception(msg) from exc' (raise-missing-from) +tools/yahoodownload.py:69:12: W0719: Raising too general exception: Exception (broad-exception-raised) +tools/yahoodownload.py:73:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tools/yahoodownload.py:74:11: R1727: Boolean condition 'False and self.p.proxies' will always evaluate to 'False' (condition-evals-to-constant) +tools/yahoodownload.py:74:21: E1101: Instance of 'YahooDownload' has no 'p' member; maybe 'f'? (no-member) +tools/yahoodownload.py:75:36: E1101: Instance of 'YahooDownload' has no 'p' member; maybe 'f'? (no-member) +tools/yahoodownload.py:81:35: E1101: Instance of 'LookupDict' has no 'ok' member (no-member) +tools/yahoodownload.py:111:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:117:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:121:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:129:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:131:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:133:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:137:35: E1101: Instance of 'LookupDict' has no 'ok' member (no-member) +tools/yahoodownload.py:142:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/yahoodownload.py:149:19: W0718: Catching too general exception Exception (broad-exception-caught) +tools/yahoodownload.py:51:4: R0912: Too many branches (15/12) (too-many-branches) +tools/yahoodownload.py:51:4: R0915: Too many statements (63/50) (too-many-statements) +tools/yahoodownload.py:51:61: W0613: Unused argument 'reverse' (unused-argument) +tools/yahoodownload.py:167:16: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +tools/yahoodownload.py:167:16: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +tools/yahoodownload.py:44:0: R0903: Too few public methods (1/2) (too-few-public-methods) +tools/yahoodownload.py:178:0: C0112: Empty function docstring (empty-docstring) +tools/yahoodownload.py:217:11: W0718: Catching too general exception Exception (broad-exception-caught) +tools/yahoodownload.py:225:11: W0718: Catching too general exception Exception (broad-exception-caught) +tools/yahoodownload.py:243:11: W0718: Catching too general exception Exception (broad-exception-caught) +tools/yahoodownload.py:250:16: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +tools/yahoodownload.py:259:11: W0718: Catching too general exception Exception (broad-exception-caught) +tools/yahoodownload.py:250:16: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +************* Module backtrader.tools.rewrite-data +tools/rewrite-data.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tools/rewrite-data.py:1:0: C0103: Module name "rewrite-data" doesn't conform to snake_case naming style (invalid-name) +tools/rewrite-data.py:33:0: W0622: Redefining built-in 'bytes' (redefined-builtin) +tools/rewrite-data.py:33:0: E0401: Unable to import 'backtrader.utils.py3' (import-error) +tools/rewrite-data.py:33:0: E0611: No name 'utils' in module 'backtrader' (no-name-in-module) +tools/rewrite-data.py:35:14: R1735: Consider using '{"btcsv": bt.feeds.BacktraderCSVData, "vchartcsv": bt.feeds.VChartCSVData, ... }' instead of a call to 'dict'. (use-dict-literal) +tools/rewrite-data.py:36:10: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:37:14: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:38:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:39:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:40:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:41:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:42:14: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:43:11: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:44:13: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:45:24: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:46:10: E1101: Module 'backtrader' has no 'feeds' member (no-member) +tools/rewrite-data.py:50:0: C0112: Empty class docstring (empty-docstring) +tools/rewrite-data.py:50:22: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +tools/rewrite-data.py:58:4: C0112: Empty method docstring (empty-docstring) +tools/rewrite-data.py:65:11: W0212: Access to a protected member _timeframe of a client class (protected-access) +tools/rewrite-data.py:65:34: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tools/rewrite-data.py:63:21: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +tools/rewrite-data.py:73:4: C0112: Empty method docstring (empty-docstring) +tools/rewrite-data.py:75:17: R1734: Consider using [] instead of list() (use-list-literal) +tools/rewrite-data.py:78:11: W0212: Access to a protected member _timeframe of a client class (protected-access) +tools/rewrite-data.py:78:34: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +tools/rewrite-data.py:82:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:84:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:86:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:88:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:90:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:92:13: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +tools/rewrite-data.py:61:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +tools/rewrite-data.py:63:12: W0201: Attribute 'f' defined outside __init__ (attribute-defined-outside-init) +tools/rewrite-data.py:108:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +tools/rewrite-data.py:110:15: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +tools/rewrite-data.py:140:18: R1735: Consider using '{"style": 'bar'}' instead of a call to 'dict'. (use-dict-literal) +tools/rewrite-data.py:142:23: W0123: Use of eval (eval-used) +************* Module backtrader.tools.dump-ticker +tools/dump-ticker.py:1:0: C0114: Missing module docstring (missing-module-docstring) +tools/dump-ticker.py:1:0: C0103: Module name "dump-ticker" doesn't conform to snake_case naming style (invalid-name) +tools/dump-ticker.py:73:11: W0718: Catching too general exception Exception (broad-exception-caught) +************* Module backtrader.turtle.a300 +turtle/a300.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/a300.py:2:0: E0401: Unable to import 'baostock' (import-error) +************* Module backtrader.turtle.bs +turtle/bs.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/bs.py:1:0: E0401: Unable to import 'baostock' (import-error) +************* Module backtrader.turtle.z500 +turtle/z500.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/z500.py:1:0: E0401: Unable to import 'baostock' (import-error) +************* Module backtrader.turtle.baostock_wrapper +turtle/baostock_wrapper.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/baostock_wrapper.py:1:0: E0401: Unable to import 'baostock' (import-error) +turtle/baostock_wrapper.py:5:0: C0112: Empty class docstring (empty-docstring) +turtle/baostock_wrapper.py:43:12: W0719: Raising too general exception: Exception (broad-exception-raised) +************* Module backtrader.turtle.csv_viewer +turtle/csv_viewer.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/csv_viewer.py:2:0: E0401: Unable to import 'streamlit' (import-error) +turtle/csv_viewer.py:5:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.turtle.main +turtle/main.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/main.py:10:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.turtle.sma +turtle/sma.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/sma.py:3:0: C0103: Constant name "debug" doesn't conform to UPPER_CASE naming style (invalid-name) +turtle/sma.py:4:0: C0103: Constant name "win_prob" doesn't conform to UPPER_CASE naming style (invalid-name) +turtle/sma.py:7:0: C0112: Empty class docstring (empty-docstring) +turtle/sma.py:7:15: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +turtle/sma.py:10:13: R1735: Consider using '{"sma1": 5, "sma2": 10, "hold_days": 5}' instead of a call to 'dict'. (use-dict-literal) +turtle/sma.py:14:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +turtle/sma.py:14:38: E1101: Instance of 'dict' has no 'sma1' member (no-member) +turtle/sma.py:15:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +turtle/sma.py:15:38: E1101: Instance of 'dict' has no 'sma2' member (no-member) +turtle/sma.py:16:25: E1101: Module 'backtrader' has no 'ind' member (no-member) +turtle/sma.py:19:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +turtle/sma.py:33:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +turtle/sma.py:40:27: E1101: Instance of 'dict' has no 'sma1' member (no-member) +turtle/sma.py:40:56: E1101: Instance of 'dict' has no 'sma2' member (no-member) +turtle/sma.py:45:27: E1101: Instance of 'dict' has no 'sma1' member (no-member) +turtle/sma.py:45:56: E1101: Instance of 'dict' has no 'sma2' member (no-member) +turtle/sma.py:51:52: E1101: Instance of 'dict' has no 'hold_days' member (no-member) +turtle/sma.py:101:8: W0603: Using the global statement (global-statement) +turtle/sma.py:111:4: C0415: Import outside toplevel (argparse) (import-outside-toplevel) +turtle/sma.py:130:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +turtle/sma.py:130:31: W0621: Redefining name 'args' from outer scope (line 167) (redefined-outer-name) +turtle/sma.py:138:14: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +turtle/sma.py:139:12: E1101: Module 'backtrader' has no 'feeds' member (no-member) +turtle/sma.py:149:37: W0123: Use of eval (eval-used) +turtle/sma.py:152:21: E1101: Module 'backtrader' has no 'sizers' member (no-member) +turtle/sma.py:163:4: W0107: Unnecessary pass statement (unnecessary-pass) +turtle/sma.py:170:4: C0103: Constant name "debug" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.turtle.sma_detector +turtle/sma_detector.py:1:0: C0114: Missing module docstring (missing-module-docstring) +turtle/sma_detector.py:75:0: C0112: Empty function docstring (empty-docstring) +************* Module backtrader.xtquant +xtquant/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/__init__.py:12:4: C0415: Import outside toplevel (requests) (import-outside-toplevel) +xtquant/__init__.py:13:4: C0415: Import outside toplevel (pkg_resources.get_distribution) (import-outside-toplevel) +xtquant/__init__.py:37:7: W0718: Catching too general exception BaseException (broad-exception-caught) +************* Module backtrader.xtquant.xtdata_config +xtquant/xtdata_config.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtdata_config.py:1:0: C0103: Constant name "client_guid" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.xtquant.xtstocktype +xtquant/xtstocktype.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.xtquant.xtdata +xtquant/xtdata.py:501:0: C0301: Line too long (156/100) (line-too-long) +xtquant/xtdata.py:1455:0: C0301: Line too long (127/100) (line-too-long) +xtquant/xtdata.py:1484:0: C0301: Line too long (127/100) (line-too-long) +xtquant/xtdata.py:1568:0: C0301: Line too long (107/100) (line-too-long) +xtquant/xtdata.py:2024:0: C0301: Line too long (127/100) (line-too-long) +xtquant/xtdata.py:2100:0: C0301: Line too long (114/100) (line-too-long) +xtquant/xtdata.py:2129:0: C0301: Line too long (114/100) (line-too-long) +xtquant/xtdata.py:1:0: C0302: Too many lines in module (3957/1000) (too-many-lines) +xtquant/xtdata.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtdata.py:8:0: W0401: Wildcard import metatable (wildcard-import) +xtquant/xtdata.py:54:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:55:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/xtdata.py:60:15: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtdata.py:63:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtdata.py:63:12: W0612: Unused variable 'message' (unused-variable) +xtquant/xtdata.py:75:0: C0103: Constant name "debug_mode" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:77:0: C0103: Constant name "default_data_dir" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:78:0: C0103: Constant name "__data_dir_from_server" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:79:0: C0103: Constant name "data_dir" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:81:0: C0103: Constant name "enable_hello" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:85:0: C0103: Constant name "__client" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:89:0: C0103: Constant name "__download_version" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdata.py:92:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:93:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:94:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:95:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:105:4: C0415: Import outside toplevel (.xtconn) (import-outside-toplevel) +xtquant/xtdata.py:107:21: R1714: Consider merging these comparisons with 'in' by using 'ip not in ('', '127.0.0.1', 'localhost')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:108:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:135:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:138:8: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:153:11: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:92:0: R0912: Too many branches (14/12) (too-many-branches) +xtquant/xtdata.py:160:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:161:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:162:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:172:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:173:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:174:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:172:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:183:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:184:4: W0603: Using the global statement (global-statement) +xtquant/xtdata.py:187:8: W0602: Using global for '__client_last_spec' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:195:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:196:4: W0602: Using global for '__client' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:197:4: W0602: Using global for 'enable_hello' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:210:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtdata.py:207:22: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:224:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:225:4: W0602: Using global for 'data_dir' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:226:4: W0602: Using global for '__data_dir_from_server' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:233:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:234:4: W0602: Using global for '__meta_field_list' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:237:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +xtquant/xtdata.py:242:19: W0123: Use of eval (eval-used) +xtquant/xtdata.py:261:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:262:4: C0415: Import outside toplevel (ctypes) (import-outside-toplevel) +xtquant/xtdata.py:264:4: C0415: Import outside toplevel (numpy) (import-outside-toplevel) +xtquant/xtdata.py:272:23: W0212: Access to a protected member _type_ of a client class (protected-access) +xtquant/xtdata.py:278:4: W0212: Access to a protected member _base of a client class (protected-access) +xtquant/xtdata.py:285:0: C0103: Function name "_BSON_call_common" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:286:11: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:286:46: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:324:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:324:0: R0914: Too many local variables (26/15) (too-many-locals) +xtquant/xtdata.py:359:0: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/xtdata.py:379:4: C0415: Import outside toplevel (math) (import-outside-toplevel) +xtquant/xtdata.py:381:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:393:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:395:4: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/xtdata.py:409:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:409:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:409:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:409:0: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/xtdata.py:409:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/xtdata.py:419:4: W0621: Redefining name 'data_dir' from outer scope (line 79) (redefined-outer-name) +xtquant/xtdata.py:437:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:459:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:459:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:459:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtdata.py:459:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtdata.py:536:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:566:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:566:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:566:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:566:0: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/xtdata.py:566:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/xtdata.py:576:4: W0621: Redefining name 'data_dir' from outer scope (line 79) (redefined-outer-name) +xtquant/xtdata.py:594:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:616:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:616:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:616:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:616:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtdata.py:616:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtdata.py:616:0: R0914: Too many local variables (27/15) (too-many-locals) +xtquant/xtdata.py:626:7: R1714: Consider merging these comparisons with 'in' by using 'period in ('hkbrokerqueue', 'hkbrokerqueue2', (1820, 0))'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:670:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:616:0: R0912: Too many branches (13/12) (too-many-branches) +xtquant/xtdata.py:729:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:729:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:729:0: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/xtdata.py:729:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/xtdata.py:729:0: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xtdata.py:739:4: W0621: Redefining name 'data_dir' from outer scope (line 79) (redefined-outer-name) +xtquant/xtdata.py:741:4: C0415: Import outside toplevel (numpy) (import-outside-toplevel) +xtquant/xtdata.py:742:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:760:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:787:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:787:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:787:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xtdata.py:787:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xtdata.py:787:0: R0914: Too many local variables (19/15) (too-many-locals) +xtquant/xtdata.py:843:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:870:16: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:875:8: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:934:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:938:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:939:23: W0612: Unused variable 'desc' (unused-variable) +xtquant/xtdata.py:945:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:959:30: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:985:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:985:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:985:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xtdata.py:985:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xtdata.py:985:0: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xtdata.py:1003:12: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1006:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:986:4: W0613: Unused argument 'field_list' (unused-argument) +xtquant/xtdata.py:992:4: W0613: Unused argument 'dividend_type' (unused-argument) +xtquant/xtdata.py:993:4: W0613: Unused argument 'fill_data' (unused-argument) +xtquant/xtdata.py:994:4: W0613: Unused argument 'enable_read_from_server' (unused-argument) +xtquant/xtdata.py:1003:12: W0612: Unused variable 'periodNum' (unused-variable) +xtquant/xtdata.py:1021:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1026:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1026:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:1026:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:1026:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xtdata.py:1026:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xtdata.py:1026:0: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xtdata.py:1035:4: W0621: Redefining name 'data_dir' from outer scope (line 79) (redefined-outer-name) +xtquant/xtdata.py:1067:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:1111:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:1115:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:1137:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:1141:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:1163:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:1169:4: W0602: Using global for 'debug_mode' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:1200:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:1207:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1207:0: C0103: Function name "getDividFactors" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1209:4: C0103: Variable name "resData" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1215:12: W0612: Unused variable 'k' (unused-variable) +xtquant/xtdata.py:1243:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtdata.py:1252:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:1257:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:1264:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:1221:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +xtquant/xtdata.py:1312:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:1317:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:1324:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:1275:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +xtquant/xtdata.py:1335:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1335:34: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/xtdata.py:1342:33: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/xtdata.py:1353:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1353:0: C0103: Function name "timetagToDateTime" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1353:31: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/xtdata.py:1354:4: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:1382:4: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xtdata.py:1389:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1390:4: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:1398:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:1395:24: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1405:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1406:4: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:1415:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:1411:24: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1422:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:1423:4: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:1441:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:1430:24: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1448:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtdata.py:1448:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtdata.py:1469:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtdata.py:1469:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtdata.py:1505:16: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1525:8: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1525:34: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1550:8: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1550:34: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1575:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:1584:20: R1721: Unnecessary use of a comprehension, use list(range(int(sprice * 10000), int((eprice + 0.01) * 10000), int(0.01 * 10000))) instead. (unnecessary-comprehension) +xtquant/xtdata.py:1609:8: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1609:34: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1627:20: R1721: Unnecessary use of a comprehension, use list(range(int(sprice * 10000), int((eprice + 0.01) * 10000), int(0.01 * 10000))) instead. (unnecessary-comprehension) +xtquant/xtdata.py:1647:61: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1648:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1685:12: W0101: Unreachable code (unreachable) +xtquant/xtdata.py:1684:12: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:1677:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:1701:61: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1702:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1718:55: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1719:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1742:52: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1743:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1758:33: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1760:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1772:55: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1773:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1787:54: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1788:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:1793:4: C0415: Import outside toplevel (.xtutil) (import-outside-toplevel) +xtquant/xtdata.py:1850:8: C0103: Function name "convNum2Str" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1909:4: C0103: Function name "convNum2Str" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:1909:4: E0102: function already defined line 1850 (function-redefined) +xtquant/xtdata.py:1942:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtdata.py:1942:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtdata.py:1942:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:1947:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtdata.py:1962:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:1986:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:1988:28: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression) +xtquant/xtdata.py:1993:20: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2013:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtdata.py:2013:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtdata.py:2035:24: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression) +xtquant/xtdata.py:2041:16: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2064:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:2060:19: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:2074:8: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2078:8: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:2083:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:2088:12: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2090:12: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2013:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2094:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:2123:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:2157:19: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:2162:16: W0101: Unreachable code (unreachable) +xtquant/xtdata.py:2161:16: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2199:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2219:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2232:4: C0415: Import outside toplevel (datetime) (import-outside-toplevel) +xtquant/xtdata.py:2235:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2242:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2247:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2263:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:2302:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2307:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2312:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2315:11: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2318:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2326:8: R0916: Too many boolean expressions in if statement (7/5) (too-many-boolean-expressions) +xtquant/xtdata.py:2329:13: R1714: Consider merging these comparisons with 'in' by using 'market in ('CFFEX', 'IF')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2379:8: C0103: Function name "convNum2Str" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2388:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/xtdata.py:2389:12: C0103: Variable name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2392:16: C0103: Variable name "instrumentName" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2394:20: C0103: Variable name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2396:20: C0103: Variable name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2399:16: C0103: Variable name "OptionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2401:20: C0103: Variable name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2403:20: C0103: Variable name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2409:8: C0103: Variable name "ProductCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2411:12: C0103: Variable name "ProductCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2413:12: C0103: Variable name "ProductCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2415:12: C0103: Variable name "ProductCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2318:0: R0912: Too many branches (14/12) (too-many-branches) +xtquant/xtdata.py:2420:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2427:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtdata.py:2431:12: C0103: Variable name "marketcodeList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2439:16: R1714: Consider merging these comparisons with 'in' by using 'undl_code_ref in ('000016.SH', '000300.SH', '000852.SH', '000905.SH')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2420:0: R0912: Too many branches (20/12) (too-many-branches) +xtquant/xtdata.py:2492:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2492:0: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/xtdata.py:2495:4: C0103: Variable name "marketcodeList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2498:4: C0103: Variable name "undlCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2499:4: C0103: Variable name "undlMarket" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2502:8: C0103: Variable name "undlCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2506:12: R1714: Consider merging these comparisons with 'in' by using 'undlCode in ('000016', '000300', '000852', '000905')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2522:4: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2524:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2525:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2527:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2528:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2530:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2531:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2532:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('SF', 'SHFE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2533:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2534:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2535:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('ZF', 'CZCE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2536:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2537:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2538:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('DF', 'DCE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2539:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2540:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2541:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('GF', 'GFEX')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:2542:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2543:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2545:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2546:8: C0103: Variable name "optList" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2558:12: C0103: Variable name "createDate" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2559:12: C0103: Variable name "openDate" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2561:16: C0103: Variable name "openDate" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2564:12: C0103: Variable name "endDate" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2492:0: R0912: Too many branches (27/12) (too-many-branches) +xtquant/xtdata.py:2492:0: R0915: Too many statements (69/50) (too-many-statements) +xtquant/xtdata.py:2586:0: R0914: Too many local variables (26/15) (too-many-locals) +xtquant/xtdata.py:2598:16: E0606: Possibly using variable 'market' before assignment (possibly-used-before-assignment) +xtquant/xtdata.py:2599:14: E0606: Possibly using variable 'stockcode' before assignment (possibly-used-before-assignment) +xtquant/xtdata.py:2625:8: C0415: Import outside toplevel (datetime) (import-outside-toplevel) +xtquant/xtdata.py:2586:0: R0912: Too many branches (15/12) (too-many-branches) +xtquant/xtdata.py:2586:0: R0915: Too many statements (58/50) (too-many-statements) +xtquant/xtdata.py:2682:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2747:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2748:4: C0103: Variable name "fileName" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2755:11: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtdata.py:2753:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +xtquant/xtdata.py:2779:8: C0103: Variable name "realStatus" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2781:12: C0103: Variable name "realStatus" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2783:12: C0103: Variable name "realStatus" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2785:12: C0103: Variable name "realStatus" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:2796:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2796:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:2796:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xtdata.py:2796:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xtdata.py:2809:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2810:44: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2829:36: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2833:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2835:10: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2838:12: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2851:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2857:36: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2851:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2861:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2861:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2867:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2867:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:2867:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtdata.py:2867:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtdata.py:2879:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2880:44: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2896:47: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2897:11: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2908:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2908:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2933:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2933:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2958:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2972:8: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/xtdata.py:2960:7: E0602: Undefined variable 'period' (undefined-variable) +xtquant/xtdata.py:2975:13: E0602: Undefined variable 'get_field_name' (undefined-variable) +xtquant/xtdata.py:2958:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:2983:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtdata.py:2991:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:2993:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:2994:46: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:3013:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtdata.py:3013:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtdata.py:3016:4: W0622: Redefining built-in 'vars' (redefined-builtin) +xtquant/xtdata.py:3028:4: C0103: Function name "onPushProgress" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3074:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:3133:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/xtdata.py:3136:8: C0415: Import outside toplevel (pyarrow.feather) (import-outside-toplevel) +xtquant/xtdata.py:3152:20: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:3168:4: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xtdata.py:3169:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/xtdata.py:3172:8: C0415: Import outside toplevel (pyarrow.Schema, pyarrow.Table, pyarrow.feather) (import-outside-toplevel) +xtquant/xtdata.py:3176:29: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:3187:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtdata.py:3188:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:3203:12: E0702: Raising str while only classes or instances are allowed (raising-bad-type) +xtquant/xtdata.py:3188:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3206:4: C0103: Method name "_BSON_call_common" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3207:15: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:3207:50: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtdata.py:3229:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3235:8: W0612: Unused variable 'result' (unused-variable) +xtquant/xtdata.py:3247:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:3247:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3262:8: W0612: Unused variable 'result' (unused-variable) +xtquant/xtdata.py:3369:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3388:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:3388:0: R0914: Too many local variables (21/15) (too-many-locals) +xtquant/xtdata.py:3399:4: C0415: Import outside toplevel (xml.etree.ElementTree) (import-outside-toplevel) +xtquant/xtdata.py:3391:4: W0612: Unused variable 'inst' (unused-variable) +xtquant/xtdata.py:3452:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:3459:12: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3459:12: W0612: Unused variable 'periodNum' (unused-variable) +xtquant/xtdata.py:3500:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:3500:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3517:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:3526:12: W0622: Redefining built-in 'list' (redefined-builtin) +xtquant/xtdata.py:3528:16: W0622: Redefining built-in 'id' (redefined-builtin) +xtquant/xtdata.py:3518:4: W0602: Using global for '__hk_broke_info' but no assignment is done (global-variable-not-assigned) +xtquant/xtdata.py:3534:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:3539:16: C0103: Variable name "Broker" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3540:16: C0103: Variable name "bidBrokerQueues" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3547:16: C0103: Variable name "Broker" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3548:16: C0103: Variable name "askBrokerQueues" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3558:0: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtdata.py:3558:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:3582:4: C0415: Import outside toplevel (.xtconn) (import-outside-toplevel) +xtquant/xtdata.py:3570:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3588:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:3588:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:3588:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtdata.py:3588:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtdata.py:3588:0: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/xtdata.py:3618:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xtdata.py:3630:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtdata.py:3630:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdata.py:3630:0: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/xtdata.py:3630:0: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/xtdata.py:3630:0: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xtdata.py:3701:4: C0415: Import outside toplevel (tqdm.tqdm) (import-outside-toplevel) +xtquant/xtdata.py:3708:12: W0404: Reimport 'time' (imported line 4) (reimported) +xtquant/xtdata.py:3708:12: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/xtdata.py:3725:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:3630:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3730:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtdata.py:3730:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtdata.py:3730:0: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xtdata.py:3766:24: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression) +xtquant/xtdata.py:3772:16: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3777:8: C0103: Variable name "periodNum" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtdata.py:3801:4: C0415: Import outside toplevel (tqdm.tqdm) (import-outside-toplevel) +xtquant/xtdata.py:3805:12: W0107: Unnecessary pass statement (unnecessary-pass) +xtquant/xtdata.py:3823:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdata.py:3730:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdata.py:3853:7: R1714: Consider merging these comparisons with 'in' by using 'market in ('IF', 'CFFEX')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:3856:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('SF', 'SHFE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:3859:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('DF', 'DCE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:3862:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('ZF', 'CZCE')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:3865:9: R1714: Consider merging these comparisons with 'in' by using 'market in ('GF', 'GFEX')'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtdata.py:3828:0: R0912: Too many branches (13/12) (too-many-branches) +xtquant/xtdata.py:8:0: W0614: Unused import(s) get_tabular_data, get_tabular_bson and get_arrow from wildcard import of metatable (unused-wildcard-import) +************* Module backtrader.xtquant.xtconstant +xtquant/xtconstant.py:397:0: C0301: Line too long (114/100) (line-too-long) +xtquant/xtconstant.py:1:0: C0302: Too many lines in module (1228/1000) (too-many-lines) +xtquant/xtconstant.py:6:0: W0105: String statement has no effect (pointless-string-statement) +xtquant/xtconstant.py:1041:0: C0103: Function name "getDirectionByOpType" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtconstant.py:1047:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtconstant.py:1140:0: W0105: String statement has no effect (pointless-string-statement) +xtquant/xtconstant.py:1142:0: C0103: Constant name "EESO_ActiveFirst" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtconstant.py:1144:0: C0103: Constant name "EESO_ConcurrentlyOrder" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtconstant.py:1146:0: C0103: Constant name "EESO_ActiveFirstFull" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtconstant.py:1226:0: C0103: Constant name "OFFSET_FLAG_ClOSEYESTERDAY" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.xtquant.xtdatacenter +xtquant/xtdatacenter.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtdatacenter.py:5:0: E0611: No name 'datacenter' in module 'backtrader.xtquant' (no-name-in-module) +xtquant/xtdatacenter.py:27:4: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtdatacenter.py:32:0: C0103: Constant name "__data_home_dir" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdatacenter.py:34:0: C0103: Constant name "__quote_token" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdatacenter.py:36:0: C0103: Constant name "init_complete" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtdatacenter.py:51:8: E0702: Raising str while only classes or instances are allowed (raising-bad-type) +xtquant/xtdatacenter.py:63:4: W0603: Using the global statement (global-statement) +xtquant/xtdatacenter.py:55:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:78:4: W0603: Using the global statement (global-statement) +xtquant/xtdatacenter.py:68:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:90:4: W0603: Using the global statement (global-statement) +xtquant/xtdatacenter.py:83:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:95:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:107:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:122:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdatacenter.py:122:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:134:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdatacenter.py:134:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:149:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:159:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtdatacenter.py:159:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:175:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:190:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:212:4: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/xtdatacenter.py:225:4: C0415: Import outside toplevel (.xtbson) (import-outside-toplevel) +xtquant/xtdatacenter.py:230:17: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/xtdatacenter.py:245:4: W0105: String statement has no effect (pointless-string-statement) +xtquant/xtdatacenter.py:255:15: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/xtdatacenter.py:277:21: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/xtdatacenter.py:293:4: W0603: Using the global statement (global-statement) +xtquant/xtdatacenter.py:204:0: R0912: Too many branches (14/12) (too-many-branches) +xtquant/xtdatacenter.py:204:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:301:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtdatacenter.py:325:4: W0602: Using global for 'init_complete' but no assignment is done (global-variable-not-assigned) +xtquant/xtdatacenter.py:327:8: W0719: Raising too general exception: Exception (broad-exception-raised) +************* Module backtrader.xtquant.xttype +xtquant/xttype.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xttype.py:4:0: W0105: String statement has no effect (pointless-string-statement) +xtquant/xttype.py:10:0: R0205: Class 'StockAccount' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:38:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xttype.py:38:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xttype.py:10:0: R0903: Too few public methods (1/2) (too-few-public-methods) +xtquant/xttype.py:41:0: R0205: Class 'XtAsset' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:44:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xttype.py:44:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xttype.py:41:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:62:0: R0205: Class 'XtOrder' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:62:0: R0902: Too many instance attributes (19/7) (too-many-instance-attributes) +xtquant/xttype.py:65:4: R0913: Too many arguments (19/5) (too-many-arguments) +xtquant/xttype.py:65:4: R0917: Too many positional arguments (19/5) (too-many-positional-arguments) +xtquant/xttype.py:65:4: R0914: Too many local variables (19/15) (too-many-locals) +xtquant/xttype.py:62:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:129:0: R0205: Class 'XtTrade' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:129:0: R0902: Too many instance attributes (17/7) (too-many-instance-attributes) +xtquant/xttype.py:132:4: R0913: Too many arguments (17/5) (too-many-arguments) +xtquant/xttype.py:132:4: R0917: Too many positional arguments (17/5) (too-many-positional-arguments) +xtquant/xttype.py:132:4: R0914: Too many local variables (17/15) (too-many-locals) +xtquant/xttype.py:129:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:190:0: R0205: Class 'XtPosition' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:190:0: R0902: Too many instance attributes (13/7) (too-many-instance-attributes) +xtquant/xttype.py:193:4: R0913: Too many arguments (13/5) (too-many-arguments) +xtquant/xttype.py:193:4: R0917: Too many positional arguments (13/5) (too-many-positional-arguments) +xtquant/xttype.py:190:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:239:0: R0205: Class 'XtOrderError' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:242:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttype.py:242:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttype.py:239:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:270:0: R0205: Class 'XtCancelError' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:273:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttype.py:273:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttype.py:270:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:301:0: R0205: Class 'XtOrderResponse' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:304:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttype.py:304:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttype.py:301:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:326:0: R0205: Class 'XtCancelOrderResponse' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:329:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttype.py:329:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttype.py:326:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:351:0: R0902: Too many instance attributes (16/7) (too-many-instance-attributes) +xtquant/xttype.py:354:4: W0231: __init__ method from base class 'XtOrder' is not called (super-init-not-called) +xtquant/xttype.py:354:4: R0913: Too many arguments (16/5) (too-many-arguments) +xtquant/xttype.py:354:4: R0917: Too many positional arguments (16/5) (too-many-positional-arguments) +xtquant/xttype.py:354:4: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/xttype.py:351:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:409:0: R0205: Class 'XtCreditDeal' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:409:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes) +xtquant/xttype.py:412:4: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/xttype.py:412:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/xttype.py:409:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:449:0: R0205: Class 'XtAccountStatus' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:449:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xttype.py:465:0: R0205: Class 'XtSmtAppointmentResponse' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttype.py:465:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.xtquant.xtutil +xtquant/xtutil.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtutil.py:12:4: C0415: Import outside toplevel (ctypes) (import-outside-toplevel) +xtquant/xtutil.py:30:19: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtutil.py:29:30: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/xtutil.py:47:18: E1101: Module 'backtrader.xtquant.xtbson' has no 'encode' member (no-member) +xtquant/xtutil.py:58:4: C0415: Import outside toplevel (feather) (import-outside-toplevel) +xtquant/xtutil.py:58:4: E0401: Unable to import 'feather' (import-error) +xtquant/xtutil.py:64:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtutil.py:64:26: W0613: Unused argument 'data' (unused-argument) +xtquant/xtutil.py:64:32: W0613: Unused argument 'file' (unused-argument) +************* Module backtrader.xtquant.xtview +xtquant/xtview.py:166:0: C0301: Line too long (123/100) (line-too-long) +xtquant/xtview.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtview.py:7:0: C0103: Constant name "__client" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtview.py:19:4: W0603: Using the global statement (global-statement) +xtquant/xtview.py:28:4: C0415: Import outside toplevel (.xtconn) (import-outside-toplevel) +xtquant/xtview.py:35:19: E1120: No value for argument 'start_port' in function call (no-value-for-parameter) +xtquant/xtview.py:35:19: E1120: No value for argument 'end_port' in function call (no-value-for-parameter) +xtquant/xtview.py:43:19: E1120: No value for argument 'start_port' in function call (no-value-for-parameter) +xtquant/xtview.py:43:19: E1120: No value for argument 'end_port' in function call (no-value-for-parameter) +xtquant/xtview.py:46:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtview.py:49:8: W0603: Using the global statement (global-statement) +xtquant/xtview.py:63:4: W0603: Using the global statement (global-statement) +xtquant/xtview.py:72:0: C0112: Empty function docstring (empty-docstring) +xtquant/xtview.py:74:4: W0603: Using the global statement (global-statement) +xtquant/xtview.py:77:8: W0602: Using global for '__client_last_spec' but no assignment is done (global-variable-not-assigned) +xtquant/xtview.py:92:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/xtview.py:93:4: C0415: Import outside toplevel (traceback) (import-outside-toplevel) +xtquant/xtview.py:104:15: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtview.py:107:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtview.py:117:0: C0103: Function name "_BSON_call_common" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:125:11: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtview.py:125:46: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtview.py:128:16: C0103: Argument name "viewID" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:145:15: C0103: Argument name "viewID" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:164:19: C0103: Argument name "viewID" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:173:51: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtview.py:174:11: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xtview.py:188:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:200:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtview.py:200:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtview.py:203:4: W0613: Unused argument 'finish_time' (unused-argument) +xtquant/xtview.py:236:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:251:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/xtview.py:251:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtview.py:251:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtview.py:251:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtview.py:291:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:308:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtview.py:308:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtview.py:311:4: W0613: Unused argument 'finish_time' (unused-argument) +xtquant/xtview.py:330:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:345:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtview.py:353:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:359:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtview.py:368:4: W0612: Unused variable 'result' (unused-variable) +xtquant/xtview.py:376:0: C0112: Empty function docstring (empty-docstring) +xtquant/xtview.py:394:4: C0103: Variable name "timeData" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:396:4: C0103: Variable name "numericDatas" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:397:4: C0103: Variable name "stringDatas" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:403:8: C0103: Variable name "timeData" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:408:8: C0103: Variable name "timeData" doesn't conform to snake_case naming style (invalid-name) +xtquant/xtview.py:385:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xtview.py:418:4: W0612: Unused variable 'result' (unused-variable) +************* Module backtrader.xtquant.xtconn +xtquant/xtconn.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtconn.py:6:0: C0103: Constant name "localhost" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtconn.py:9:0: C0103: Constant name "status_callback" doesn't conform to UPPER_CASE naming style (invalid-name) +xtquant/xtconn.py:22:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtconn.py:27:4: W0602: Using global for 'status_callback' but no assignment is done (global-variable-not-assigned) +xtquant/xtconn.py:33:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/xtconn.py:45:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:65:4: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xtconn.py:66:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtconn.py:111:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:93:19: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:83:35: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +xtquant/xtconn.py:104:23: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:130:11: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/xtconn.py:125:8: C0415: Import outside toplevel (xtdatacenter.get_local_server_port) (import-outside-toplevel) +xtquant/xtconn.py:143:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtconn.py:144:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/xtconn.py:178:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:175:19: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtconn.py:206:15: W0718: Catching too general exception Exception (broad-exception-caught) +************* Module backtrader.xtquant.xtextend +xtquant/xtextend.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtextend.py:1:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtextend.py:4:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +xtquant/xtextend.py:4:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xtextend.py:18:4: E0213: Method 'is_lock' should have "self" as first argument (no-self-argument) +xtquant/xtextend.py:24:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:30:19: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtextend.py:34:4: E0213: Method 'lock' should have "self" as first argument (no-self-argument) +xtquant/xtextend.py:44:15: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtextend.py:43:27: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) +xtquant/xtextend.py:43:27: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +xtquant/xtextend.py:48:4: E0213: Method 'unlock' should have "self" as first argument (no-self-argument) +xtquant/xtextend.py:60:4: E0213: Method 'clean' should have "self" as first argument (no-self-argument) +xtquant/xtextend.py:66:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:74:15: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtextend.py:79:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtextend.py:82:4: C0415: Import outside toplevel (ctypes.c_float, ctypes.c_short) (import-outside-toplevel) +xtquant/xtextend.py:93:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:97:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtextend.py:99:8: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xtextend.py:100:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:110:42: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtextend.py:114:4: R0914: Too many local variables (17/15) (too-many-locals) +xtquant/xtextend.py:122:8: C0415: Import outside toplevel (ctypes.POINTER, ctypes.c_float, ctypes.c_short, ctypes.cast, ctypes.sizeof) (import-outside-toplevel) +xtquant/xtextend.py:146:8: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/xtextend.py:148:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtextend.py:151:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtextend.py:140:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +xtquant/xtextend.py:165:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:166:8: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/xtextend.py:107:12: W0201: Attribute 'stocklist' defined outside __init__ (attribute-defined-outside-init) +xtquant/xtextend.py:112:12: W0201: Attribute 'timedatelist' defined outside __init__ (attribute-defined-outside-init) +xtquant/xtextend.py:168:8: W0201: Attribute 'file' defined outside __init__ (attribute-defined-outside-init) +xtquant/xtextend.py:212:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xtextend.py:214:4: C0415: Import outside toplevel (.xtdata) (import-outside-toplevel) +xtquant/xtextend.py:216:32: E1101: Module 'backtrader.xtquant.xtdata' has no 'init_data_dir' member (no-member) +************* Module backtrader.xtquant.xttools +xtquant/xttools.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xttools.py:4:0: C0112: Empty function docstring (empty-docstring) +xtquant/xttools.py:15:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xttools.py:7:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xttools.py:9:8: C0415: Import outside toplevel (PySide2) (import-outside-toplevel) +xtquant/xttools.py:9:8: E0401: Unable to import 'PySide2' (import-error) +************* Module backtrader.xtquant.xttrader +xtquant/xttrader.py:1:0: C0302: Too many lines in module (1870/1000) (too-many-lines) +xtquant/xttrader.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xttrader.py:5:0: E0611: No name 'xtpythonclient' in module 'backtrader.xtquant' (no-name-in-module) +xtquant/xttrader.py:15:4: C0415: Import outside toplevel (inspect) (import-outside-toplevel) +xtquant/xttrader.py:9:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:29:4: C0415: Import outside toplevel (inspect) (import-outside-toplevel) +xtquant/xttrader.py:23:0: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:38:0: C0112: Empty class docstring (empty-docstring) +xtquant/xttrader.py:38:0: R0205: Class 'XtQuantTraderCallback' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttrader.py:118:0: C0112: Empty class docstring (empty-docstring) +xtquant/xttrader.py:118:0: R0205: Class 'XtQuantTrader' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xttrader.py:118:0: R0902: Too many instance attributes (18/7) (too-many-instance-attributes) +xtquant/xttrader.py:121:4: R0914: Too many local variables (20/15) (too-many-locals) +xtquant/xttrader.py:129:8: C0415: Import outside toplevel (asyncio) (import-outside-toplevel) +xtquant/xttrader.py:130:8: C0415: Import outside toplevel (threading.current_thread) (import-outside-toplevel) +xtquant/xttrader.py:171:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xttrader.py:205:8: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:251:8: C0103: Function name "on_push_OrderStockAsyncResponse" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:251:8: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:284:8: C0103: Function name "on_push_CancelOrderStockAsyncResponse" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:284:8: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:346:8: C0103: Function name "on_push_AccountStatus" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:362:8: C0103: Function name "on_push_StockAsset" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:375:8: C0103: Function name "on_push_OrderStock" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:388:8: C0103: Function name "on_push_StockTrade" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:401:8: C0103: Function name "on_push_StockPosition" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:414:8: C0103: Function name "on_push_OrderError" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:435:8: C0103: Function name "on_push_CancelError" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:458:8: C0103: Function name "on_push_SmtAppointmentAsyncResponse" doesn't conform to snake_case naming style (invalid-name) +xtquant/xttrader.py:458:8: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:121:4: R0915: Too many statements (136/50) (too-many-statements) +xtquant/xttrader.py:480:44: W0622: Redefining built-in 'callable' (redefined-builtin) +xtquant/xttrader.py:511:43: W0622: Redefining built-in 'callable' (redefined-builtin) +xtquant/xttrader.py:518:8: C0415: Import outside toplevel (concurrent.futures.Future) (import-outside-toplevel) +xtquant/xttrader.py:521:24: W0108: Lambda may not be necessary (unnecessary-lambda) +xtquant/xttrader.py:540:8: C0415: Import outside toplevel (asyncio) (import-outside-toplevel) +xtquant/xttrader.py:541:8: C0415: Import outside toplevel (threading.current_thread) (import-outside-toplevel) +xtquant/xttrader.py:554:4: C0112: Empty method docstring (empty-docstring) +xtquant/xttrader.py:556:8: C0415: Import outside toplevel (concurrent.futures.ThreadPoolExecutor) (import-outside-toplevel) +xtquant/xttrader.py:554:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:569:4: C0112: Empty method docstring (empty-docstring) +xtquant/xttrader.py:569:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:577:4: C0112: Empty method docstring (empty-docstring) +xtquant/xttrader.py:589:8: C0415: Import outside toplevel (asyncio) (import-outside-toplevel) +xtquant/xttrader.py:601:4: C0112: Empty method docstring (empty-docstring) +xtquant/xttrader.py:603:8: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/xttrader.py:601:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:609:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:651:4: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xttrader.py:651:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xttrader.py:695:4: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/xttrader.py:695:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/xttrader.py:896:4: R1711: Useless return at end of function or method (useless-return) +xtquant/xttrader.py:918:8: W0612: Unused variable 'resp' (unused-variable) +xtquant/xttrader.py:1259:36: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/xttrader.py:1294:26: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/xttrader.py:1341:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xttrader.py:1341:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xttrader.py:1384:17: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/xttrader.py:1415:17: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/xttrader.py:1455:17: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/xttrader.py:1483:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xttrader.py:1483:4: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xttrader.py:1483:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xttrader.py:1528:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xttrader.py:1528:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xttrader.py:1565:27: E0602: Undefined variable 'applyId' (undefined-variable) +xtquant/xttrader.py:1554:52: W0613: Unused argument 'apply_id' (unused-argument) +xtquant/xttrader.py:1587:17: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/xttrader.py:1636:17: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/xttrader.py:1689:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttrader.py:1689:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttrader.py:1723:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xttrader.py:1723:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xttrader.py:1765:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xttrader.py:1765:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttrader.py:1765:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttrader.py:1785:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/xttrader.py:1798:16: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xttrader.py:1799:16: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xttrader.py:1802:8: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xttrader.py:1807:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xttrader.py:1807:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xttrader.py:1807:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xttrader.py:1830:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xttrader.py:1833:12: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/xttrader.py:1835:12: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/xttrader.py:1851:20: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/xttrader.py:1856:21: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xttrader.py:1863:16: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/xttrader.py:1867:8: C0415: Import outside toplevel (json) (import-outside-toplevel) +xtquant/xttrader.py:118:0: R0904: Too many public methods (62/20) (too-many-public-methods) +************* Module backtrader.xtquant.metatable +xtquant/metatable/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.xtquant.metatable.get_arrow +xtquant/metatable/get_arrow.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/metatable/get_arrow.py:13:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/metatable/get_arrow.py:13:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/metatable/get_arrow.py:13:0: R0914: Too many local variables (19/15) (too-many-locals) +xtquant/metatable/get_arrow.py:39:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:41:4: C0415: Import outside toplevel (pyarrow.feather) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:43:4: C0415: Import outside toplevel (.xtdata) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:45:4: C0103: Variable name "CONSTFIELD_TIME" doesn't conform to snake_case naming style (invalid-name) +xtquant/metatable/get_arrow.py:46:4: C0103: Variable name "CONSTFIELD_CODE" doesn't conform to snake_case naming style (invalid-name) +xtquant/metatable/get_arrow.py:59:8: C0415: Import outside toplevel (pyarrow.dataset) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:74:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/metatable/get_arrow.py:84:8: C0415: Import outside toplevel (pyarrow.compute) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:98:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/metatable/get_arrow.py:108:8: E0401: Unable to import 'distutils' (import-error) +xtquant/metatable/get_arrow.py:108:8: W4901: Deprecated module 'distutils' (deprecated-module) +xtquant/metatable/get_arrow.py:108:8: C0415: Import outside toplevel (distutils.version) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:110:8: C0415: Import outside toplevel (pyarrow) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:13:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +xtquant/metatable/get_arrow.py:16:4: W0613: Unused argument 'int_period' (unused-argument) +xtquant/metatable/get_arrow.py:14:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/metatable/get_arrow.py:150:38: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:150:52: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:173:38: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:173:52: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:131:0: R0912: Too many branches (15/12) (too-many-branches) +xtquant/metatable/get_arrow.py:205:38: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:205:52: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:228:38: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:228:52: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:187:0: R0912: Too many branches (15/12) (too-many-branches) +xtquant/metatable/get_arrow.py:242:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/metatable/get_arrow.py:242:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/metatable/get_arrow.py:242:0: R0914: Too many local variables (29/15) (too-many-locals) +xtquant/metatable/get_arrow.py:268:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:279:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/metatable/get_arrow.py:288:39: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/metatable/get_arrow.py:296:8: C0415: Import outside toplevel (datetime) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:302:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/metatable/get_arrow.py:243:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/metatable/get_arrow.py:345:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/metatable/get_arrow.py:345:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/metatable/get_arrow.py:345:0: R0914: Too many local variables (28/15) (too-many-locals) +xtquant/metatable/get_arrow.py:371:4: C0415: Import outside toplevel (.xtbson) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:382:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/metatable/get_arrow.py:391:39: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/metatable/get_arrow.py:399:8: C0415: Import outside toplevel (datetime) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:405:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/metatable/get_arrow.py:413:8: E0401: Unable to import 'distutils' (import-error) +xtquant/metatable/get_arrow.py:413:8: W4901: Deprecated module 'distutils' (deprecated-module) +xtquant/metatable/get_arrow.py:413:8: C0415: Import outside toplevel (distutils.version) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:415:8: C0415: Import outside toplevel (pyarrow) (import-outside-toplevel) +xtquant/metatable/get_arrow.py:437:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/metatable/get_arrow.py:446:25: E1101: Module 'backtrader.xtquant.xtbson' has no 'encode' member (no-member) +xtquant/metatable/get_arrow.py:452:18: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:453:22: R1734: Consider using [] instead of list() (use-list-literal) +xtquant/metatable/get_arrow.py:454:8: C0200: Consider using enumerate instead of iterating with range and len (consider-using-enumerate) +xtquant/metatable/get_arrow.py:467:29: E1101: Module 'backtrader.xtquant.xtbson' has no 'encode' member (no-member) +xtquant/metatable/get_arrow.py:346:0: W0613: Unused argument 'kwargs' (unused-argument) +************* Module backtrader.xtquant.metatable.get_bson +xtquant/metatable/get_bson.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/metatable/get_bson.py:63:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/metatable/get_bson.py:63:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/metatable/get_bson.py:63:0: R0914: Too many local variables (18/15) (too-many-locals) +xtquant/metatable/get_bson.py:92:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/metatable/get_bson.py:94:4: C0415: Import outside toplevel (.xtbson, .xtdata) (import-outside-toplevel) +xtquant/metatable/get_bson.py:96:4: C0103: Variable name "CONSTKEY_CODE" doesn't conform to snake_case naming style (invalid-name) +xtquant/metatable/get_bson.py:101:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +xtquant/metatable/get_bson.py:119:25: W0212: Access to a protected member _get_data_file_path of a client class (protected-access) +xtquant/metatable/get_bson.py:143:24: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/metatable/get_bson.py:160:25: W0212: Access to a protected member _get_data_file_path of a client class (protected-access) +xtquant/metatable/get_bson.py:170:20: E1101: Module 'backtrader.xtquant.xtbson' has no 'decode' member (no-member) +xtquant/metatable/get_bson.py:63:0: R0915: Too many statements (51/50) (too-many-statements) +xtquant/metatable/get_bson.py:64:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/metatable/get_bson.py:194:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/metatable/get_bson.py:194:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/metatable/get_bson.py:194:0: R0914: Too many local variables (21/15) (too-many-locals) +xtquant/metatable/get_bson.py:220:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/metatable/get_bson.py:231:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/metatable/get_bson.py:195:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/metatable/get_bson.py:331:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/metatable/get_bson.py:331:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/metatable/get_bson.py:331:0: R0914: Too many local variables (19/15) (too-many-locals) +xtquant/metatable/get_bson.py:357:4: C0415: Import outside toplevel (.xtbson) (import-outside-toplevel) +xtquant/metatable/get_bson.py:368:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/metatable/get_bson.py:380:25: E1101: Module 'backtrader.xtquant.xtbson' has no 'encode' member (no-member) +xtquant/metatable/get_bson.py:391:29: E1101: Module 'backtrader.xtquant.xtbson' has no 'encode' member (no-member) +xtquant/metatable/get_bson.py:332:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/metatable/get_bson.py:375:17: W0612: Unused variable 'key2field' (unused-variable) +xtquant/metatable/get_bson.py:375:28: W0612: Unused variable 'ori_columns' (unused-variable) +************* Module backtrader.xtquant.metatable.meta_config +xtquant/metatable/meta_config.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/metatable/meta_config.py:30:4: C0415: Import outside toplevel (.xtdata) (import-outside-toplevel) +xtquant/metatable/meta_config.py:34:10: W0212: Access to a protected member _BSON_call_common of a client class (protected-access) +xtquant/metatable/meta_config.py:40:4: C0415: Import outside toplevel (traceback) (import-outside-toplevel) +xtquant/metatable/meta_config.py:42:4: C0415: Import outside toplevel (.xtbson, .xtdata) (import-outside-toplevel) +xtquant/metatable/meta_config.py:44:4: W0602: Using global for '__META_INFO__' but no assignment is done (global-variable-not-assigned) +xtquant/metatable/meta_config.py:45:4: W0602: Using global for '__META_FIELDS__' but no assignment is done (global-variable-not-assigned) +xtquant/metatable/meta_config.py:46:4: W0602: Using global for '__META_TABLES__' but no assignment is done (global-variable-not-assigned) +xtquant/metatable/meta_config.py:49:13: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/metatable/meta_config.py:50:46: E1101: Module 'backtrader.xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/metatable/meta_config.py:73:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/metatable/meta_config.py:38:0: R1711: Useless return at end of function or method (useless-return) +xtquant/metatable/meta_config.py:152:8: W0707: Consider explicitly re-raising using 'except BaseException as exc' and 'raise Exception(f'Unsupported type:{t}') from exc' (raise-missing-from) +xtquant/metatable/meta_config.py:152:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/metatable/meta_config.py:208:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +************* Module backtrader.xtquant.qmttools.contextinfo +xtquant/qmttools/contextinfo.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/qmttools/contextinfo.py:6:0: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/contextinfo.py:6:0: R0902: Too many instance attributes (39/7) (too-many-instance-attributes) +xtquant/qmttools/contextinfo.py:9:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:9:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/contextinfo.py:67:4: E0213: Method 'start' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:76:4: E0213: Method 'start' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:86:4: E0213: Method 'end' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:95:4: E0213: Method 'end' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:105:4: E0213: Method 'capital' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:114:4: E0213: Method 'capital' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:125:4: E0213: Method 'init' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:133:4: E0213: Method 'after_init' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:141:4: E0213: Method 'handlebar' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:149:4: E0213: Method 'on_backtest_finished' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:157:4: E0213: Method 'stop' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:165:4: E0213: Method 'account_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:165:31: W0613: Unused argument 'account_info' (unused-argument) +xtquant/qmttools/contextinfo.py:174:4: E0213: Method 'order_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:174:29: W0613: Unused argument 'order_info' (unused-argument) +xtquant/qmttools/contextinfo.py:183:4: E0213: Method 'deal_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:183:28: W0613: Unused argument 'deal_info' (unused-argument) +xtquant/qmttools/contextinfo.py:192:4: E0213: Method 'position_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:192:32: W0613: Unused argument 'position_info' (unused-argument) +xtquant/qmttools/contextinfo.py:201:4: C0103: Method name "orderError_callback" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:201:4: E0213: Method 'orderError_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:201:34: W0613: Unused argument 'passorder_info' (unused-argument) +xtquant/qmttools/contextinfo.py:201:50: W0613: Unused argument 'msg' (unused-argument) +xtquant/qmttools/contextinfo.py:213:4: E0213: Method 'is_last_bar' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:221:4: E0213: Method 'is_new_bar' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:227:29: E1101: Instance of 'ContextInfo' has no 'lastbarpos' member (no-member) +xtquant/qmttools/contextinfo.py:229:4: E0213: Method 'get_bar_timetag' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:242:15: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/qmttools/contextinfo.py:247:4: E0213: Method 'paint' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:247:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:247:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:247:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/contextinfo.py:247:33: W0613: Unused argument 'index' (unused-argument) +xtquant/qmttools/contextinfo.py:247:43: W0613: Unused argument 'drawstyle' (unused-argument) +xtquant/qmttools/contextinfo.py:247:56: W0613: Unused argument 'color' (unused-argument) +xtquant/qmttools/contextinfo.py:247:66: W0613: Unused argument 'limit' (unused-argument) +xtquant/qmttools/contextinfo.py:272:4: E0213: Method 'subscribe_quote' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:272:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:272:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:300:4: E0213: Method 'subscribe_whole_quote' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:310:4: E0213: Method 'unsubscribe_quote' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:319:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/contextinfo.py:319:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/contextinfo.py:319:4: E0213: Method 'get_market_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:319:4: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:319:4: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:376:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/contextinfo.py:376:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/contextinfo.py:376:4: E0213: Method 'get_market_data_ex' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:376:4: R0913: Too many arguments (10/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:376:4: R0917: Too many positional arguments (10/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:430:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/contextinfo.py:430:4: E0213: Method 'get_full_tick' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:441:4: E0213: Method 'get_divid_factors' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:455:4: E0213: Method 'get_financial_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:455:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:455:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:474:8: W0101: Unreachable code (unreachable) +xtquant/qmttools/contextinfo.py:473:8: E0702: Raising str while only classes or instances are allowed (raising-bad-type) +xtquant/qmttools/contextinfo.py:455:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/contextinfo.py:457:8: W0613: Unused argument 'field_list' (unused-argument) +xtquant/qmttools/contextinfo.py:458:8: W0613: Unused argument 'stock_list' (unused-argument) +xtquant/qmttools/contextinfo.py:459:8: W0613: Unused argument 'start_date' (unused-argument) +xtquant/qmttools/contextinfo.py:460:8: W0613: Unused argument 'end_date' (unused-argument) +xtquant/qmttools/contextinfo.py:461:8: W0613: Unused argument 'report_type' (unused-argument) +xtquant/qmttools/contextinfo.py:476:4: E0213: Method 'get_raw_financial_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:476:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:476:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:500:4: E0213: Method 'get_option_detail_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:509:4: E0213: Method 'get_option_undl_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:518:4: E0213: Method 'get_option_list' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:530:4: E0213: Method 'get_option_iv' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:541:8: C0103: Argument name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:542:8: C0103: Argument name "targetPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:543:8: C0103: Argument name "strikePrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:544:8: C0103: Argument name "riskFree" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:539:4: E0213: Method 'bsm_price' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:539:4: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:539:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:561:8: C0103: Variable name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:563:12: C0103: Variable name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:565:12: C0103: Variable name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:566:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/qmttools/contextinfo.py:569:16: C0103: Variable name "bsmPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:579:16: C0103: Variable name "bsmPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:583:12: C0103: Variable name "bsmPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:598:8: C0103: Argument name "optType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:599:8: C0103: Argument name "targetPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:600:8: C0103: Argument name "strikePrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:601:8: C0103: Argument name "optionPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:602:8: C0103: Argument name "riskFree" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:596:4: E0213: Method 'bsm_iv' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:596:4: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:596:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:619:12: C0103: Variable name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:621:12: C0103: Variable name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:623:12: E0606: Possibly using variable 'optionType' before assignment (possibly-used-before-assignment) +xtquant/qmttools/contextinfo.py:637:4: E0213: Method 'get_instrument_detail' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:651:4: E0213: Method 'get_trading_dates' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:651:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:651:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:666:4: E0213: Method 'get_stock_list_in_sector' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:677:8: C0103: Argument name "opType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:678:8: C0103: Argument name "orderType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:680:8: C0103: Argument name "orderCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:681:8: C0103: Argument name "prType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:684:8: C0103: Argument name "strategyName" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:685:8: C0103: Argument name "quickTrade" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:686:8: C0103: Argument name "userOrderId" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/contextinfo.py:675:4: E0213: Method 'passorder' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:675:4: R0913: Too many arguments (11/5) (too-many-arguments) +xtquant/qmttools/contextinfo.py:675:4: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +xtquant/qmttools/contextinfo.py:703:15: W0212: Access to a protected member _passorder_impl of a client class (protected-access) +xtquant/qmttools/contextinfo.py:721:4: E0213: Method 'set_auto_trade_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:728:15: W0212: Access to a protected member _set_auto_trade_callback_impl of a client class (protected-access) +xtquant/qmttools/contextinfo.py:730:4: E0213: Method 'set_account' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:739:4: E0213: Method 'get_his_st_data' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:750:4: E0213: Method 'trade_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:750:29: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/qmttools/contextinfo.py:760:8: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/contextinfo.py:760:8: R0205: Class 'DetailData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/qmttools/contextinfo.py:760:8: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/qmttools/contextinfo.py:750:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/contextinfo.py:750:43: W0613: Unused argument 'error' (unused-argument) +xtquant/qmttools/contextinfo.py:787:4: E0213: Method 'register_callback' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:787:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/contextinfo.py:797:4: E0213: Method 'get_callback_cache' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:797:33: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/qmttools/contextinfo.py:804:15: W0212: Access to a protected member _get_callback_cache_impl of a client class (protected-access) +xtquant/qmttools/contextinfo.py:806:4: E0213: Method 'get_ipo_info' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:816:4: E0213: Method 'get_backtest_index' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:825:4: E0213: Method 'get_group_result' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:835:4: E0213: Method 'is_suspended_stock' should have "self" as first argument (no-self-argument) +xtquant/qmttools/contextinfo.py:835:45: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/qmttools/contextinfo.py:6:0: R0904: Too many public methods (46/20) (too-many-public-methods) +************* Module backtrader.xtquant.qmttools.functions +xtquant/qmttools/functions.py:1:0: C0302: Too many lines in module (1039/1000) (too-many-lines) +xtquant/qmttools/functions.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/qmttools/functions.py:9:35: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/qmttools/functions.py:22:33: W0622: Redefining built-in 'format' (redefined-builtin) +xtquant/qmttools/functions.py:35:0: C0112: Empty function docstring (empty-docstring) +xtquant/qmttools/functions.py:35:0: C0103: Function name "fetch_ContextInfo" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:37:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/qmttools/functions.py:39:12: W0212: Access to a protected member _getframe of a client class (protected-access) +xtquant/qmttools/functions.py:49:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/qmttools/functions.py:49:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:50:24: W0613: Unused argument 'dividend_type' (unused-argument) +xtquant/qmttools/functions.py:50:48: W0613: Unused argument 'result_type' (unused-argument) +xtquant/qmttools/functions.py:84:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/functions.py:84:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/functions.py:84:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/functions.py:84:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:84:0: R0914: Too many local variables (32/15) (too-many-locals) +xtquant/qmttools/functions.py:137:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/qmttools/functions.py:155:8: C0103: Variable name "oriData" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:189:8: C0103: Variable name "oriData" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:191:4: C0103: Variable name "resultDict" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:192:4: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/qmttools/functions.py:201:8: R0916: Too many boolean expressions in if statement (7/5) (too-many-boolean-expressions) +xtquant/qmttools/functions.py:204:13: R1714: Consider merging these comparisons with 'in' by using 'count in (-1, -2)'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/qmttools/functions.py:210:8: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/qmttools/functions.py:213:4: C0415: Import outside toplevel (numpy) (import-outside-toplevel) +xtquant/qmttools/functions.py:214:4: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/qmttools/functions.py:220:13: R1714: Consider merging these comparisons with 'in' by using 'count in (-1, -2)'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/qmttools/functions.py:222:8: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/qmttools/functions.py:229:13: R1714: Consider merging these comparisons with 'in' by using 'count in (-1, -2)'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/qmttools/functions.py:246:8: C0206: Consider iterating with .items() (consider-using-dict-items) +xtquant/qmttools/functions.py:267:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/qmttools/functions.py:265:21: E1101: Module 'pandas' has no 'Panel' member (no-member) +xtquant/qmttools/functions.py:84:0: R0911: Too many return statements (9/6) (too-many-return-statements) +xtquant/qmttools/functions.py:84:0: R0912: Too many branches (34/12) (too-many-branches) +xtquant/qmttools/functions.py:84:0: R0915: Too many statements (79/50) (too-many-statements) +xtquant/qmttools/functions.py:84:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +xtquant/qmttools/functions.py:272:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/functions.py:272:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/functions.py:272:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/qmttools/functions.py:272:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:281:4: W0613: Unused argument 'subscribe' (unused-argument) +xtquant/qmttools/functions.py:339:45: C0103: Argument name "startTime" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:339:56: C0103: Argument name "endTime" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:351:0: R0914: Too many local variables (17/15) (too-many-locals) +xtquant/qmttools/functions.py:368:4: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/qmttools/functions.py:444:0: C0112: Empty function docstring (empty-docstring) +xtquant/qmttools/functions.py:469:4: C0103: Argument name "strategyName" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:470:4: C0103: Argument name "quickTrade" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:471:4: C0103: Argument name "userOrderId" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:475:4: C0103: Argument name "algoName" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:461:0: R0913: Too many arguments (15/5) (too-many-arguments) +xtquant/qmttools/functions.py:461:0: R0917: Too many positional arguments (15/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:461:0: R0914: Too many local variables (17/15) (too-many-locals) +xtquant/qmttools/functions.py:515:47: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:461:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:520:4: C0103: Argument name "opType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:521:4: C0103: Argument name "orderType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:523:4: C0103: Argument name "orderCode" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:524:4: C0103: Argument name "prType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:527:4: C0103: Argument name "strategyName" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:528:4: C0103: Argument name "quickTrade" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:529:4: C0103: Argument name "userOrderId" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:530:4: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:519:0: R0913: Too many arguments (11/5) (too-many-arguments) +xtquant/qmttools/functions.py:519:0: R0917: Too many positional arguments (11/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:572:4: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:574:8: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/qmttools/functions.py:584:38: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:586:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:588:4: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/functions.py:588:4: R0205: Class 'DetailData' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/qmttools/functions.py:588:4: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/qmttools/functions.py:620:20: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/qmttools/functions.py:632:15: W0718: Catching too general exception BaseException (broad-exception-caught) +xtquant/qmttools/functions.py:629:21: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:651:58: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:640:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:655:28: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:676:48: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:665:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:680:29: W0622: Redefining built-in 'type' (redefined-builtin) +xtquant/qmttools/functions.py:693:39: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:695:11: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:698:37: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:698:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:698:31: W0613: Unused argument 'data' (unused-argument) +xtquant/qmttools/functions.py:709:35: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:709:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:709:29: W0613: Unused argument 'data' (unused-argument) +xtquant/qmttools/functions.py:720:34: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:720:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:720:28: W0613: Unused argument 'data' (unused-argument) +xtquant/qmttools/functions.py:731:38: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:731:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:731:32: W0613: Unused argument 'data' (unused-argument) +xtquant/qmttools/functions.py:742:40: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:742:0: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/functions.py:742:34: W0613: Unused argument 'data' (unused-argument) +xtquant/qmttools/functions.py:794:60: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:795:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:802:4: C0103: Argument name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:803:4: C0103: Argument name "strikePrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:804:4: C0103: Argument name "targetPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:805:4: C0103: Argument name "riskFree" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:801:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/functions.py:801:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:834:35: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:836:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:843:4: C0103: Argument name "optionType" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:844:4: C0103: Argument name "strikePrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:845:4: C0103: Argument name "targetPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:846:4: C0103: Argument name "optionPrice" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:847:4: C0103: Argument name "riskFree" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/functions.py:842:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/functions.py:842:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:874:61: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:875:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:898:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/functions.py:906:62: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:907:11: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:918:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/functions.py:926:59: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:927:11: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:930:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/qmttools/functions.py:930:0: R0913: Too many arguments (9/5) (too-many-arguments) +xtquant/qmttools/functions.py:930:0: R0917: Too many positional arguments (9/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:967:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/functions.py:967:0: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/qmttools/functions.py:967:0: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/qmttools/functions.py:967:0: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/qmttools/functions.py:989:4: C0415: Import outside toplevel (copy) (import-outside-toplevel) +xtquant/qmttools/functions.py:1016:28: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:1018:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:1034:8: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/functions.py:1038:13: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +************* Module backtrader.xtquant.qmttools.stgentry +xtquant/qmttools/stgentry.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/qmttools/stgentry.py:4:0: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/qmttools/stgentry.py:4:0: R0914: Too many local variables (19/15) (too-many-locals) +xtquant/qmttools/stgentry.py:11:4: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:12:4: C0415: Import outside toplevel (sys) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:13:4: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:14:4: C0415: Import outside toplevel (types) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:16:4: C0415: Import outside toplevel (contextinfo.ContextInfo) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:17:4: C0415: Import outside toplevel (stgframe.StrategyLoader) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:25:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +xtquant/qmttools/stgentry.py:38:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/qmttools/stgentry.py:32:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) +xtquant/qmttools/stgentry.py:37:8: W0122: Use of exec (exec-used) +xtquant/qmttools/stgentry.py:41:4: W0122: Use of exec (exec-used) +xtquant/qmttools/stgentry.py:43:4: C0103: Variable name "_C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgentry.py:44:4: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgentry.py:47:21: C0103: Argument name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgentry.py:56:12: C2801: Unnecessarily calls dunder method __setattr__. Set attribute directly or use setattr built-in function. (unnecessary-dunder-call) +xtquant/qmttools/stgentry.py:47:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgentry.py:83:8: C0415: Import outside toplevel (stgframe.BackTestResult) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:90:8: C0415: Import outside toplevel (stgframe.Result) (import-outside-toplevel) +xtquant/qmttools/stgentry.py:90:8: E0611: No name 'Result' in module 'backtrader.xtquant.qmttools.stgframe' (no-name-in-module) +************* Module backtrader.xtquant.qmttools.stgframe +xtquant/qmttools/stgframe.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/qmttools/stgframe.py:7:0: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/stgframe.py:16:8: C0103: Attribute name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:10:4: E0213: Method '__init__' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:10:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:20:4: E0213: Method 'init' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:26:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:27:8: C0415: Import outside toplevel (uuid) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:29:8: C0415: Import outside toplevel (xtquant.xtdata_config) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:31:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:33:17: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:34:23: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:34:61: E1101: Instance of 'ContextInfo' has no 'guid' member (no-member) +xtquant/qmttools/stgframe.py:35:23: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:38:23: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:43:18: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:49:23: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:50:19: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:51:23: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:52:21: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:72:26: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:74:19: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:90:36: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:92:8: C0415: Import outside toplevel (functions.datetime_to_timetag) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:98:55: E1101: Instance of 'ContextInfo' has no 'start_time_str' member (no-member) +xtquant/qmttools/stgframe.py:103:53: E1101: Instance of 'ContextInfo' has no 'end_time_str' member (no-member) +xtquant/qmttools/stgframe.py:105:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:110:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:121:12: W0719: Raising too general exception: Exception (broad-exception-raised) +xtquant/qmttools/stgframe.py:123:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:124:19: W0212: Access to a protected member _param of a client class (protected-access) +xtquant/qmttools/stgframe.py:127:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:131:41: C2801: Unnecessarily calls dunder method __getattribute__. Access attribute directly or use getattr built-in function. (unnecessary-dunder-call) +xtquant/qmttools/stgframe.py:142:40: C2801: Unnecessarily calls dunder method __getattribute__. Access attribute directly or use getattr built-in function. (unnecessary-dunder-call) +xtquant/qmttools/stgframe.py:145:40: C2801: Unnecessarily calls dunder method __getattribute__. Access attribute directly or use getattr built-in function. (unnecessary-dunder-call) +xtquant/qmttools/stgframe.py:164:43: C2801: Unnecessarily calls dunder method __getattribute__. Access attribute directly or use getattr built-in function. (unnecessary-dunder-call) +xtquant/qmttools/stgframe.py:166:12: C0415: Import outside toplevel (datetime) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:172:59: E1101: Instance of 'ContextInfo' has no 'start_time_str' member (no-member) +xtquant/qmttools/stgframe.py:180:57: E1101: Instance of 'ContextInfo' has no 'end_time_str' member (no-member) +xtquant/qmttools/stgframe.py:187:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:20:4: R0912: Too many branches (16/12) (too-many-branches) +xtquant/qmttools/stgframe.py:20:4: R0915: Too many statements (83/50) (too-many-statements) +xtquant/qmttools/stgframe.py:20:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:191:4: E0213: Method 'shutdown' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:199:4: E0213: Method 'start' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:205:8: C0415: Import outside toplevel (time) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:207:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:199:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:223:4: E0213: Method 'stop' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:223:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:235:4: E0213: Method 'run' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:241:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:235:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:247:4: E0213: Method 'load_main_history' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:253:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:247:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:268:4: E0213: Method 'load_main_realtime' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:274:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:276:8: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:268:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:298:4: E0213: Method 'on_main_quote' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:298:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:310:4: E0213: Method 'run_bar' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:316:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:342:11: W0125: Using a conditional statement with a constant value (using-constant-test) +xtquant/qmttools/stgframe.py:310:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:350:4: E0213: Method 'create_formula' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:357:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:364:25: E1101: Instance of 'ContextInfo' has no 'start_time_str' member (no-member) +xtquant/qmttools/stgframe.py:365:23: E1101: Instance of 'ContextInfo' has no 'end_time_str' member (no-member) +xtquant/qmttools/stgframe.py:375:46: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/stgframe.py:377:4: E0213: Method 'call_formula' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:385:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:387:57: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/stgframe.py:388:15: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/stgframe.py:390:4: E0213: Method 'create_view' should have "self" as first argument (no-self-argument) +xtquant/qmttools/stgframe.py:397:8: C0103: Variable name "C" doesn't conform to snake_case naming style (invalid-name) +xtquant/qmttools/stgframe.py:407:40: E1101: Module 'xtquant.xtbson' has no 'BSON' member (no-member) +xtquant/qmttools/stgframe.py:390:4: R1711: Useless return at end of function or method (useless-return) +xtquant/qmttools/stgframe.py:411:0: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/stgframe.py:422:4: C0112: Empty method docstring (empty-docstring) +xtquant/qmttools/stgframe.py:424:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:425:8: C0415: Import outside toplevel (uuid) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:427:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:429:8: C0415: Import outside toplevel (functions.get_backtest_index) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:435:8: C0415: Import outside toplevel (shutil) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:440:4: W0102: Dangerous default value [] as argument (dangerous-default-value) +xtquant/qmttools/stgframe.py:446:8: C0415: Import outside toplevel (os) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:447:8: C0415: Import outside toplevel (uuid) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:449:8: C0415: Import outside toplevel (pandas) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:451:8: C0415: Import outside toplevel (functions.get_group_result) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:460:8: C0415: Import outside toplevel (shutil) (import-outside-toplevel) +xtquant/qmttools/stgframe.py:466:0: C0112: Empty class docstring (empty-docstring) +xtquant/qmttools/stgframe.py:466:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.xtquant.xtbson +xtquant/xtbson/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring) +************* Module backtrader.xtquant.xtbson.bson36._helpers +xtquant/xtbson/bson36/_helpers.py:46:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +************* Module backtrader.xtquant.xtbson.bson36.binary +xtquant/xtbson/bson36/binary.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtbson/bson36/binary.py:17:0: W0105: String statement has no effect (pointless-string-statement) +xtquant/xtbson/bson36/binary.py:59:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/binary.py:59:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson36/binary.py:231:8: W0212: Access to a protected member __subtype of a client class (protected-access) +xtquant/xtbson/bson36/binary.py:313:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/binary.py:321:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise) +xtquant/xtbson/bson36/binary.py:338:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/binary.py:345:15: E1101: Instance of 'Binary' has no '__subtype' member (no-member) +xtquant/xtbson/bson36/binary.py:350:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson36/binary.py:353:21: E1101: Instance of 'Binary' has no '__subtype' member (no-member) +xtquant/xtbson/bson36/binary.py:362:20: E1101: Instance of 'Binary' has no '__subtype' member (no-member) +xtquant/xtbson/bson36/binary.py:373:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson36/binary.py:373:53: E1101: Instance of 'Binary' has no '__subtype' member (no-member) +xtquant/xtbson/bson36/binary.py:385:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/binary.py:385:57: E1101: Instance of 'Binary' has no '__subtype' member (no-member) +************* Module backtrader.xtquant.xtbson.bson36.code +xtquant/xtbson/bson36/code.py:91:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/code.py:100:49: W0212: Access to a protected member __scope of a client class (protected-access) +************* Module backtrader.xtquant.xtbson.bson36.codec_options +xtquant/xtbson/bson36/codec_options.py:402:9: W0511: TODO: PYTHON-2442 use _asdict() instead (fixme) +xtquant/xtbson/bson36/codec_options.py:116:0: R0205: Class 'TypeRegistry' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/codec_options.py:160:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/codec_options.py:174:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/codec_options.py:189:8: C0415: Import outside toplevel (._BUILT_IN_TYPES) (import-outside-toplevel) +xtquant/xtbson/bson36/codec_options.py:194:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/codec_options.py:201:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/codec_options.py:222:0: C0103: Class name "_options_base" doesn't conform to PascalCase naming style (invalid-name) +xtquant/xtbson/bson36/codec_options.py:315:4: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtbson/bson36/codec_options.py:315:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/codec_options.py:349:15: W1116: Second argument of isinstance is not a type (isinstance-second-argument-not-valid-type) +xtquant/xtbson/bson36/codec_options.py:387:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/codec_options.py:414:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.dbref +xtquant/xtbson/bson36/dbref.py:47:0: C0301: Line too long (101/100) (line-too-long) +xtquant/xtbson/bson36/dbref.py:22:0: R0205: Class 'DBRef' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/dbref.py:31:4: W0102: Dangerous default value {} as argument (dangerous-default-value) +xtquant/xtbson/bson36/dbref.py:31:35: W0622: Redefining built-in 'id' (redefined-builtin) +xtquant/xtbson/bson36/dbref.py:96:12: W0707: Consider explicitly re-raising using 'except KeyError as exc' and 'raise AttributeError(key) from exc' (raise-missing-from) +xtquant/xtbson/bson36/dbref.py:113:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/dbref.py:115:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/dbref.py:116:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/dbref.py:132:16: W0212: Access to a protected member __database of a client class (protected-access) +xtquant/xtbson/bson36/dbref.py:133:16: W0212: Access to a protected member __collection of a client class (protected-access) +xtquant/xtbson/bson36/dbref.py:134:16: W0212: Access to a protected member __id of a client class (protected-access) +xtquant/xtbson/bson36/dbref.py:135:16: W0212: Access to a protected member __kwargs of a client class (protected-access) +************* Module backtrader.xtquant.xtbson.bson36.decimal128 +xtquant/xtbson/bson36/decimal128.py:122:0: R0205: Class 'Decimal128' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/decimal128.py:245:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/decimal128.py:257:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/decimal128.py:264:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/decimal128.py:323:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.errors +xtquant/xtbson/bson36/errors.py:21:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/errors.py:25:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/errors.py:29:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/errors.py:33:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.xtquant.xtbson.bson36.max_key +xtquant/xtbson/bson36/max_key.py:17:0: R0205: Class 'MaxKey' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +************* Module backtrader.xtquant.xtbson.bson36.min_key +xtquant/xtbson/bson36/min_key.py:17:0: R0205: Class 'MinKey' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +************* Module backtrader.xtquant.xtbson.bson36.objectid +xtquant/xtbson/bson36/objectid.py:40:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/objectid.py:50:0: R0205: Class 'ObjectId' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/objectid.py:222:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/objectid.py:280:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.raw_bson +xtquant/xtbson/bson36/raw_bson.py:120:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/raw_bson.py:174:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.regex +xtquant/xtbson/bson36/regex.py:45:0: R0205: Class 'Regex' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/regex.py:85:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/regex.py:106:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/regex.py:114:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/regex.py:122:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/regex.py:139:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.son +xtquant/xtbson/bson36/son.py:95:5: W0511: TODO this is all from UserDict.DictMixin. it could probably be made more (fixme) +xtquant/xtbson/bson36/son.py:59:8: W0212: Access to a protected member __keys of a client class (protected-access) +xtquant/xtbson/bson36/son.py:66:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/son.py:67:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/son.py:89:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:100:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) +xtquant/xtbson/bson36/son.py:111:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:113:15: C2801: Unnecessarily calls dunder method __iter__. Use iter built-in function. (unnecessary-dunder-call) +xtquant/xtbson/bson36/son.py:116:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:121:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:125:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:128:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson36/son.py:163:4: C0112: Empty method docstring (empty-docstring) +xtquant/xtbson/bson36/son.py:168:12: W0707: Consider explicitly re-raising using 'except StopIteration as exc' and 'raise KeyError('container is empty') from exc' (raise-missing-from) +xtquant/xtbson/bson36/son.py:244:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/son.py:247:23: R1717: Consider using a dictionary comprehension (consider-using-dict-comprehension) +************* Module backtrader.xtquant.xtbson.bson36.timestamp +xtquant/xtbson/bson36/timestamp.py:25:0: R0205: Class 'Timestamp' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson36/timestamp.py:89:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/timestamp.py:148:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson36.__init__ +xtquant/xtbson/bson36/__init__.py:1:0: C0302: Too many lines in module (1671/1000) (too-many-lines) +************* Module backtrader.xtquant.xtbson.bson36 +xtquant/xtbson/bson36/__init__.py:94:4: W0406: Module import itself (import-self) +xtquant/xtbson/bson36/__init__.py:153:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:159:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:159:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:159:19: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:159:35: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:159:43: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:159:51: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:189:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:189:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:189:21: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:189:37: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:189:45: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:189:53: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:203:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:203:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:203:53: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson36/__init__.py:238:8: W0707: Consider explicitly re-raising using 'raise InvalidBSON(str(exc)) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:250:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:250:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:250:53: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson36/__init__.py:284:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:284:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:284:0: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/xtbson/bson36/__init__.py:308:18: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:333:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:333:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:333:22: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:333:53: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:377:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:377:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:377:19: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:377:35: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:377:43: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:377:51: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:392:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:392:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:405:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/__init__.py:409:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:392:23: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:392:39: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:392:47: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:392:55: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:412:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:412:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:412:20: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:412:36: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:412:50: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:429:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:429:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:444:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:444:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:444:44: W0613: Unused argument 'obj_end' (unused-argument) +xtquant/xtbson/bson36/__init__.py:463:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:463:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:463:37: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:463:51: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:480:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:480:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:498:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:498:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:498:25: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:498:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:498:49: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:498:57: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:513:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:513:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:513:21: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:513:37: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:513:45: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:513:53: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:527:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:527:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:527:26: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:527:42: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:527:50: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:527:58: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:584:15: W0212: Access to a protected member _element_to_dict of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:574:31: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson36/__init__.py:608:11: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:609:29: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:630:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:630:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:670:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:674:20: W0212: Access to a protected member _bson_to_dict of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:693:4: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) +xtquant/xtbson/bson36/__init__.py:716:12: W0707: Consider explicitly re-raising using 'except UnicodeError as exc' and 'raise InvalidStringData('strings in documents must be valid UTF-8: %r' % string) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:717:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:738:12: W0707: Consider explicitly re-raising using 'except UnicodeError as exc' and 'raise InvalidStringData('strings in documents must be valid UTF-8: %r' % string) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:739:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:759:31: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:759:39: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:771:31: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:771:39: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:817:20: W0212: Access to a protected member _DBRef__kwargs of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:841:30: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:841:38: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:854:32: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:854:40: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:883:34: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:883:42: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:895:30: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:895:38: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:907:34: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:907:42: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:920:23: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:920:31: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:920:39: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:943:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/__init__.py:932:31: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:932:39: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:965:30: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson36/__init__.py:992:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/__init__.py:998:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise OverflowError('BSON can only handle up to 8-byte ints') from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:983:29: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:983:37: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1001:35: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1001:43: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1025:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise OverflowError('BSON can only handle up to 8-byte ints') from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:1013:30: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1013:38: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1028:36: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1028:44: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1040:25: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1040:33: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1040:41: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1052:25: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1052:33: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1052:41: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson36/__init__.py:1112:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson36/__init__.py:1112:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson36/__init__.py:1144:30: W0212: Access to a protected member _encoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:1145:25: W0212: Access to a protected member _encoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:1168:23: W0212: Access to a protected member _fallback_encoder of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:1179:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:1194:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:1198:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:1200:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:1227:8: W0707: Consider explicitly re-raising using 'except AttributeError as exc' and 'raise TypeError('encoder expected a mapping type but got: %r' % (doc, )) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:1227:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/__init__.py:1234:20: W0212: Access to a protected member _dict_to_bson of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:1247:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/__init__.py:1401:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) from exc' (raise-missing-from) +xtquant/xtbson/bson36/__init__.py:1477:11: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson36/__init__.py:1484:4: C0415: Import outside toplevel (raw_bson.RawBSONDocument) (import-outside-toplevel) +xtquant/xtbson/bson36/__init__.py:1560:8: R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break) +xtquant/xtbson/bson36/__init__.py:1588:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtbson/bson36/__init__.py:1632:4: W0221: Number of parameters was 3 in 'bytes.decode' and is now 2 in overriding 'BSON.decode' method (arguments-differ) +************* Module backtrader.xtquant.xtbson.bson36.json_util +xtquant/xtbson/bson36/json_util.py:31:0: C0301: Line too long (176/100) (line-too-long) +xtquant/xtbson/bson36/json_util.py:32:0: C0301: Line too long (129/100) (line-too-long) +xtquant/xtbson/bson36/json_util.py:44:0: C0301: Line too long (165/100) (line-too-long) +xtquant/xtbson/bson36/json_util.py:57:0: C0301: Line too long (201/100) (line-too-long) +xtquant/xtbson/bson36/json_util.py:70:0: C0301: Line too long (165/100) (line-too-long) +xtquant/xtbson/bson36/json_util.py:1:0: C0302: Too many lines in module (1056/1000) (too-many-lines) +xtquant/xtbson/bson36/json_util.py:366:9: W0511: TODO: PYTHON-2442 use _asdict() instead (fixme) +xtquant/xtbson/bson36/json_util.py:121:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/json_util.py:121:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson36/json_util.py:159:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson36/json_util.py:159:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson36/json_util.py:254:4: W1113: Keyword argument before variable positional arguments list in the definition of __new__ function (keyword-arg-before-vararg) +xtquant/xtbson/bson36/json_util.py:297:11: E1101: Instance of 'CodecOptions' has no 'json_mode' member (no-member) +xtquant/xtbson/bson36/json_util.py:317:13: E1101: Instance of 'CodecOptions' has no 'json_mode' member (no-member) +xtquant/xtbson/bson36/json_util.py:254:4: R0912: Too many branches (15/12) (too-many-branches) +xtquant/xtbson/bson36/json_util.py:352:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:356:16: E1101: Instance of 'JSONOptions' has no 'strict_number_long' member (no-member) +xtquant/xtbson/bson36/json_util.py:357:16: E1101: Instance of 'JSONOptions' has no 'datetime_representation' member (no-member) +xtquant/xtbson/bson36/json_util.py:358:16: E1101: Instance of 'JSONOptions' has no 'strict_uuid' member (no-member) +xtquant/xtbson/bson36/json_util.py:359:16: E1101: Instance of 'JSONOptions' has no 'json_mode' member (no-member) +xtquant/xtbson/bson36/json_util.py:360:16: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson36/json_util.py:367:23: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson36/json_util.py:370:38: E1101: Instance of 'JSONOptions' has no 'strict_number_long' member (no-member) +xtquant/xtbson/bson36/json_util.py:371:43: E1101: Instance of 'JSONOptions' has no 'datetime_representation' member (no-member) +xtquant/xtbson/bson36/json_util.py:372:31: E1101: Instance of 'JSONOptions' has no 'strict_uuid' member (no-member) +xtquant/xtbson/bson36/json_util.py:373:29: E1101: Instance of 'JSONOptions' has no 'json_mode' member (no-member) +xtquant/xtbson/bson36/json_util.py:508:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/json_util.py:552:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/json_util.py:528:0: R0911: Too many return statements (20/6) (too-many-return-statements) +xtquant/xtbson/bson36/json_util.py:528:0: R0912: Too many branches (20/12) (too-many-branches) +xtquant/xtbson/bson36/json_util.py:607:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:609:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:610:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/json_util.py:652:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:671:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:674:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:678:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:694:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:740:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/json_util.py:746:11: W0212: Access to a protected member _millis_to_datetime of a client class (protected-access) +xtquant/xtbson/bson36/json_util.py:685:0: R0912: Too many branches (16/12) (too-many-branches) +xtquant/xtbson/bson36/json_util.py:756:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:768:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:780:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:792:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:795:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:801:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:824:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:825:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/json_util.py:829:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:832:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:836:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:840:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:851:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:853:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:865:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:877:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:879:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:891:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:893:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:903:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +xtquant/xtbson/bson36/json_util.py:904:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:906:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:916:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +xtquant/xtbson/bson36/json_util.py:917:8: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple) +xtquant/xtbson/bson36/json_util.py:919:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:935:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:942:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:972:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:975:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:984:17: W0212: Access to a protected member _datetime_to_millis of a client class (protected-access) +xtquant/xtbson/bson36/json_util.py:1031:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson36/json_util.py:1047:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson36/json_util.py:1056:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson36/json_util.py:948:0: R0911: Too many return statements (24/6) (too-many-return-statements) +xtquant/xtbson/bson36/json_util.py:948:0: R0912: Too many branches (38/12) (too-many-branches) +xtquant/xtbson/bson36/json_util.py:948:0: R0915: Too many statements (58/50) (too-many-statements) +************* Module backtrader.xtquant.xtbson.bson37.son +xtquant/xtbson/bson37/son.py:96:5: W0511: TODO this is all from UserDict.DictMixin. it could probably be made more (fixme) +xtquant/xtbson/bson37/son.py:65:8: W0233: __init__ method from a non direct base class 'dict' is called (non-parent-init-called) +xtquant/xtbson/bson37/son.py:73:8: W0212: Access to a protected member __keys of a client class (protected-access) +xtquant/xtbson/bson37/son.py:79:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/son.py:80:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/son.py:100:8: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) +xtquant/xtbson/bson37/son.py:103:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/son.py:106:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/son.py:107:15: C2801: Unnecessarily calls dunder method __iter__. Use iter built-in function. (unnecessary-dunder-call) +xtquant/xtbson/bson37/son.py:110:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/son.py:119:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson37/son.py:147:12: W0707: Consider explicitly re-raising using 'except StopIteration as exc' and 'raise KeyError('container is empty') from exc' (raise-missing-from) +xtquant/xtbson/bson37/son.py:199:12: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/son.py:202:23: R1717: Consider using a dictionary comprehension (consider-using-dict-comprehension) +************* Module backtrader.xtquant.xtbson.bson37.codec_options +xtquant/xtbson/bson37/codec_options.pyi:40:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:43:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/codec_options.pyi:45:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/codec_options.pyi:47:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:50:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/codec_options.pyi:52:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/codec_options.pyi:54:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:59:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:66:8: W0613: Unused argument 'type_codecs' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:67:8: W0613: Unused argument 'fallback_encoder' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:59:0: R0903: Too few public methods (1/2) (too-few-public-methods) +xtquant/xtbson/bson37/codec_options.pyi:71:0: C0103: Type variable name "_DocumentType" doesn't conform to predefined naming style (invalid-name) +xtquant/xtbson/bson37/codec_options.pyi:73:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:79:0: C0115: Missing class docstring (missing-class-docstring) +xtquant/xtbson/bson37/codec_options.pyi:88:4: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtbson/bson37/codec_options.pyi:88:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/codec_options.pyi:89:18: E0602: Undefined variable 'CodecOptions' (undefined-variable) +xtquant/xtbson/bson37/codec_options.pyi:97:9: E0602: Undefined variable 'CodecOptions' (undefined-variable) +xtquant/xtbson/bson37/codec_options.pyi:90:8: W0613: Unused argument 'document_class' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:91:8: W0613: Unused argument 'tz_aware' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:92:8: W0613: Unused argument 'uuid_representation' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:93:8: W0613: Unused argument 'unicode_decode_error_handler' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:94:8: W0613: Unused argument 'tzinfo' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:95:8: W0613: Unused argument 'type_registry' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:96:8: W0613: Unused argument 'datetime_conversion' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:100:4: C0116: Missing function or method docstring (missing-function-docstring) +xtquant/xtbson/bson37/codec_options.pyi:100:45: E0602: Undefined variable 'CodecOptions' (undefined-variable) +xtquant/xtbson/bson37/codec_options.pyi:100:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:106:37: E0602: Undefined variable 'CodecOptions' (undefined-variable) +xtquant/xtbson/bson37/codec_options.pyi:106:19: W0613: Unused argument 'obj' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:108:41: E0602: Undefined variable 'CodecOptions' (undefined-variable) +xtquant/xtbson/bson37/codec_options.pyi:108:0: W0613: Unused argument 'kwargs' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:116:24: W0613: Unused argument 'document_class' (unused-argument) +xtquant/xtbson/bson37/codec_options.pyi:117:25: W0613: Unused argument 'options' (unused-argument) +************* Module backtrader.xtquant.xtbson.bson37.__init__ +xtquant/xtbson/bson37/__init__.py:1:0: C0302: Too many lines in module (2318/1000) (too-many-lines) +************* Module backtrader.xtquant.xtbson.bson37 +xtquant/xtbson/bson37/__init__.py:131:4: W0406: Module import itself (import-self) +xtquant/xtbson/bson37/__init__.py:255:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:261:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:261:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:262:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:262:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:262:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:262:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:307:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:307:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:308:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:308:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:308:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:308:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:330:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:330:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:336:4: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson37/__init__.py:383:8: W0707: Consider explicitly re-raising using 'raise InvalidBSON(str(exc)) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:395:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:395:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:401:4: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson37/__init__.py:443:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:443:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:443:0: R0914: Too many local variables (16/15) (too-many-locals) +xtquant/xtbson/bson37/__init__.py:481:18: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:506:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:506:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:508:4: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:512:4: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:564:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:564:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:565:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:565:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:565:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:565:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:588:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:588:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:610:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/__init__.py:614:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:589:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:589:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:589:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:589:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:617:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:617:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:619:4: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:621:4: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:623:4: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:648:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:648:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:677:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:677:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:681:4: W0613: Unused argument 'obj_end' (unused-argument) +xtquant/xtbson/bson37/__init__.py:710:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:710:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:714:4: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:716:4: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:741:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:741:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:773:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:773:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:774:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:774:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:774:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:774:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:797:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:797:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:798:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:798:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:798:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:798:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:820:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:820:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:821:15: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:821:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:821:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:821:67: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:876:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:876:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:901:15: W0212: Access to a protected member _element_to_dict of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:878:8: W0613: Unused argument 'view' (unused-argument) +xtquant/xtbson/bson37/__init__.py:905:4: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:905:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:943:11: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:944:29: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:954:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:954:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:985:0: R0913: Too many arguments (7/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:985:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:1047:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1051:20: W0212: Access to a protected member _bson_to_dict of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1072:4: R1737: Use 'yield from' directly instead of yielding each element one by one (use-yield-from) +xtquant/xtbson/bson37/__init__.py:1097:12: W0707: Consider explicitly re-raising using 'except UnicodeError as exc' and 'raise InvalidStringData('strings in documents must be valid UTF-8: %r' % string) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1098:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1121:12: W0707: Consider explicitly re-raising using 'except UnicodeError as exc' and 'raise InvalidStringData('strings in documents must be valid UTF-8: %r' % string) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1122:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1144:45: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1144:58: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1161:45: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1161:58: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1226:20: W0212: Access to a protected member _DBRef__kwargs of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1257:42: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1257:55: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1275:47: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1275:60: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1316:51: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1316:63: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1333:43: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1333:56: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1351:43: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1351:56: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1371:36: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1371:49: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1390:30: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1390:43: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1390:56: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1423:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/__init__.py:1407:45: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1407:58: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1445:43: W0613: Unused argument 'dummy' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1482:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/__init__.py:1488:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise OverflowError('BSON can only handle up to 8-byte ints') from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1468:41: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1468:54: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1491:47: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1491:60: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1525:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise OverflowError('BSON can only handle up to 8-byte ints') from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1508:42: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1508:55: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1529:36: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1529:49: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1547:32: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1547:45: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1547:58: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1564:32: W0613: Unused argument 'dummy0' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1564:45: W0613: Unused argument 'dummy1' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1564:58: W0613: Unused argument 'dummy2' (unused-argument) +xtquant/xtbson/bson37/__init__.py:1630:0: R0913: Too many arguments (6/5) (too-many-arguments) +xtquant/xtbson/bson37/__init__.py:1630:0: R0917: Too many positional arguments (6/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/__init__.py:1674:30: W0212: Access to a protected member _encoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1675:25: W0212: Access to a protected member _encoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1698:23: W0212: Access to a protected member _fallback_encoder of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1709:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1731:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1735:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1737:34: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1771:8: W0707: Consider explicitly re-raising using 'except AttributeError as exc' and 'raise TypeError('encoder expected a mapping type but got: %r' % (doc, )) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1771:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/__init__.py:1778:20: W0212: Access to a protected member _dict_to_bson of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:1909:8: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) from exc' (raise-missing-from) +xtquant/xtbson/bson37/__init__.py:1913:18: W0212: Access to a protected member _decode_all of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:2016:36: W0212: Access to a protected member _array_of_documents_to_buffer of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:2075:11: W0212: Access to a protected member _decoder_map of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:2082:4: C0415: Import outside toplevel (raw_bson.RawBSONDocument) (import-outside-toplevel) +xtquant/xtbson/bson37/__init__.py:2171:8: R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break) +xtquant/xtbson/bson37/__init__.py:2201:11: W0718: Catching too general exception Exception (broad-exception-caught) +xtquant/xtbson/bson37/__init__.py:2255:4: W0221: Number of parameters was 3 in 'bytes.decode' and is now 2 in overriding 'BSON.decode' method (arguments-differ) +xtquant/xtbson/bson37/__init__.py:2309:7: W0212: Access to a protected member _inc_lock of a client class (protected-access) +xtquant/xtbson/bson37/__init__.py:2310:8: W0212: Access to a protected member _inc_lock of a client class (protected-access) +************* Module backtrader.xtquant.xtbson.bson37._helpers +xtquant/xtbson/bson37/_helpers.py:58:10: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) +************* Module backtrader.xtquant.xtbson.bson37.binary +xtquant/xtbson/bson37/binary.py:1:0: C0114: Missing module docstring (missing-module-docstring) +xtquant/xtbson/bson37/binary.py:18:0: W0105: String statement has no effect (pointless-string-statement) +xtquant/xtbson/bson37/binary.py:64:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/binary.py:64:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson37/binary.py:244:8: W0212: Access to a protected member __subtype of a client class (protected-access) +xtquant/xtbson/bson37/binary.py:335:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/binary.py:342:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise) +xtquant/xtbson/bson37/binary.py:359:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/binary.py:381:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson37/binary.py:411:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson37/binary.py:425:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.code +xtquant/xtbson/bson37/code.py:107:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/code.py:118:49: W0212: Access to a protected member __scope of a client class (protected-access) +xtquant/xtbson/bson37/codec_options.py:519:9: W0511: TODO: PYTHON-2442 use _asdict() instead (fixme) +xtquant/xtbson/bson37/codec_options.py:149:0: C0103: Type variable name "_DocumentType" doesn't conform to predefined naming style (invalid-name) +xtquant/xtbson/bson37/codec_options.py:152:0: R0205: Class 'TypeRegistry' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson37/codec_options.py:203:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/codec_options.py:217:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/codec_options.py:234:8: C0415: Import outside toplevel (._BUILT_IN_TYPES) (import-outside-toplevel) +xtquant/xtbson/bson37/codec_options.py:239:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/codec_options.py:246:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/codec_options.py:402:4: R0913: Too many arguments (8/5) (too-many-arguments) +xtquant/xtbson/bson37/codec_options.py:402:4: R0917: Too many positional arguments (8/5) (too-many-positional-arguments) +xtquant/xtbson/bson37/codec_options.py:498:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/codec_options.py:532:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.dbref +xtquant/xtbson/bson37/dbref.py:55:0: C0301: Line too long (101/100) (line-too-long) +xtquant/xtbson/bson37/dbref.py:23:0: R0205: Class 'DBRef' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson37/dbref.py:35:8: W0622: Redefining built-in 'id' (redefined-builtin) +xtquant/xtbson/bson37/dbref.py:124:12: W0707: Consider explicitly re-raising using 'except KeyError as exc' and 'raise AttributeError(key) from exc' (raise-missing-from) +xtquant/xtbson/bson37/dbref.py:143:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/dbref.py:145:19: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/dbref.py:146:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/dbref.py:164:16: W0212: Access to a protected member __database of a client class (protected-access) +xtquant/xtbson/bson37/dbref.py:165:16: W0212: Access to a protected member __collection of a client class (protected-access) +xtquant/xtbson/bson37/dbref.py:166:16: W0212: Access to a protected member __id of a client class (protected-access) +xtquant/xtbson/bson37/dbref.py:167:16: W0212: Access to a protected member __kwargs of a client class (protected-access) +************* Module backtrader.xtquant.xtbson.bson37.decimal128 +xtquant/xtbson/bson37/decimal128.py:56:0: C0103: Type alias name "_VALUE_OPTIONS" doesn't conform to predefined naming style (invalid-name) +xtquant/xtbson/bson37/decimal128.py:126:0: R0205: Class 'Decimal128' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson37/decimal128.py:251:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/decimal128.py:265:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/decimal128.py:272:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/decimal128.py:343:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.errors +xtquant/xtbson/bson37/errors.py:21:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/errors.py:25:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/errors.py:29:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/errors.py:33:0: C0112: Empty class docstring (empty-docstring) +************* Module backtrader.xtquant.xtbson.bson37.max_key +xtquant/xtbson/bson37/max_key.py:19:0: R0205: Class 'MaxKey' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +************* Module backtrader.xtquant.xtbson.bson37.min_key +xtquant/xtbson/bson37/min_key.py:19:0: R0205: Class 'MinKey' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +************* Module backtrader.xtquant.xtbson.bson37.objectid +xtquant/xtbson/bson37/objectid.py:96:0: C0301: Line too long (107/100) (line-too-long) +xtquant/xtbson/bson37/objectid.py:41:8: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/objectid.py:56:0: R0205: Class 'ObjectId' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson37/objectid.py:249:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/objectid.py:323:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.raw_bson +xtquant/xtbson/bson37/raw_bson.py:157:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/raw_bson.py:255:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.regex +xtquant/xtbson/bson37/regex.py:93:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/regex.py:117:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/regex.py:125:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/regex.py:135:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/regex.py:154:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.timestamp +xtquant/xtbson/bson37/timestamp.py:26:0: R0205: Class 'Timestamp' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance) +xtquant/xtbson/bson37/timestamp.py:106:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/timestamp.py:180:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +************* Module backtrader.xtquant.xtbson.bson37.datetime_ms +xtquant/xtbson/bson37/datetime_ms.py:64:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +xtquant/xtbson/bson37/datetime_ms.py:228:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) +xtquant/xtbson/bson37/datetime_ms.py:220:8: R1714: Consider merging these comparisons with 'in' by using 'opts.datetime_conversion in (DatetimeConversion.DATETIME, DatetimeConversion.DATETIME_CLAMP, DatetimeConversion.DATETIME_AUTO)'. Use a set instead if elements are hashable. (consider-using-in) +xtquant/xtbson/bson37/datetime_ms.py:235:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +************* Module backtrader.xtquant.xtbson.bson37.json_util +xtquant/xtbson/bson37/json_util.py:31:0: C0301: Line too long (176/100) (line-too-long) +xtquant/xtbson/bson37/json_util.py:32:0: C0301: Line too long (129/100) (line-too-long) +xtquant/xtbson/bson37/json_util.py:44:0: C0301: Line too long (165/100) (line-too-long) +xtquant/xtbson/bson37/json_util.py:57:0: C0301: Line too long (201/100) (line-too-long) +xtquant/xtbson/bson37/json_util.py:70:0: C0301: Line too long (165/100) (line-too-long) +xtquant/xtbson/bson37/json_util.py:1:0: C0302: Too many lines in module (1207/1000) (too-many-lines) +xtquant/xtbson/bson37/json_util.py:412:9: W0511: TODO: PYTHON-2442 use _asdict() instead (fixme) +xtquant/xtbson/bson37/json_util.py:137:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/json_util.py:137:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson37/json_util.py:175:0: C0112: Empty class docstring (empty-docstring) +xtquant/xtbson/bson37/json_util.py:175:0: R0903: Too few public methods (0/2) (too-few-public-methods) +xtquant/xtbson/bson37/json_util.py:283:4: W1113: Keyword argument before variable positional arguments list in the definition of __new__ function (keyword-arg-before-vararg) +xtquant/xtbson/bson37/json_util.py:283:4: R0912: Too many branches (15/12) (too-many-branches) +xtquant/xtbson/bson37/json_util.py:393:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:401:16: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson37/json_util.py:413:23: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) +xtquant/xtbson/bson37/json_util.py:448:12: E1137: 'opts' does not support item assignment (unsupported-assignment-operation) +xtquant/xtbson/bson37/json_util.py:450:29: E1134: Non-mapping value opts is used in a mapping context (not-a-mapping) +xtquant/xtbson/bson37/json_util.py:572:4: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/json_util.py:627:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/json_util.py:598:0: R0911: Too many return statements (20/6) (too-many-return-statements) +xtquant/xtbson/bson37/json_util.py:598:0: R0912: Too many branches (20/12) (too-many-branches) +xtquant/xtbson/bson37/json_util.py:687:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:689:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:690:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/json_util.py:743:23: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:767:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:770:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:774:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:795:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:841:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/json_util.py:781:0: R0912: Too many branches (18/12) (too-many-branches) +xtquant/xtbson/bson37/json_util.py:864:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:878:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:892:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:906:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:909:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:915:12: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:942:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:943:4: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/json_util.py:947:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:950:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:954:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:958:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:971:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:973:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:987:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1001:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1003:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1017:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1019:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1031:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +xtquant/xtbson/bson37/json_util.py:1032:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1034:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1046:7: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) +xtquant/xtbson/bson37/json_util.py:1047:8: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple) +xtquant/xtbson/bson37/json_util.py:1049:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1069:26: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1076:28: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1114:27: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1117:24: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1131:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/json_util.py:1182:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return) +xtquant/xtbson/bson37/json_util.py:1198:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +xtquant/xtbson/bson37/json_util.py:1207:20: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +xtquant/xtbson/bson37/json_util.py:1082:0: R0911: Too many return statements (27/6) (too-many-return-statements) +xtquant/xtbson/bson37/json_util.py:1082:0: R0912: Too many branches (41/12) (too-many-branches) +xtquant/xtbson/bson37/json_util.py:1082:0: R0915: Too many statements (62/50) (too-many-statements) +************* Module backtrader.agent +agent.py:1:0: C0114: Missing module docstring (missing-module-docstring) +agent.py:5:0: E0401: Unable to import 'yfinance' (import-error) +agent.py:6:0: E0401: Unable to import 'pydantic_ai' (import-error) +agent.py:42:4: W0613: Unused argument 'ctx' (unused-argument) +agent.py:68:4: W0613: Unused argument 'ctx' (unused-argument) +agent.py:116:21: W0621: Redefining name 'market_data' from outer scope (line 220) (redefined-outer-name) +agent.py:104:0: R0903: Too few public methods (1/2) (too-few-public-methods) +agent.py:130:0: C0112: Empty class docstring (empty-docstring) +agent.py:133:21: W0621: Redefining name 'market_data' from outer scope (line 220) (redefined-outer-name) +agent.py:130:0: R0903: Too few public methods (1/2) (too-few-public-methods) +agent.py:154:0: W0105: String statement has no effect (pointless-string-statement) +agent.py:160:0: C0112: Empty class docstring (empty-docstring) +agent.py:163:21: W0621: Redefining name 'market_data' from outer scope (line 220) (redefined-outer-name) +agent.py:160:0: R0903: Too few public methods (1/2) (too-few-public-methods) +agent.py:186:0: C0112: Empty class docstring (empty-docstring) +agent.py:186:0: W0223: Method 'decide' is abstract in class 'BaseAgent' but is not overridden in child class 'ReportAgent' (abstract-method) +agent.py:190:14: W0621: Redefining name 'positions' from outer scope (line 227) (redefined-outer-name) +agent.py:190:37: W0621: Redefining name 'pnl' from outer scope (line 228) (redefined-outer-name) +agent.py:190:49: W0621: Redefining name 'data_usage' from outer scope (line 229) (redefined-outer-name) +agent.py:203:8: W0621: Redefining name 'report' from outer scope (line 230) (redefined-outer-name) +agent.py:228:4: C0103: Constant name "pnl" doesn't conform to UPPER_CASE naming style (invalid-name) +agent.py:229:4: C0103: Constant name "data_usage" doesn't conform to UPPER_CASE naming style (invalid-name) +agent.py:230:4: C0103: Constant name "report" doesn't conform to UPPER_CASE naming style (invalid-name) +************* Module backtrader.live_backtrader +live_backtrader.py:1:0: C0114: Missing module docstring (missing-module-docstring) +live_backtrader.py:4:0: E0611: No name 'QMTStore' in module 'qmtbt' (no-name-in-module) +live_backtrader.py:10:0: C0112: Empty class docstring (empty-docstring) +live_backtrader.py:13:4: C0112: Empty method docstring (empty-docstring) +live_backtrader.py:105:0: C0112: Empty class docstring (empty-docstring) +live_backtrader.py:105:0: C0103: Class name "my_broker" doesn't conform to PascalCase naming style (invalid-name) +live_backtrader.py:122:12: C0415: Import outside toplevel (sys) (import-outside-toplevel) +live_backtrader.py:124:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:128:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:178:4: C0112: Empty method docstring (empty-docstring) +live_backtrader.py:185:0: C0112: Empty class docstring (empty-docstring) +live_backtrader.py:185:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +live_backtrader.py:196:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:220:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:222:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:232:4: C0112: Empty method docstring (empty-docstring) +live_backtrader.py:235:8: W0104: Statement seems to have no effect (pointless-statement) +live_backtrader.py:235:8: W0212: Access to a protected member _name of a client class (protected-access) +live_backtrader.py:237:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:254:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:263:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +live_backtrader.py:224:12: W0201: Attribute 'bar_executed' defined outside __init__ (attribute-defined-outside-init) +live_backtrader.py:277:18: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +live_backtrader.py:285:18: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +live_backtrader.py:304:18: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:1:0: C0114: Missing module docstring (missing-module-docstring) +strategies.py:17:0: C0112: Empty class docstring (empty-docstring) +strategies.py:20:4: C0112: Empty method docstring (empty-docstring) +strategies.py:113:0: C0112: Empty class docstring (empty-docstring) +strategies.py:113:0: C0103: Class name "my_broker" doesn't conform to PascalCase naming style (invalid-name) +strategies.py:134:16: C0415: Import outside toplevel (sys) (import-outside-toplevel) +strategies.py:136:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:139:22: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:161:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:185:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:198:4: C0112: Empty method docstring (empty-docstring) +strategies.py:198:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +strategies.py:205:0: C0112: Empty class docstring (empty-docstring) +strategies.py:205:19: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +strategies.py:221:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:242:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:244:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:253:4: C0112: Empty method docstring (empty-docstring) +strategies.py:257:21: W0212: Access to a protected member _name of a client class (protected-access) +strategies.py:258:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:268:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:273:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:246:12: W0201: Attribute 'bar_executed' defined outside __init__ (attribute-defined-outside-init) +strategies.py:277:0: C0112: Empty class docstring (empty-docstring) +strategies.py:277:22: E1101: Module 'backtrader' has no 'Strategy' member (no-member) +strategies.py:295:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:316:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:318:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:327:4: C0112: Empty method docstring (empty-docstring) +strategies.py:330:21: W0212: Access to a protected member _name of a client class (protected-access) +strategies.py:331:17: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:341:29: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:346:25: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +strategies.py:320:12: W0201: Attribute 'bar_executed' defined outside __init__ (attribute-defined-outside-init) +strategies.py:350:0: C0112: Empty class docstring (empty-docstring) +strategies.py:350:15: E1101: Module 'backtrader' has no 'SignalStrategy' member (no-member) +strategies.py:362:12: E1101: Module 'backtrader' has no 'ind' member (no-member) +strategies.py:363:12: E1101: Module 'backtrader' has no 'ind' member (no-member) +strategies.py:365:20: E1101: Module 'backtrader' has no 'ind' member (no-member) +strategies.py:366:24: E1101: Module 'backtrader' has no 'SIGNAL_LONG' member (no-member) +strategies.py:350:0: R0903: Too few public methods (0/2) (too-few-public-methods) +************* Module backtrader.try +try.py:1:0: C0114: Missing module docstring (missing-module-docstring) +try.py:5:0: E0611: No name 'QMTStore' in module 'qmtbt' (no-name-in-module) +try.py:6:0: E0401: Unable to import 'sko.GA' (import-error) +try.py:11:4: C0103: Argument name "Strategy" doesn't conform to snake_case naming style (invalid-name) +try.py:10:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +try.py:10:0: R0913: Too many arguments (7/5) (too-many-arguments) +try.py:10:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +try.py:14:14: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +try.py:36:27: W0212: Access to a protected member _getitems of a client class (protected-access) +try.py:58:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) +try.py:72:26: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +try.py:102:26: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +try.py:42:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) +try.py:123:0: W0102: Dangerous default value [] as argument (dangerous-default-value) +try.py:123:0: R0913: Too many arguments (7/5) (too-many-arguments) +try.py:123:0: R0917: Too many positional arguments (7/5) (too-many-positional-arguments) +try.py:149:18: E1101: Module 'backtrader' has no 'Cerebro' member (no-member) +try.py:153:22: E1101: Module 'backtrader' has no 'TimeFrame' member (no-member) +try.py:183:4: C0103: Class name "stra" doesn't conform to PascalCase naming style (invalid-name) +try.py:4:0: C0411: third party import "optuna" should be placed before first party import "backtrader" (wrong-import-order) +try.py:6:0: C0411: third party import "sko.GA.GA" should be placed before first party imports "backtrader", "qmtbt.QMTStore" (wrong-import-order) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1069:1381] +==backtrader.backtrader.brokers.ibbroker:[1022:1334] + self._execute(order, ago=0, price=p) + elif plimit <= phigh: + # day high above req price ... match limit price + self._execute(order, ago=0, price=plimit) + + def _try_exec_stop(self, order, popen, phigh, plow, pcreated, pclose): + """ + + :param order: + :param popen: + :param phigh: + :param plow: + :param pcreated: + :param pclose: + + """ + if order.isbuy(): + if popen >= pcreated: + # price penetrated with an open gap - use open + p = self._slip_up(phigh, popen, doslip=self.p.slip_open) + self._execute(order, ago=0, price=p) + elif phigh >= pcreated: + # price penetrated during the session - use trigger price + p = self._slip_up(phigh, pcreated) + self._execute(order, ago=0, price=p) + + else: # Sell + if popen <= pcreated: + # price penetrated with an open gap - use open + p = self._slip_down(plow, popen, doslip=self.p.slip_open) + self._execute(order, ago=0, price=p) + elif plow <= pcreated: + # price penetrated during the session - use trigger price + p = self._slip_down(plow, pcreated) + self._execute(order, ago=0, price=p) + + # not (completely) executed and trailing stop + if order.alive() and order.exectype == Order.StopTrail: + order.trailadjust(pclose) + + def _try_exec_stoplimit(self, order, popen, phigh, plow, pclose, pcreated, plimit): + """ + + :param order: + :param popen: + :param phigh: + :param plow: + :param pclose: + :param pcreated: + :param plimit: + + """ + if order.isbuy(): + if popen >= pcreated: + order.triggered = True + self._try_exec_limit(order, popen, phigh, plow, plimit) + + elif phigh >= pcreated: + # price penetrated upwards during the session + order.triggered = True + # can calculate execution for a few cases - datetime is fixed + if popen > pclose: + if plimit >= pcreated: # limit above stop trigger + p = self._slip_up(phigh, pcreated, lim=True) + self._execute(order, ago=0, price=p) + elif plimit >= pclose: + self._execute(order, ago=0, price=plimit) + else: # popen < pclose + if plimit >= pcreated: + p = self._slip_up(phigh, pcreated, lim=True) + self._execute(order, ago=0, price=p) + else: # Sell + if popen <= pcreated: + # price penetrated downwards with an open gap + order.triggered = True + self._try_exec_limit(order, popen, phigh, plow, plimit) + + elif plow <= pcreated: + # price penetrated downwards during the session + order.triggered = True + # can calculate execution for a few cases - datetime is fixed + if popen <= pclose: + if plimit <= pcreated: + p = self._slip_down(plow, pcreated, lim=True) + self._execute(order, ago=0, price=p) + elif plimit <= pclose: + self._execute(order, ago=0, price=plimit) + else: + # popen > pclose + if plimit <= pcreated: + p = self._slip_down(plow, pcreated, lim=True) + self._execute(order, ago=0, price=p) + + # not (completely) executed and trailing stop + if order.alive() and order.exectype == Order.StopTrailLimit: + order.trailadjust(pclose) + + def _slip_up(self, pmax, price, doslip=True, lim=False): + """ + + :param pmax: + :param price: + :param doslip: (Default value = True) + :param lim: (Default value = False) + + """ + if not doslip: + return price + + slip_perc = self.p.slip_perc + slip_fixed = self.p.slip_fixed + if slip_perc: + pslip = price * (1 + slip_perc) + elif slip_fixed: + pslip = price + slip_fixed + else: + return price + + if pslip <= pmax: # slipping can return price + return pslip + elif self.p.slip_match or (lim and self.p.slip_limit): + if not self.p.slip_out: + return pmax + + return pslip # non existent price + + return None # no price can be returned + + def _slip_down(self, pmin, price, doslip=True, lim=False): + """ + + :param pmin: + :param price: + :param doslip: (Default value = True) + :param lim: (Default value = False) + + """ + if not doslip: + return price + + slip_perc = self.p.slip_perc + slip_fixed = self.p.slip_fixed + if slip_perc: + pslip = price * (1 - slip_perc) + elif slip_fixed: + pslip = price - slip_fixed + else: + return price + + if pslip >= pmin: # slipping can return price + return pslip + elif self.p.slip_match or (lim and self.p.slip_limit): + if not self.p.slip_out: + return pmin + + return pslip # non existent price + + return None # no price can be returned + + def _try_exec(self, order): + """ + + :param order: + + """ + data = order.data + + popen = getattr(data, "tick_open", None) + if popen is None: + popen = data.open[0] + phigh = getattr(data, "tick_high", None) + if phigh is None: + phigh = data.high[0] + plow = getattr(data, "tick_low", None) + if plow is None: + plow = data.low[0] + pclose = getattr(data, "tick_close", None) + if pclose is None: + pclose = data.close[0] + + pcreated = order.created.price + plimit = order.created.pricelimit + + if order.exectype == Order.Market: + self._try_exec_market(order, popen, phigh, plow) + + elif order.exectype == Order.Close: + self._try_exec_close(order, pclose) + + elif order.exectype == Order.Limit: + self._try_exec_limit(order, popen, phigh, plow, pcreated) + + elif order.triggered and order.exectype in [ + Order.StopLimit, + Order.StopTrailLimit, + ]: + self._try_exec_limit(order, popen, phigh, plow, plimit) + + elif order.exectype in [Order.Stop, Order.StopTrail]: + self._try_exec_stop(order, popen, phigh, plow, pcreated, pclose) + + elif order.exectype in [Order.StopLimit, Order.StopTrailLimit]: + self._try_exec_stoplimit( + order, popen, phigh, plow, pclose, pcreated, plimit + ) + + elif order.exectype == Order.Historical: + self._try_exec_historical(order) + + def _process_fund_history(self): + """ """ + fhist = self._fundhist # [last element, iterator] + f, funds = fhist + if not f: + return self._fhistlast + + dt = f[0] # date/datetime instance + if isinstance(dt, string_types): + dtfmt = "%Y-%m-%d" + if "T" in dt: + dtfmt += "T%H:%M:%S" + if "." in dt: + dtfmt += ".%f" + dt = datetime.datetime.strptime(dt, dtfmt) + f[0] = dt # update value + + elif isinstance(dt, datetime.datetime): + pass + elif isinstance(dt, datetime.date): + dt = datetime.datetime(year=dt.year, month=dt.month, day=dt.day) + f[0] = dt # Update the value + + # Synchronization with the strategy is not possible because the broker + # is called before the strategy advances. The 2 lines below would do it + # if possible + # st0 = self.cerebro.runningstrats[0] + # if dt <= st0.datetime.datetime(): + if dt <= self.cerebro._dtmaster: + self._fhistlast = f[1:] + fhist[0] = list(next(funds, [])) + + return self._fhistlast + + def _process_order_history(self): + """ """ + for uhist in self._userhist: + uhorder, uhorders, uhnotify = uhist + while uhorder is not None: + uhorder = list(uhorder) # to support assignment (if tuple) + try: + dataidx = uhorder[3] # 2nd field + except IndexError: + dataidx = None # Field not present, use default + + if dataidx is None: + d = self.cerebro.datas[0] + elif isinstance(dataidx, integer_types): + d = self.cerebro.datas[dataidx] + else: # assume string + d = self.cerebro.datasbyname[dataidx] + + if not len(d): + break # may start later as oter data feeds + + dt = uhorder[0] # date/datetime instance + if isinstance(dt, string_types): + dtfmt = "%Y-%m-%d" + if "T" in dt: + dtfmt += "T%H:%M:%S" + if "." in dt: + dtfmt += ".%f" + dt = datetime.datetime.strptime(dt, dtfmt) + uhorder[0] = dt + elif isinstance(dt, datetime.datetime): + pass + elif isinstance(dt, datetime.date): + dt = datetime.datetime(year=dt.year, month=dt.month, day=dt.day) + uhorder[0] = dt + + if dt > d.datetime.datetime(): + break # cannot execute yet 1st in queue, stop processing + + size = uhorder[1] + price = uhorder[2] + owner = self.cerebro.runningstrats[0] + if size > 0: + o = self.buy( + owner=owner, + data=d, + size=size, + price=price, + exectype=Order.Historical, + histnotify=uhnotify, + _checksubmit=False, + ) + + elif size < 0: + o = self.sell( + owner=owner, + data=d, + size=abs(size), + price=price, + exectype=Order.Historical, + histnotify=uhnotify, + _checksubmit=False, + ) + + # update to next potential order + uhist[0] = uhorder = next(uhorders, None) + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[807:1067] +==backtrader.backtrader.brokers.ibbroker:[760:1020] + if ago is not None and price is None: + return # no psuedo exec no price - no execution + + if self.p.filler is None or ago is None: + # Order gets full size or pseudo-execution + size = order.executed.remsize + else: + # Execution depends on volume filler + size = self.p.filler(order, price, ago) + if not order.isbuy(): + size = -size + + # Get comminfo object for the data + comminfo = self.getcommissioninfo(order.data) + + # Check if something has to be compensated + if order.data._compensate is not None: + data = order.data._compensate + cinfocomp = self.getcommissioninfo(data) # for actual commission + else: + data = order.data + cinfocomp = comminfo + + # Adjust position with operation size + if ago is not None: + # Real execution with date + position = self.positions[data] + pprice_orig = position.price + + psize, pprice, opened, closed = position.pseudoupdate(size, price) + + # if part/all of a position has been closed, then there has been + # a profitandloss ... record it + pnl = comminfo.profitandloss(-closed, pprice_orig, price) + cash = self.cash + else: + pnl = 0 + if not self.p.coo: + price = pprice_orig = order.created.price + else: + # When doing cheat on open, the price to be considered for a + # market order is the opening price and not the default closing + # price with which the order was created + if order.exectype == Order.Market: + price = pprice_orig = order.data.open[0] + else: + price = pprice_orig = order.created.price + + psize, pprice, opened, closed = position.update(size, price) + + # "Closing" totally or partially is possible. Cash may be re-injected + if closed: + # Adjust to returned value for closed items & acquired opened items + if self.p.shortcash: + closedvalue = comminfo.getvaluesize(-closed, pprice_orig) + else: + closedvalue = comminfo.getoperationcost(closed, pprice_orig) + + closecash = closedvalue + if closedvalue > 0: # long position closed + closecash /= comminfo.get_leverage() # inc cash with lever + + cash += closecash + pnl * comminfo.stocklike + # Calculate and substract commission + closedcomm = comminfo.getcommission(closed, price) + cash -= closedcomm + + if ago is not None: + # Cashadjust closed contracts: prev close vs exec price + # The operation can inject or take cash out + cash += comminfo.cashadjust(-closed, position.adjbase, price) + + # Update system cash + self.cash = cash + else: + closedvalue = closedcomm = 0.0 + + popened = opened + if opened: + if self.p.shortcash: + openedvalue = comminfo.getvaluesize(opened, price) + else: + openedvalue = comminfo.getoperationcost(opened, price) + + opencash = openedvalue + if openedvalue > 0: # long position being opened + opencash /= comminfo.get_leverage() # dec cash with level + + cash -= opencash # original behavior + + openedcomm = cinfocomp.getcommission(opened, price) + cash -= openedcomm + + if cash < 0.0: + # execution is not possible - nullify + opened = 0 + openedvalue = openedcomm = 0.0 + + elif ago is not None: # real execution + if abs(psize) > abs(opened): + # some futures were opened - adjust the cash of the + # previously existing futures to the operation price and + # use that as new adjustment base, because it already is + # for the new futures At the end of the cycle the + # adjustment to the close price will be done for all open + # futures from a common base price with regards to the + # close price + adjsize = psize - opened + cash += comminfo.cashadjust(adjsize, position.adjbase, price) + + # record adjust price base for end of bar cash adjustment + position.adjbase = price + + # update system cash - checking if opened is still != 0 + self.cash = cash + else: + openedvalue = openedcomm = 0.0 + + if ago is None: + # return cash from pseudo-execution + return cash + + execsize = closed + opened + + if execsize: + # Confimrm the operation to the comminfo object + comminfo.confirmexec(execsize, price) + + # do a real position update if something was executed + position.update(execsize, price, data.datetime.datetime()) + + if closed and self.p.int2pnl: # Assign accumulated interest data + closedcomm += self.d_credit.pop(data, 0.0) + + # Execute and notify the order + order.execute( + dtcoc or data.datetime[ago], + execsize, + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, + comminfo.margin, + pnl, + psize, + pprice, + ) + + order.addcomminfo(comminfo) + + self.notify(order) + self._ococheck(order) + + if popened and not opened: + # opened was not executed - not enough cash + order.margin() + self.notify(order) + self._ococheck(order) + self._bracketize(order, cancel=True) + + def notify(self, order): + """ + + :param order: + + """ + self.notifs.append(order.clone()) + + def _try_exec_historical(self, order): + """ + + :param order: + + """ + self._execute(order, ago=0, price=order.created.price) + + def _try_exec_market(self, order, popen, phigh, plow): + """ + + :param order: + :param popen: + :param phigh: + :param plow: + + """ + if self.p.coc and order.info.get("coc", True): + dtcoc = order.created.dt + exprice = order.created.pclose + else: + if not self.p.coo and order.data.datetime[0] <= order.created.dt: + return # can only execute after creation time + + dtcoc = None + exprice = popen + + if order.isbuy(): + p = self._slip_up(phigh, exprice, doslip=self.p.slip_open) + else: + p = self._slip_down(plow, exprice, doslip=self.p.slip_open) + + self._execute(order, ago=0, price=p, dtcoc=dtcoc) + + def _try_exec_close(self, order, pclose): + """ + + :param order: + :param pclose: + + """ + # pannotated allows to keep track of the closing bar if there is no + # information which lets us know that the current bar is the closing + # bar (like matching end of session bar) + # The actual matching will be done one bar afterwards but using the + # information from the actual closing bar + + dt0 = order.data.datetime[0] + # don't use "len" -> in replay the close can be reached with same len + if dt0 > order.created.dt: # can only execute after creation time + # or (self.p.eosbar and dt0 == order.dteos): + if dt0 >= order.dteos: + # past the end of session or right at it and eosbar is True + if order.pannotated and dt0 > order.dteos: + ago = -1 + execprice = order.pannotated + else: + ago = 0 + execprice = pclose + + self._execute(order, ago=ago, price=execprice) + return + + # If no exexcution has taken place ... annotate the closing price + order.pannotated = pclose + + def _try_exec_limit(self, order, popen, phigh, plow, plimit): + """ + + :param order: + :param popen: + :param phigh: + :param plow: + :param plimit: + + """ + if order.isbuy(): + if plimit >= popen: + # open smaller/equal than requested - buy cheaper + pmax = min(phigh, plimit) + p = self._slip_up(pmax, popen, doslip=self.p.slip_open, lim=True) + self._execute(order, ago=0, price=p) + elif plimit >= plow: + # day low below req price ... match limit price + self._execute(order, ago=0, price=plimit) + + else: # Sell + if plimit <= popen: + # open greater/equal than requested - sell more expensive (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[754:964] +==backtrader.xtquant.xtbson.bson37.json_util:[862:1101] + if len(doc) != 1: + raise TypeError("Bad $oid, extra field(s): %s" % (doc,)) + return ObjectId(doc["$oid"]) + + +def _parse_canonical_symbol(doc): + """Decode a JSON symbol to Python string. + + :param doc: + + """ + symbol = doc["$symbol"] + if len(doc) != 1: + raise TypeError("Bad $symbol, extra field(s): %s" % (doc,)) + return str(symbol) + + +def _parse_canonical_code(doc): + """Decode a JSON code to bson.code.Code. + + :param doc: + + """ + for key in doc: + if key not in ("$code", "$scope"): + raise TypeError("Bad $code, extra field(s): %s" % (doc,)) + return Code(doc["$code"], scope=doc.get("$scope")) + + +def _parse_canonical_regex(doc): + """Decode a JSON regex to bson.regex.Regex. + + :param doc: + + """ + regex = doc["$regularExpression"] + if len(doc) != 1: + raise TypeError("Bad $regularExpression, extra field(s): %s" % (doc,)) + if len(regex) != 2: + raise TypeError( + 'Bad $regularExpression must include only "pattern"' + 'and "options" components: %s' % (doc,) + ) + opts = regex["options"] + if not isinstance(opts, str): + raise TypeError( + "Bad $regularExpression options, options must be string, was type %s" + % (type(opts)) + ) + return Regex(regex["pattern"], opts) + + +def _parse_canonical_dbref(doc): + """Decode a JSON DBRef to bson.dbref.DBRef. + + :param doc: + + """ + return DBRef(doc.pop("$ref"), doc.pop("$id"), database=doc.pop("$db", None), **doc) + + +def _parse_canonical_dbpointer(doc): + """Decode a JSON (deprecated) DBPointer to bson.dbref.DBRef. + + :param doc: + + """ + dbref = doc["$dbPointer"] + if len(doc) != 1: + raise TypeError("Bad $dbPointer, extra field(s): %s" % (doc,)) + if isinstance(dbref, DBRef): + dbref_doc = dbref.as_doc() + # DBPointer must not contain $db in its value. + if dbref.database is not None: + raise TypeError("Bad $dbPointer, extra field $db: %s" % (dbref_doc,)) + if not isinstance(dbref.id, ObjectId): + raise TypeError( + "Bad $dbPointer, $id must be an ObjectId: %s" % (dbref_doc,) + ) + if len(dbref_doc) != 2: + raise TypeError( + "Bad $dbPointer, extra field(s) in DBRef: %s" % (dbref_doc,) + ) + return dbref + else: + raise TypeError("Bad $dbPointer, expected a DBRef: %s" % (doc,)) + + +def _parse_canonical_int32(doc): + """Decode a JSON int32 to python int. + + :param doc: + + """ + i_str = doc["$numberInt"] + if len(doc) != 1: + raise TypeError("Bad $numberInt, extra field(s): %s" % (doc,)) + if not isinstance(i_str, str): + raise TypeError("$numberInt must be string: %s" % (doc,)) + return int(i_str) + + +def _parse_canonical_int64(doc): + """Decode a JSON int64 to bson.int64.Int64. + + :param doc: + + """ + l_str = doc["$numberLong"] + if len(doc) != 1: + raise TypeError("Bad $numberLong, extra field(s): %s" % (doc,)) + return Int64(l_str) + + +def _parse_canonical_double(doc): + """Decode a JSON double to python float. + + :param doc: + + """ + d_str = doc["$numberDouble"] + if len(doc) != 1: + raise TypeError("Bad $numberDouble, extra field(s): %s" % (doc,)) + if not isinstance(d_str, str): + raise TypeError("$numberDouble must be string: %s" % (doc,)) + return float(d_str) + + +def _parse_canonical_decimal128(doc): + """Decode a JSON decimal128 to bson.decimal128.Decimal128. + + :param doc: + + """ + d_str = doc["$numberDecimal"] + if len(doc) != 1: + raise TypeError("Bad $numberDecimal, extra field(s): %s" % (doc,)) + if not isinstance(d_str, str): + raise TypeError("$numberDecimal must be string: %s" % (doc,)) + return Decimal128(d_str) + + +def _parse_canonical_minkey(doc): + """Decode a JSON MinKey to bson.min_key.MinKey. + + :param doc: + + """ + if type(doc["$minKey"]) is not int or doc["$minKey"] != 1: + raise TypeError("$minKey value must be 1: %s" % (doc,)) + if len(doc) != 1: + raise TypeError("Bad $minKey, extra field(s): %s" % (doc,)) + return MinKey() + + +def _parse_canonical_maxkey(doc): + """Decode a JSON MaxKey to bson.max_key.MaxKey. + + :param doc: + + """ + if type(doc["$maxKey"]) is not int or doc["$maxKey"] != 1: + raise TypeError("$maxKey value must be 1: %s", (doc,)) + if len(doc) != 1: + raise TypeError("Bad $minKey, extra field(s): %s" % (doc,)) + return MaxKey() + + +def _encode_binary(data, subtype, json_options): + """ + + :param data: + :param subtype: + :param json_options: + + """ + if json_options.json_mode == JSONMode.LEGACY: + return SON( + [ + ("$binary", base64.b64encode(data).decode()), + ("$type", "%02x" % subtype), + ] + ) + return { + "$binary": SON( + [ + ("base64", base64.b64encode(data).decode()), + ("subType", "%02x" % subtype), + ] + ) + } + + +def default(obj, json_options=DEFAULT_JSON_OPTIONS): + """ + + :param obj: + :param json_options: (Default value = DEFAULT_JSON_OPTIONS) + + """ + # We preserve key order when rendering SON, DBRef, etc. as JSON by + # returning a SON for those types instead of a dict. + if isinstance(obj, ObjectId): + return {"$oid": str(obj)} + if isinstance(obj, DBRef): + return _json_convert(obj.as_doc(), json_options=json_options) + if isinstance(obj, datetime.datetime): + if json_options.datetime_representation == DatetimeRepresentation.ISO8601: + if not obj.tzinfo: + obj = obj.replace(tzinfo=utc) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.decimal128:[64:353] +==backtrader.xtquant.xtbson.bson37.decimal128:[66:384] + opts = _CTX_OPTIONS.copy() + opts["traps"] = [] + return decimal.Context(**opts) + + +def _decimal_to_128(value): + """Converts a decimal.Decimal to BID (high bits, low bits). + + :Parameters: + - `value`: An instance of decimal.Decimal + + :param value: + + """ + with decimal.localcontext(_DEC128_CTX) as ctx: + value = ctx.create_decimal(value) + + if value.is_infinite(): + return _NINF if value.is_signed() else _PINF + + sign, digits, exponent = value.as_tuple() + + if value.is_nan(): + if digits: + raise ValueError("NaN with debug payload is not supported") + if value.is_snan(): + return _NSNAN if value.is_signed() else _PSNAN + return _NNAN if value.is_signed() else _PNAN + + significand = int("".join([str(digit) for digit in digits])) + bit_length = significand.bit_length() + + high = 0 + low = 0 + for i in range(min(64, bit_length)): + if significand & (1 << i): + low |= 1 << i + + for i in range(64, bit_length): + if significand & (1 << i): + high |= 1 << (i - 64) + + biased_exponent = exponent + _EXPONENT_BIAS + + if high >> 49 == 1: + high = high & 0x7FFFFFFFFFFF + high |= _EXPONENT_MASK + high |= (biased_exponent & 0x3FFF) << 47 + else: + high |= biased_exponent << 49 + + if sign: + high |= _SIGN + + return high, low + + +class Decimal128(object): + """BSON Decimal128 type:: + + + :Parameters: + - `value`: An instance of :class:`decimal.Decimal`, string, or tuple of + (high bits, low bits) from Binary Integer Decimal (BID) format. + + .. note:: :class:`~Decimal128` uses an instance of :class:`decimal.Context` + configured for IEEE-754 Decimal128 when validating parameters. + Signals like :class:`decimal.InvalidOperation`, :class:`decimal.Inexact`, + and :class:`decimal.Overflow` are trapped and raised as exceptions:: + + + To ensure the result of a calculation can always be stored as BSON + Decimal128 use the context returned by + :func:`create_decimal128_context`:: + + + To match the behavior of MongoDB's Decimal128 implementation + str(Decimal(value)) may not match str(Decimal128(value)) for NaN values:: + + + However, :meth:`~Decimal128.to_decimal` will return the exact value:: + + + Two instances of :class:`Decimal128` compare equal if their Binary + Integer Decimal encodings are equal:: + + + This differs from :class:`decimal.Decimal` comparisons for NaN:: + + + >>> Decimal128(Decimal("0.0005")) + Decimal128('0.0005') + >>> Decimal128("0.0005") + Decimal128('0.0005') + >>> Decimal128((3474527112516337664, 5)) + Decimal128('0.0005') + + >>> Decimal128(".13.1") + Traceback (most recent call last): + File "", line 1, in + ... + decimal.InvalidOperation: [] + >>> + >>> Decimal128("1E-6177") + Traceback (most recent call last): + File "", line 1, in + ... + decimal.Inexact: [] + >>> + >>> Decimal128("1E6145") + Traceback (most recent call last): + File "", line 1, in + ... + decimal.Overflow: [, ] + + >>> import decimal + >>> decimal128_ctx = create_decimal128_context() + >>> with decimal.localcontext(decimal128_ctx) as ctx: + ... Decimal128(ctx.create_decimal(".13.3")) + ... + Decimal128('NaN') + >>> + >>> with decimal.localcontext(decimal128_ctx) as ctx: + ... Decimal128(ctx.create_decimal("1E-6177")) + ... + Decimal128('0E-6176') + >>> + >>> with decimal.localcontext(DECIMAL128_CTX) as ctx: + ... Decimal128(ctx.create_decimal("1E6145")) + ... + Decimal128('Infinity') + + >>> Decimal128(Decimal('NaN')) + Decimal128('NaN') + >>> Decimal128(Decimal('-NaN')) + Decimal128('NaN') + >>> Decimal128(Decimal('sNaN')) + Decimal128('NaN') + >>> Decimal128(Decimal('-sNaN')) + Decimal128('NaN') + + >>> Decimal128(Decimal('NaN')).to_decimal() + Decimal('NaN') + >>> Decimal128(Decimal('-NaN')).to_decimal() + Decimal('-NaN') + >>> Decimal128(Decimal('sNaN')).to_decimal() + Decimal('sNaN') + >>> Decimal128(Decimal('-sNaN')).to_decimal() + Decimal('-sNaN') + + >>> Decimal128('NaN') == Decimal128('NaN') + True + >>> Decimal128('NaN').bid == Decimal128('NaN').bid + True + + >>> Decimal('NaN') == Decimal('NaN') + False + """ + + __slots__ = ("__high", "__low") + + _type_marker = 19 + + def __init__(self, value): + """ + + :param value: + + """ + if isinstance(value, (str, decimal.Decimal)): + self.__high, self.__low = _decimal_to_128(value) + elif isinstance(value, (list, tuple)): + if len(value) != 2: + raise ValueError( + "Invalid size for creation of Decimal128 " + "from list or tuple. Must have exactly 2 " + "elements." + ) + self.__high, self.__low = value + else: + raise TypeError("Cannot convert %r to Decimal128" % (value,)) + + def to_decimal(self): + """Returns an instance of :class:`decimal.Decimal` for this + :class:`Decimal128`. + + + """ + high = self.__high + low = self.__low + sign = 1 if (high & _SIGN) else 0 + + if (high & _SNAN) == _SNAN: + return decimal.Decimal((sign, (), "N")) + elif (high & _NAN) == _NAN: + return decimal.Decimal((sign, (), "n")) + elif (high & _INF) == _INF: + return decimal.Decimal((sign, (), "F")) + + if (high & _EXPONENT_MASK) == _EXPONENT_MASK: + exponent = ((high & 0x1FFFE00000000000) >> 47) - _EXPONENT_BIAS + return decimal.Decimal((sign, (0,), exponent)) + else: + exponent = ((high & 0x7FFF800000000000) >> 49) - _EXPONENT_BIAS + + arr = bytearray(15) + mask = 0x00000000000000FF + for i in range(14, 6, -1): + arr[i] = (low & mask) >> ((14 - i) << 3) + mask = mask << 8 + + mask = 0x00000000000000FF + for i in range(6, 0, -1): + arr[i] = (high & mask) >> ((6 - i) << 3) + mask = mask << 8 + + mask = 0x0001000000000000 + arr[0] = (high & mask) >> 48 + + # cdecimal only accepts a tuple for digits. + digits = tuple(int(digit) for digit in str(int.from_bytes(arr, "big"))) + + with decimal.localcontext(_DEC128_CTX) as ctx: + return ctx.create_decimal((sign, digits, exponent)) + + @classmethod + def from_bid(cls, value): + """Create an instance of :class:`Decimal128` from Binary Integer + Decimal string. + + :Parameters: + - `value`: 16 byte string (128-bit IEEE 754-2008 decimal floating + point in Binary Integer Decimal (BID) format). + + :param value: + + """ + if not isinstance(value, bytes): + raise TypeError("value must be an instance of bytes") + if len(value) != 16: + raise ValueError("value must be exactly 16 bytes") + return cls((_UNPACK_64(value[8:])[0], _UNPACK_64(value[:8])[0])) + + @property + def bid(self): + """The Binary Integer Decimal (BID) encoding of this instance.""" + return _PACK_64(self.__low) + _PACK_64(self.__high) + + def __str__(self): + """ """ + dec = self.to_decimal() + if dec.is_nan(): + # Required by the drivers spec to match MongoDB behavior. + return "NaN" + return str(dec) + + def __repr__(self): + """ """ + return "Decimal128('%s')" % (str(self),) + + def __setstate__(self, value): + """ + + :param value: + + """ + self.__high, self.__low = value + + def __getstate__(self): + """ """ + return self.__high, self.__low + + def __eq__(self, other): + """ + + :param other: + + """ + if isinstance(other, Decimal128): + return self.bid == other.bid + return NotImplemented + + def __ne__(self, other): + """ + + :param other: + + """ + return not self == other (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[286:404] +==backtrader.xtquant.xtbson.bson37.json_util:[322:452] + if json_mode not in ( + JSONMode.LEGACY, + JSONMode.RELAXED, + JSONMode.CANONICAL, + ): + raise ValueError( + "JSONOptions.json_mode must be one of LEGACY, RELAXED, " + "or CANONICAL from JSONMode." + ) + self.json_mode = json_mode + if self.json_mode == JSONMode.RELAXED: + if strict_number_long: + raise ValueError( + "Cannot specify strict_number_long=True with JSONMode.RELAXED" + ) + if datetime_representation not in ( + None, + DatetimeRepresentation.ISO8601, + ): + raise ValueError( + "datetime_representation must be DatetimeRepresentation." + "ISO8601 or omitted with JSONMode.RELAXED" + ) + if strict_uuid not in (None, True): + raise ValueError( + "Cannot specify strict_uuid=False with JSONMode.RELAXED" + ) + self.strict_number_long = False + self.datetime_representation = DatetimeRepresentation.ISO8601 + self.strict_uuid = True + elif self.json_mode == JSONMode.CANONICAL: + if strict_number_long not in (None, True): + raise ValueError( + "Cannot specify strict_number_long=False with JSONMode.RELAXED" + ) + if datetime_representation not in ( + None, + DatetimeRepresentation.NUMBERLONG, + ): + raise ValueError( + "datetime_representation must be DatetimeRepresentation." + "NUMBERLONG or omitted with JSONMode.RELAXED" + ) + if strict_uuid not in (None, True): + raise ValueError( + "Cannot specify strict_uuid=False with JSONMode.RELAXED" + ) + self.strict_number_long = True + self.datetime_representation = DatetimeRepresentation.NUMBERLONG + self.strict_uuid = True + else: # JSONMode.LEGACY + self.strict_number_long = False + self.datetime_representation = DatetimeRepresentation.LEGACY + self.strict_uuid = False + if strict_number_long is not None: + self.strict_number_long = strict_number_long + if datetime_representation is not None: + self.datetime_representation = datetime_representation + if strict_uuid is not None: + self.strict_uuid = strict_uuid + return self + + def _arguments_repr(self): + """ """ + return ( + "strict_number_long=%r, " + "datetime_representation=%r, " + "strict_uuid=%r, json_mode=%r, %s" + % ( + self.strict_number_long, + self.datetime_representation, + self.strict_uuid, + self.json_mode, + super(JSONOptions, self)._arguments_repr(), + ) + ) + + def _options_dict(self): + """ """ + # TODO: PYTHON-2442 use _asdict() instead + options_dict = super(JSONOptions, self)._options_dict() + options_dict.update( + { + "strict_number_long": self.strict_number_long, + "datetime_representation": self.datetime_representation, + "strict_uuid": self.strict_uuid, + "json_mode": self.json_mode, + } + ) + return options_dict + + def with_options(self, **kwargs): + """Make a copy of this JSONOptions, overriding some options:: + + + .. versionadded:: 3.12 + + :param **kwargs: + + >>> from .json_util import CANONICAL_JSON_OPTIONS + >>> CANONICAL_JSON_OPTIONS.tz_aware + True + >>> json_options = CANONICAL_JSON_OPTIONS.with_options(tz_aware=False, tzinfo=None) + >>> json_options.tz_aware + False + """ + opts = self._options_dict() + for opt in ( + "strict_number_long", + "datetime_representation", + "strict_uuid", + "json_mode", + ): + opts[opt] = kwargs.get(opt, getattr(self, opt)) + opts.update(kwargs) + return JSONOptions(**opts) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[102:301] +==backtrader.xtquant.xtbson.bson37.__init__:[199:474] +BSONNUM = b"\x01" # Floating point +BSONSTR = b"\x02" # UTF-8 string +BSONOBJ = b"\x03" # Embedded document +BSONARR = b"\x04" # Array +BSONBIN = b"\x05" # Binary +BSONUND = b"\x06" # Undefined +BSONOID = b"\x07" # ObjectId +BSONBOO = b"\x08" # Boolean +BSONDAT = b"\x09" # UTC Datetime +BSONNUL = b"\x0a" # Null +BSONRGX = b"\x0b" # Regex +BSONREF = b"\x0c" # DBRef +BSONCOD = b"\x0d" # Javascript code +BSONSYM = b"\x0e" # Symbol +BSONCWS = b"\x0f" # Javascript code with scope +BSONINT = b"\x10" # 32bit int +BSONTIM = b"\x11" # Timestamp +BSONLON = b"\x12" # 64bit int +BSONDEC = b"\x13" # Decimal128 +BSONMIN = b"\xff" # Min key +BSONMAX = b"\x7f" # Max key + +_UNPACK_FLOAT_FROM = struct.Struct(" Tuple[Any, memoryview]: + """ + + :param data: + :type data: Any + :rtype: Tuple[Any,memoryview] + + """ + if isinstance(data, (bytes, bytearray)): + return data, memoryview(data) + view = memoryview(data) + return view.tobytes(), view + + +def _raise_unknown_type(element_type: int, element_name: str) -> NoReturn: + """Unknown type helper. + + :param element_type: + :type element_type: int + :param element_name: + :type element_name: str + :rtype: NoReturn + + """ + raise InvalidBSON( + "Detected unknown BSON type %r for fieldname '%s'. Are " + "you using the latest driver version?" + % (chr(element_type).encode(), element_name) + ) + + +def _get_int( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[int, int]: + """Decode a BSON int32 to python int. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[int,int] + + """ + return _UNPACK_INT_FROM(data, position)[0], position + 4 + + +def _get_c_string( + data: Any, view: Any, position: int, opts: CodecOptions +) -> Tuple[str, int]: + """Decode a BSON 'C' string to python str. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param opts: + :type opts: CodecOptions + :rtype: Tuple[str,int] + + """ + end = data.index(b"\x00", position) + return ( + _utf_8_decode(view[position:end], opts.unicode_decode_error_handler, True)[0], + end + 1, + ) + + +def _get_float( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[float, int]: + """Decode a BSON double to python float. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[float,int] + + """ + return _UNPACK_FLOAT_FROM(data, position)[0], position + 8 + + +def _get_string( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + dummy: Any, +) -> Tuple[str, int]: + """Decode a BSON string to python str. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param dummy: + :type dummy: Any + :rtype: Tuple[str,int] + + """ + length = _UNPACK_INT_FROM(data, position)[0] + position += 4 + if length < 1 or obj_end - position < length: + raise InvalidBSON("invalid string length") + end = position + length - 1 + if data[end] != 0: + raise InvalidBSON("invalid end of string") + return ( + _utf_8_decode(view[position:end], opts.unicode_decode_error_handler, True)[0], + end + 1, + ) + + +def _get_object_size(data: Any, position: int, obj_end: int) -> Tuple[int, int]: + """Validate and return a BSON document's size. + + :param data: + :type data: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :rtype: Tuple[int,int] + + """ + try: + obj_size = _UNPACK_INT_FROM(data, position)[0] + except struct.error as exc: + raise InvalidBSON(str(exc)) + end = position + obj_size - 1 + if data[end] != 0: + raise InvalidBSON("bad eoo") + if end >= obj_end: + raise InvalidBSON("invalid object length") + # If this is the top-level document, validate the total size too. + if position == 0 and obj_size != obj_end: + raise InvalidBSON("invalid object length") + return obj_size, end + + +def _get_object( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + dummy: Any, +) -> Tuple[Any, int]: + """Decode a BSON subdocument to opts.document_class or bson.dbref.DBRef. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param dummy: + :type dummy: Any + :rtype: Tuple[Any,int] + + """ + obj_size, end = _get_object_size(data, position, obj_end) + if _raw_document_class(opts.document_class): + return ( + opts.document_class(data[position: end + 1], opts), + position + obj_size, + ) + + obj = _elements_to_dict(data, view, position + 4, end, opts) + + position += obj_size + # If DBRef validation fails, return a normal doc. + if ( + isinstance(obj.get("$ref"), str) + and "$id" in obj + and isinstance(obj.get("$db"), (str, type(None))) + ): + return ( + DBRef(obj.pop("$ref"), obj.pop("$id", None), obj.pop("$db", None), obj), + position, + ) + return obj, position + + +def _get_array( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + element_name: str, +) -> Tuple[Any, int]: + """Decode a BSON array to python list. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param element_name: + :type element_name: str + :rtype: Tuple[Any,int] + + """ + size = _UNPACK_INT_FROM(data, position)[0] + end = position + size - 1 + if data[end] != 0: + raise InvalidBSON("bad eoo") + + position += 4 + end -= 1 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[464:639] +==backtrader.xtquant.xtbson.bson37.json_util:[516:725] + json_options = kwargs.pop("json_options", DEFAULT_JSON_OPTIONS) + return json.dumps(_json_convert(obj, json_options), *args, **kwargs) + + +def loads(s: str, *args: Any, **kwargs: Any) -> Any: + """Helper function that wraps :func:`json.loads`. + + Automatically passes the object_hook for BSON type conversion. + + Raises ``TypeError``, ``ValueError``, ``KeyError``, or + :exc:`~bson.errors.InvalidId` on invalid MongoDB Extended JSON. + + :Parameters: + - `json_options`: A :class:`JSONOptions` instance used to modify the + decoding of MongoDB Extended JSON types. Defaults to + :const:`DEFAULT_JSON_OPTIONS`. + + .. versionchanged:: 4.0 + Now loads :class:`datetime.datetime` instances as naive by default. To + load timezone aware instances utilize the `json_options` parameter. + See :ref:`tz_aware_default_change` for an example. + + .. versionchanged:: 3.5 + Parses Relaxed and Canonical Extended JSON as well as PyMongo's legacy + format. Now raises ``TypeError`` or ``ValueError`` when parsing JSON + type wrappers with values of the wrong type or any extra keys. + + .. versionchanged:: 3.4 + Accepts optional parameter `json_options`. See :class:`JSONOptions`. + + :param s: + :type s: str + :param *args: + :type *args: Any + :param **kwargs: + :type **kwargs: Any + :rtype: Any + + """ + json_options = kwargs.pop("json_options", DEFAULT_JSON_OPTIONS) + kwargs["object_pairs_hook"] = lambda pairs: object_pairs_hook(pairs, json_options) + return json.loads(s, *args, **kwargs) + + +def _json_convert(obj: Any, json_options: JSONOptions = DEFAULT_JSON_OPTIONS) -> Any: + """Recursive helper method that converts BSON types so they can be + converted into json. + + :param obj: + :type obj: Any + :param json_options: (Default value = DEFAULT_JSON_OPTIONS) + :type json_options: JSONOptions + :rtype: Any + + """ + if hasattr(obj, "items"): + return SON(((k, _json_convert(v, json_options)) for k, v in obj.items())) + elif hasattr(obj, "__iter__") and not isinstance(obj, (str, bytes)): + return list((_json_convert(v, json_options) for v in obj)) + try: + return default(obj, json_options) + except TypeError: + return obj + + +def object_pairs_hook( + pairs: Sequence[Tuple[str, Any]], + json_options: JSONOptions = DEFAULT_JSON_OPTIONS, +) -> Any: + """ + + :param pairs: + :type pairs: Sequence[Tuple[str, Any]] + :param json_options: (Default value = DEFAULT_JSON_OPTIONS) + :type json_options: JSONOptions + :rtype: Any + + """ + return object_hook(json_options.document_class(pairs), json_options) + + +def object_hook( + dct: Mapping[str, Any], json_options: JSONOptions = DEFAULT_JSON_OPTIONS +) -> Any: + """ + + :param dct: + :type dct: Mapping[str, Any] + :param json_options: (Default value = DEFAULT_JSON_OPTIONS) + :type json_options: JSONOptions + :rtype: Any + + """ + if "$oid" in dct: + return _parse_canonical_oid(dct) + if ( + isinstance(dct.get("$ref"), str) + and "$id" in dct + and isinstance(dct.get("$db"), (str, type(None))) + ): + return _parse_canonical_dbref(dct) + if "$date" in dct: + return _parse_canonical_datetime(dct, json_options) + if "$regex" in dct: + return _parse_legacy_regex(dct) + if "$minKey" in dct: + return _parse_canonical_minkey(dct) + if "$maxKey" in dct: + return _parse_canonical_maxkey(dct) + if "$binary" in dct: + if "$type" in dct: + return _parse_legacy_binary(dct, json_options) + else: + return _parse_canonical_binary(dct, json_options) + if "$code" in dct: + return _parse_canonical_code(dct) + if "$uuid" in dct: + return _parse_legacy_uuid(dct, json_options) + if "$undefined" in dct: + return None + if "$numberLong" in dct: + return _parse_canonical_int64(dct) + if "$timestamp" in dct: + tsp = dct["$timestamp"] + return Timestamp(tsp["t"], tsp["i"]) + if "$numberDecimal" in dct: + return _parse_canonical_decimal128(dct) + if "$dbPointer" in dct: + return _parse_canonical_dbpointer(dct) + if "$regularExpression" in dct: + return _parse_canonical_regex(dct) + if "$symbol" in dct: + return _parse_canonical_symbol(dct) + if "$numberInt" in dct: + return _parse_canonical_int32(dct) + if "$numberDouble" in dct: + return _parse_canonical_double(dct) + return dct + + +def _parse_legacy_regex(doc: Any) -> Any: + """ + + :param doc: + :type doc: Any + :rtype: Any + + """ + pattern = doc["$regex"] + # Check if this is the $regex query operator. + if not isinstance(pattern, (str, bytes)): + return doc + flags = 0 + # PyMongo always adds $options but some other tools may not. + for opt in doc.get("$options", ""): + flags |= _RE_OPT_TABLE.get(opt, 0) + return Regex(pattern, flags) + + +def _parse_legacy_uuid(doc: Any, json_options: JSONOptions) -> Union[Binary, uuid.UUID]: + """Decode a JSON legacy $uuid to Python UUID. + + :param doc: + :type doc: Any + :param json_options: + :type json_options: JSONOptions + :rtype: Union[Binary,uuid.UUID] + + """ + if len(doc) != 1: + raise TypeError("Bad $uuid, extra field(s): %s" % (doc,)) + if not isinstance(doc["$uuid"], str): + raise TypeError("$uuid must be a string: %s" % (doc,)) + if json_options.uuid_representation == UuidRepresentation.UNSPECIFIED: + return Binary.from_uuid(uuid.UUID(doc["$uuid"])) + else: + return uuid.UUID(doc["$uuid"]) + + +def _binary_or_uuid( + data: Any, subtype: int, json_options: JSONOptions +) -> Union[Binary, uuid.UUID]: + """ + + :param data: + :type data: Any + :param subtype: + :type subtype: int + :param json_options: + :type json_options: JSONOptions + :rtype: Union[Binary,uuid.UUID] + + """ + # special handling for UUID + if subtype in ALL_UUID_SUBTYPES: + uuid_representation = json_options.uuid_representation + binary_value = Binary(data, subtype) + if uuid_representation == UuidRepresentation.UNSPECIFIED: + return binary_value + if subtype == UUID_SUBTYPE: + # Legacy behavior: use STANDARD with binary subtype 4. + uuid_representation = UuidRepresentation.STANDARD + elif uuid_representation == UuidRepresentation.STANDARD: + # subtype == OLD_UUID_SUBTYPE + # Legacy behavior: STANDARD is the same as PYTHON_LEGACY. + uuid_representation = UuidRepresentation.PYTHON_LEGACY + return binary_value.as_uuid(uuid_representation) + + if subtype == 0: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[645:849] +==backtrader.xtquant.xtbson.bson37.__init__:[1019:1270] + result[key] = value + if position != obj_end: + raise InvalidBSON("bad object or element length") + return result + + +def _bson_to_dict(data: Any, opts: CodecOptions) -> Any: + """Decode a BSON string to document_class. + + :param data: + :type data: Any + :param opts: + :type opts: CodecOptions + :rtype: Any + + """ + data, view = get_data_and_view(data) + try: + if _raw_document_class(opts.document_class): + return opts.document_class(data, opts) + _, end = _get_object_size(data, 0, len(data)) + return _elements_to_dict(data, view, 4, end, opts) + except InvalidBSON: + raise + except Exception: + # Change exception type to InvalidBSON but preserve traceback. + _, exc_value, exc_tb = sys.exc_info() + raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) + + +if _USE_C: + _bson_to_dict = _cbson._bson_to_dict # noqa: F811 + +_PACK_FLOAT = struct.Struct(" Generator[bytes, None, None]: + """Generate "keys" for encoded lists in the sequence + b"0\x00", b"1\x00", b"2\x00", ... + + The first 1000 keys are returned from a pre-built cache. All + subsequent keys are generated on the fly. + + + :rtype: Generator[bytes,None,None] + + """ + for name in _LIST_NAMES: + yield name + + counter = itertools.count(1000) + while True: + yield (str(next(counter)) + "\x00").encode("utf8") + + +def _make_c_string_check(string: Union[str, bytes]) -> bytes: + """Make a 'C' string, checking for embedded NUL characters. + + :param string: + :type string: Union[str, bytes] + :rtype: bytes + + """ + if isinstance(string, bytes): + if b"\x00" in string: + raise InvalidDocument( + "BSON keys / regex patterns must not contain a NUL character" + ) + try: + _utf_8_decode(string, None, True) + return string + b"\x00" + except UnicodeError: + raise InvalidStringData( + "strings in documents must be valid UTF-8: %r" % string + ) + else: + if "\x00" in string: + raise InvalidDocument( + "BSON keys / regex patterns must not contain a NUL character" + ) + return _utf_8_encode(string)[0] + b"\x00" + + +def _make_c_string(string: Union[str, bytes]) -> bytes: + """Make a 'C' string. + + :param string: + :type string: Union[str, bytes] + :rtype: bytes + + """ + if isinstance(string, bytes): + try: + _utf_8_decode(string, None, True) + return string + b"\x00" + except UnicodeError: + raise InvalidStringData( + "strings in documents must be valid UTF-8: %r" % string + ) + else: + return _utf_8_encode(string)[0] + b"\x00" + + +def _make_name(string: str) -> bytes: + """Make a 'C' string suitable for a BSON key. + + :param string: + :type string: str + :rtype: bytes + + """ + # Keys can only be text in python 3. + if "\x00" in string: + raise InvalidDocument( + "BSON keys / regex patterns must not contain a NUL character" + ) + return _utf_8_encode(string)[0] + b"\x00" + + +def _encode_float(name: bytes, value: float, dummy0: Any, dummy1: Any) -> bytes: + """Encode a float. + + :param name: + :type name: bytes + :param value: + :type value: float + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + return b"\x01" + name + _PACK_FLOAT(value) + + +def _encode_bytes(name: bytes, value: bytes, dummy0: Any, dummy1: Any) -> bytes: + """Encode a python bytes. + + :param name: + :type name: bytes + :param value: + :type value: bytes + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + # Python3 special case. Store 'bytes' as BSON binary subtype 0. + return b"\x05" + name + _PACK_INT(len(value)) + b"\x00" + value + + +def _encode_mapping( + name: bytes, value: Any, check_keys: bool, opts: CodecOptions +) -> bytes: + """Encode a mapping type. + + :param name: + :type name: bytes + :param value: + :type value: Any + :param check_keys: + :type check_keys: bool + :param opts: + :type opts: CodecOptions + :rtype: bytes + + """ + if _raw_document_class(value): + return b"\x03" + name + value.raw + data = b"".join( + [_element_to_bson(key, val, check_keys, opts) for key, val in value.items()] + ) + return b"\x03" + name + _PACK_INT(len(data) + 5) + data + b"\x00" + + +def _encode_dbref( + name: bytes, value: DBRef, check_keys: bool, opts: CodecOptions +) -> bytes: + """Encode bson.dbref.DBRef. + + :param name: + :type name: bytes + :param value: + :type value: DBRef + :param check_keys: + :type check_keys: bool + :param opts: + :type opts: CodecOptions + :rtype: bytes + + """ + buf = bytearray(b"\x03" + name + b"\x00\x00\x00\x00") + begin = len(buf) - 4 + + buf += _name_value_to_bson(b"$ref\x00", value.collection, check_keys, opts) + buf += _name_value_to_bson(b"$id\x00", value.id, check_keys, opts) + if value.database is not None: + buf += _name_value_to_bson(b"$db\x00", value.database, check_keys, opts) + for key, val in value._DBRef__kwargs.items(): + buf += _element_to_bson(key, val, check_keys, opts) + + buf += b"\x00" + buf[begin: begin + 4] = _PACK_INT(len(buf) - begin) + return bytes(buf) + + +def _encode_list( + name: bytes, value: Sequence[Any], check_keys: bool, opts: CodecOptions +) -> bytes: + """Encode a list/tuple. + + :param name: + :type name: bytes + :param value: + :type value: Sequence[Any] + :param check_keys: + :type check_keys: bool + :param opts: + :type opts: CodecOptions + :rtype: bytes + + """ + lname = gen_list_name() + data = b"".join( + [_name_value_to_bson(next(lname), item, check_keys, opts) for item in value] + ) + return b"\x04" + name + _PACK_INT(len(data) + 5) + data + b"\x00" + + +def _encode_text(name: bytes, value: str, dummy0: Any, dummy1: Any) -> bytes: + """Encode a python str. + + :param name: + :type name: bytes + :param value: + :type value: str + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[236:352] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[114:231] + if self.order: + return + + # 获取当前beta值 + current_beta = self.data2.beta[0] + + # 处理缺失beta情况 + if pd.isna(current_beta) or current_beta <= 0: + return + + # 动态设置交易规模 + self.size0 = 10 # 固定J的规模 + self.size1 = round(current_beta * 10) # 根据beta调整JM的规模 + + # 打印调试信息 + if self.p.verbose and len(self) % 20 == 0: # 每20个bar打印一次,减少输出 + print( + f"{self.datetime.date()}: beta={current_beta}, J:{self.size0}手," + f" JM:{self.size1}手" + ) + + # 使用分位数指标进行交易决策 + spread = self.data2.close[0] + upper_band = self.quantile.upper[0] + lower_band = self.quantile.lower[0] + mid_band = self.quantile.mid[0] + pos = self.getposition(self.data0).size + + # 开平仓逻辑 + if pos == 0: # 没有持仓 + if spread > upper_band: + # 价差高于上轨,做空价差(做多J,做空JM) + self._open_position(short=True) + elif spread < lower_band: + # 价差低于下轨,做多价差(做空J,做多JM) + self._open_position(short=False) + else: # 已有持仓 + # 自动加仓逻辑 + if self.position_layers < self.p.max_positions: + # 多头加仓条件 + if pos > 0: + # 以lower_band为基准,spread越低越加仓 + next_layer = self.position_layers + 1 + add_threshold = ( + lower_band + - next_layer + * self.p.add_position_threshold + * (upper_band - lower_band) + ) + if spread < add_threshold: + self._add_position(short=False) + # 空头加仓条件 + elif pos < 0: + # 以upper_band为基准,spread越高越加仓 + next_layer = self.position_layers + 1 + add_threshold = ( + upper_band + + next_layer + * self.p.add_position_threshold + * (upper_band - lower_band) + ) + if spread > add_threshold: + self._add_position(short=True) + # 平仓逻辑 + if pos > 0 and spread >= mid_band: # 持有多头且价差回归到中位数 + self._close_positions() + elif pos < 0 and spread <= mid_band: # 持有空头且价差回归到中位数 + self._close_positions() + + def _open_position(self, short): + """动态配比下单""" + # 确认交易规模有效 + if not hasattr(self, "size0") or not hasattr(self, "size1"): + self.size0 = 10 # 默认值 + self.size1 = ( + round(self.data2.beta[0] * 10) + if not pd.isna(self.data2.beta[0]) + else 14 + ) + + # 检查资金是否足够 + cash = self.broker.getcash() + cost = self.size0 * self.data0.close[0] + self.size1 * self.data1.close[0] + if cash < cost: + if self.p.verbose: + print(f"资金不足,无法开仓: 需要{cost:.2f},可用{cash:.2f}") + return + + if short: + if self.p.verbose: + print(f"做多J {self.size0}手, 做空JM {self.size1}手") + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + self.entry_direction = "short" + else: + if self.p.verbose: + print(f"做空J {self.size0}手, 做多JM {self.size1}手") + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + self.entry_direction = "long" + self.entry_price = self.data2.close[0] + self.position_layers = 1 # 首次开仓为第一层 + + def _add_position(self, short): + """加仓,自动套利配比,资金检查""" + # 计算加仓规模(每层同等规模,也可自定义递减) + add_size0 = self.size0 + add_size1 = self.size1 + # 检查资金 + cash = self.broker.getcash() + cost = add_size0 * self.data0.close[0] + add_size1 * self.data1.close[0] + if cash < cost: + if self.p.verbose: + print(f"资金不足,无法加仓: 需要{cost:.2f},可用{cash:.2f}") + return + if short: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[477:652] +==backtrader.backtrader.brokers.ibbroker:[522:701] + return self.positions[data] + + def orderstatus(self, order): + """ + + :param order: + + """ + try: + o = self.orders.index(order) + except ValueError: + o = order + + return o.status + + def _take_children(self, order): + """ + + :param order: + + """ + oref = order.ref + pref = getattr(order.parent, "ref", oref) # parent ref or self + + if oref != pref: + if pref not in self._pchildren: + order.reject() # parent not there - may have been rejected + self.notify(order) # reject child, notify + return None + + return pref + + def submit(self, order, check=True): + """ + + :param order: + :param check: (Default value = True) + + """ + pref = self._take_children(order) + if pref is None: # order has not been taken + return order + + pc = self._pchildren[pref] + pc.append(order) # store in parent/children queue + + if order.transmit: # if single order, sent and queue cleared + # if parent-child, the parent will be sent, the other kept + rets = [self.transmit(x, check=check) for x in pc] + return rets[-1] # last one is the one triggering transmission + + return order + + def transmit(self, order, check=True): + """ + + :param order: + :param check: (Default value = True) + + """ + if check and self.p.checksubmit: + order.submit() + self.submitted.append(order) + self.orders.append(order) + self.notify(order) + else: + self.submit_accept(order) + + return order + + def check_submitted(self): + """ """ + cash = self.cash + positions = dict() + + while self.submitted: + order = self.submitted.popleft() + + if self._take_children(order) is None: # children not taken + continue + + self.getcommissioninfo(order.data) + + position = positions.setdefault( + order.data, self.positions[order.data].clone() + ) + + # pseudo-execute the order to get the remaining cash after exec + cash = self._execute(order, cash=cash, position=position) + + if cash >= 0.0: + self.submit_accept(order) + continue + + order.margin() + self.notify(order) + self._ococheck(order) + self._bracketize(order, cancel=True) + + def submit_accept(self, order): + """ + + :param order: + + """ + order.pannotated = None + order.submit() + order.accept() + self.pending.append(order) + self.notify(order) + + def _bracketize(self, order, cancel=False): + """ + + :param order: + :param cancel: (Default value = False) + + """ + oref = order.ref + pref = getattr(order.parent, "ref", oref) + parent = oref == pref + + pc = self._pchildren[pref] # defdict - guaranteed + if cancel or not parent: # cancel left or child exec -> cancel other + while pc: + self.cancel(pc.popleft(), bracket=True) # idempotent + + del self._pchildren[pref] # defdict guaranteed + + else: # not cancel -> parent exec'd + pc.popleft() # remove parent + for o in pc: # activate childnre + self._toactivate.append(o) + + def _ococheck(self, order): + """ + + :param order: + + """ + # ocoref = self._ocos[order.ref] or order.ref # a parent or self + parentref = self._ocos[order.ref] + ocoref = self._ocos.get(parentref, None) + ocol = self._ocol.pop(ocoref, None) + if ocol: + for i in range(len(self.pending) - 1, -1, -1): + o = self.pending[i] + if o is not None and o.ref in ocol: + del self.pending[i] + o.cancel() + self.notify(o) + + def _ocoize(self, order, oco): + """ + + :param order: + :param oco: + + """ + oref = order.ref + if oco is None: + self._ocos[oref] = oref # current order is parent + self._ocol[oref].append(oref) # create ocogroup + else: + ocoref = self._ocos[oco.ref] # ref to group leader + self._ocos[oref] = ocoref # ref to group leader + self._ocol[ocoref].append(oref) # add to group + + def _makeorder(self, action, owner, data, size, **kwargs): + """开仓必须使用BKT bracketOrder 套利单 + 平仓必须使用LMT limitOrder 限价单 + + :param action: + :param owner: + :param data: + :param size: + :param **kwargs: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1072:1215] +==backtrader.xtquant.xtbson.bson37.__init__:[1590:1759] + dict: _encode_mapping, + float: _encode_float, + int: _encode_int, + list: _encode_list, + str: _encode_text, + tuple: _encode_list, + type(None): _encode_none, + uuid.UUID: _encode_uuid, + Binary: _encode_binary, + Int64: _encode_long, + Code: _encode_code, + DBRef: _encode_dbref, + MaxKey: _encode_maxkey, + MinKey: _encode_minkey, + ObjectId: _encode_objectid, + Regex: _encode_regex, + RE_TYPE: _encode_regex, + SON: _encode_mapping, + Timestamp: _encode_timestamp, + Decimal128: _encode_decimal128, + # Special case. This will never be looked up directly. + _abc.Mapping: _encode_mapping, +} + +_MARKERS = { + 5: _encode_binary, + 7: _encode_objectid, + 11: _encode_regex, + 13: _encode_code, + 17: _encode_timestamp, + 18: _encode_long, + 100: _encode_dbref, + 127: _encode_maxkey, + 255: _encode_minkey, +} + +_BUILT_IN_TYPES = tuple(t for t in _ENCODERS) + + +def _name_value_to_bson( + name, value, check_keys, opts, in_custom_call=False, in_fallback_call=False +): + """Encode a single name, value pair. + + :param name: + :param value: + :param check_keys: + :param opts: + :param in_custom_call: (Default value = False) + :param in_fallback_call: (Default value = False) + + """ + # First see if the type is already cached. KeyError will only ever + # happen once per subtype. + try: + return _ENCODERS[type(value)](name, value, check_keys, opts) + except KeyError: + pass + + # Second, fall back to trying _type_marker. This has to be done + # before the loop below since users could subclass one of our + # custom types that subclasses a python built-in (e.g. Binary) + marker = getattr(value, "_type_marker", None) + if isinstance(marker, int) and marker in _MARKERS: + func = _MARKERS[marker] + # Cache this type for faster subsequent lookup. + _ENCODERS[type(value)] = func + return func(name, value, check_keys, opts) + + # Third, check if a type encoder is registered for this type. + # Note that subtypes of registered custom types are not auto-encoded. + if not in_custom_call and opts.type_registry._encoder_map: + custom_encoder = opts.type_registry._encoder_map.get(type(value)) + if custom_encoder is not None: + return _name_value_to_bson( + name, + custom_encoder(value), + check_keys, + opts, + in_custom_call=True, + ) + + # Fourth, test each base type. This will only happen once for + # a subtype of a supported base type. Unlike in the C-extensions, this + # is done after trying the custom type encoder because checking for each + # subtype is expensive. + for base in _BUILT_IN_TYPES: + if isinstance(value, base): + func = _ENCODERS[base] + # Cache this type for faster subsequent lookup. + _ENCODERS[type(value)] = func + return func(name, value, check_keys, opts) + + # As a last resort, try using the fallback encoder, if the user has + # provided one. + fallback_encoder = opts.type_registry._fallback_encoder + if not in_fallback_call and fallback_encoder is not None: + return _name_value_to_bson( + name, + fallback_encoder(value), + check_keys, + opts, + in_fallback_call=True, + ) + + raise InvalidDocument( + "cannot encode object: %r, of type: %r" % (value, type(value)) + ) + + +def _element_to_bson(key, value, check_keys, opts): + """Encode a single key, value pair. + + :param key: + :param value: + :param check_keys: + :param opts: + + """ + if not isinstance(key, str): + raise InvalidDocument( + "documents must have only string keys, key was %r" % (key,) + ) + if check_keys: + if key.startswith("$"): + raise InvalidDocument("key %r must not start with '$'" % (key,)) + if "." in key: + raise InvalidDocument("key %r must not contain '.'" % (key,)) + + name = _make_name(key) + return _name_value_to_bson(name, value, check_keys, opts) + + +def _dict_to_bson(doc, check_keys, opts, top_level=True): + """Encode a document to BSON. + + :param doc: + :param check_keys: + :param opts: + :param top_level: (Default value = True) + + """ + if _raw_document_class(doc): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[304:547] +==backtrader.xtquant.xtbson.bson37.__init__:[477:849] + append = result.append + index = data.index + getter = _ELEMENT_GETTER + decoder_map = opts.type_registry._decoder_map + + while position < end: + element_type = data[position] + # Just skip the keys. + position = index(b"\x00", position) + 1 + try: + value, position = getter[element_type]( + data, view, position, obj_end, opts, element_name + ) + except KeyError: + _raise_unknown_type(element_type, element_name) + + if decoder_map: + custom_decoder = decoder_map.get(type(value)) + if custom_decoder is not None: + value = custom_decoder(value) + + append(value) + + if position != end + 1: + raise InvalidBSON("bad array length") + return result, position + 1 + + +def _get_binary( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + dummy1: Any, +) -> Tuple[Union[Binary, uuid.UUID], int]: + """Decode a BSON binary to bson.binary.Binary or python UUID. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param dummy1: + :type dummy1: Any + :rtype: Tuple[Union[Binary,uuid.UUID],int] + + """ + length, subtype = _UNPACK_LENGTH_SUBTYPE_FROM(data, position) + position += 5 + if subtype == 2: + length2 = _UNPACK_INT_FROM(data, position)[0] + position += 4 + if length2 != length - 4: + raise InvalidBSON("invalid binary (st 2) - lengths don't match!") + length = length2 + end = position + length + if length < 0 or end > obj_end: + raise InvalidBSON("bad binary object length") + + # Convert UUID subtypes to native UUIDs. + if subtype in ALL_UUID_SUBTYPES: + uuid_rep = opts.uuid_representation + binary_value = Binary(data[position:end], subtype) + if ( + (uuid_rep == UuidRepresentation.UNSPECIFIED) + or (subtype == UUID_SUBTYPE and uuid_rep != STANDARD) + or (subtype == OLD_UUID_SUBTYPE and uuid_rep == STANDARD) + ): + return binary_value, end + return binary_value.as_uuid(uuid_rep), end + + # Decode subtype 0 to 'bytes'. + if subtype == 0: + value = data[position:end] + else: + value = Binary(data[position:end], subtype) + + return value, end + + +def _get_oid( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[ObjectId, int]: + """Decode a BSON ObjectId to bson.objectid.ObjectId. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[ObjectId,int] + + """ + end = position + 12 + return ObjectId(data[position:end]), end + + +def _get_boolean( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[bool, int]: + """Decode a BSON true/false to python True/False. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[bool,int] + + """ + end = position + 1 + boolean_byte = data[position:end] + if boolean_byte == b"\x00": + return False, end + elif boolean_byte == b"\x01": + return True, end + raise InvalidBSON("invalid boolean value: %r" % boolean_byte) + + +def _get_date( + data: Any, + view: Any, + position: int, + dummy0: int, + opts: CodecOptions, + dummy1: Any, +) -> Tuple[Union[datetime.datetime, DatetimeMS], int]: + """Decode a BSON datetime to python datetime.datetime. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: int + :param opts: + :type opts: CodecOptions + :param dummy1: + :type dummy1: Any + :rtype: Tuple[Union[datetime.datetime,DatetimeMS],int] + + """ + return ( + _millis_to_datetime(_UNPACK_LONG_FROM(data, position)[0], opts), + position + 8, + ) + + +def _get_code( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + element_name: str, +) -> Tuple[Code, int]: + """Decode a BSON code to bson.code.Code. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param element_name: + :type element_name: str + :rtype: Tuple[Code,int] + + """ + code, position = _get_string(data, view, position, obj_end, opts, element_name) + return Code(code), position + + +def _get_code_w_scope( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + element_name: str, +) -> Tuple[Code, int]: + """Decode a BSON code_w_scope to bson.code.Code. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param element_name: + :type element_name: str + :rtype: Tuple[Code,int] + + """ + code_end = position + _UNPACK_INT_FROM(data, position)[0] + code, position = _get_string(data, view, position + 4, code_end, opts, element_name) + scope, position = _get_object(data, view, position, code_end, opts, element_name) + if position != code_end: + raise InvalidBSON("scope outside of javascript code boundaries") + return Code(code, scope), position + + +def _get_regex( + data: Any, + view: Any, + position: int, + dummy0: Any, + opts: CodecOptions, + dummy1: Any, +) -> Tuple[Regex, int]: + """Decode a BSON regex to bson.regex.Regex or a python pattern object. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param opts: + :type opts: CodecOptions + :param dummy1: + :type dummy1: Any + :rtype: Tuple[Regex,int] + + """ + pattern, position = _get_c_string(data, view, position, opts) + bson_flags, position = _get_c_string(data, view, position, opts) + bson_re = Regex(pattern, bson_flags) + return bson_re, position + + +def _get_ref( + data: Any, + view: Any, + position: int, + obj_end: int, + opts: CodecOptions, + element_name: str, +) -> Tuple[DBRef, int]: + """Decode (deprecated) BSON DBPointer to bson.dbref.DBRef. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param obj_end: + :type obj_end: int + :param opts: + :type opts: CodecOptions + :param element_name: + :type element_name: str + :rtype: Tuple[DBRef,int] + + """ + collection, position = _get_string( + data, view, position, obj_end, opts, element_name + ) + oid, position = _get_oid(data, view, position, obj_end, opts, element_name) + return DBRef(collection, oid), position + + +def _get_timestamp( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[Timestamp, int]: + """Decode a BSON timestamp to bson.timestamp.Timestamp. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[Timestamp,int] + + """ + inc, timestamp = _UNPACK_TIMESTAMP_FROM(data, position) + return Timestamp(timestamp, inc), position + 8 + + +def _get_int64( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[Int64, int]: + """Decode a BSON int64 to bson.int64.Int64. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[Int64,int] + + """ + return Int64(_UNPACK_LONG_FROM(data, position)[0]), position + 8 + + +def _get_decimal128( + data: Any, view: Any, position: int, dummy0: Any, dummy1: Any, dummy2: Any +) -> Tuple[Decimal128, int]: + """Decode a BSON decimal128 to bson.decimal128.Decimal128. + + :param data: + :type data: Any + :param view: + :type view: Any + :param position: + :type position: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: Tuple[Decimal128,int] + + """ + end = position + 16 + return Decimal128.from_bid(data[position:end]), end + + +# Each decoder function's signature is: +# - data: bytes +# - view: memoryview that references `data` +# - position: int, beginning of object in 'data' to decode +# - obj_end: int, end of object to decode in 'data' if variable-length type +# - opts: a CodecOptions (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[145:259] +==backtrader.samples.psar.psar:[56:170] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[153:259] +==backtrader.samples.timers.scheduled:[137:243] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.objectid:[145:344] +==backtrader.xtquant.xtbson.bson37.objectid:[158:404] + timestamp = calendar.timegm(generation_time.timetuple()) + oid = struct.pack(">I", int(timestamp)) + b"\x00\x00\x00\x00\x00\x00\x00\x00" + return cls(oid) + + @classmethod + def is_valid(cls: Type["ObjectId"], oid: Any) -> bool: + """Checks if a `oid` string is valid or not. + + :Parameters: + - `oid`: the object id to validate + + .. versionadded:: 2.3 + + :param oid: + :type oid: Any + :rtype: bool + + """ + if not oid: + return False + + try: + ObjectId(oid) + return True + except (InvalidId, TypeError): + return False + + @classmethod + def _random(cls) -> bytes: + """Generate a 5-byte random number once per process. + + + :rtype: bytes + + """ + pid = os.getpid() + if pid != cls._pid: + cls._pid = pid + cls.__random = _random_bytes() + return cls.__random + + def __generate(self) -> None: + """Generate a new value for this ObjectId. + + + :rtype: None + + """ + + # 4 bytes current time + oid = struct.pack(">I", int(time.time())) + + # 5 bytes random + oid += ObjectId._random() + + # 3 bytes inc + with ObjectId._inc_lock: + oid += struct.pack(">I", ObjectId._inc)[1:4] + ObjectId._inc = (ObjectId._inc + 1) % (_MAX_COUNTER_VALUE + 1) + + self.__id = oid + + def __validate(self, oid: Any) -> None: + """Validate and use the given id for this ObjectId. + + Raises TypeError if id is not an instance of + (:class:`basestring` (:class:`str` or :class:`bytes` + in python 3), ObjectId) and InvalidId if it is not a + valid ObjectId. + + :Parameters: + - `oid`: a valid ObjectId + + :param oid: + :type oid: Any + :rtype: None + + """ + if isinstance(oid, ObjectId): + self.__id = oid.binary + elif isinstance(oid, str): + if len(oid) == 24: + try: + self.__id = bytes.fromhex(oid) + except (TypeError, ValueError): + _raise_invalid_id(oid) + else: + _raise_invalid_id(oid) + else: + raise TypeError( + "id must be an instance of (bytes, str, ObjectId), not %s" + % (type(oid),) + ) + + @property + def binary(self) -> bytes: + """12-byte binary representation of this ObjectId. + + + :rtype: bytes + + """ + return self.__id + + @property + def generation_time(self) -> datetime.datetime: + """A :class:`datetime.datetime` instance representing the time of + generation for this :class:`ObjectId`. + + The :class:`datetime.datetime` is timezone aware, and + represents the generation time in UTC. It is precise to the + second. + + + :rtype: datetime.datetime + + """ + timestamp = struct.unpack(">I", self.__id[0:4])[0] + return datetime.datetime.fromtimestamp(timestamp, utc) + + def __getstate__(self) -> bytes: + """ + + + :returns: needed explicitly because __slots__() defined. + + :rtype: bytes + + """ + return self.__id + + def __setstate__(self, value: Any) -> None: + """explicit state set from pickling + + :param value: + :type value: Any + :rtype: None + + """ + # Provide backwards compatability with OIDs + # pickled with pymongo-1.9 or older. + if isinstance(value, dict): + oid = value["_ObjectId__id"] + else: + oid = value + # ObjectIds pickled in python 2.x used `str` for __id. + # In python 3.x this has to be converted to `bytes` + # by encoding latin-1. + if isinstance(oid, str): + self.__id = oid.encode("latin-1") + else: + self.__id = oid + + def __str__(self) -> str: + """ + + + :rtype: str + + """ + return binascii.hexlify(self.__id).decode() + + def __repr__(self): + """ """ + return "ObjectId('%s')" % (str(self),) + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id == other.binary + return NotImplemented + + def __ne__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id != other.binary + return NotImplemented + + def __lt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id < other.binary + return NotImplemented + + def __le__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id <= other.binary + return NotImplemented + + def __gt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id > other.binary + return NotImplemented + + def __ge__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, ObjectId): + return self.__id >= other.binary + return NotImplemented + + def __hash__(self) -> int: + """Get a hash value for this :class:`ObjectId`. + + + :rtype: int + + """ + return hash(self.__id) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[167:246] +==backtrader.samples.tradingcalendar.tcal:[169:248] + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="2016-01-01", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2016-12-31", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + pgroup = parser.add_mutually_exclusive_group(required=False) + pgroup.add_argument( + "--pandascal", + required=False, + action="store", + default="", + help="Name of trading calendar to use", + ) + + pgroup.add_argument( + "--owncal", + required=False, + action="store_true", + help="Apply custom NYSE 2016 calendar", + ) + + parser.add_argument( + "--timeframe", + required=False, + action="store", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[987:1056] +==backtrader.xtquant.xtbson.bson37.json_util:[1138:1207] + if json_options.strict_number_long and isinstance(obj, Int64): + return {"$numberLong": str(obj)} + if isinstance(obj, (RE_TYPE, Regex)): + flags = "" + if obj.flags & re.IGNORECASE: + flags += "i" + if obj.flags & re.LOCALE: + flags += "l" + if obj.flags & re.MULTILINE: + flags += "m" + if obj.flags & re.DOTALL: + flags += "s" + if obj.flags & re.UNICODE: + flags += "u" + if obj.flags & re.VERBOSE: + flags += "x" + if isinstance(obj.pattern, str): + pattern = obj.pattern + else: + pattern = obj.pattern.decode("utf-8") + if json_options.json_mode == JSONMode.LEGACY: + return SON([("$regex", pattern), ("$options", flags)]) + return {"$regularExpression": SON([("pattern", pattern), ("options", flags)])} + if isinstance(obj, MinKey): + return {"$minKey": 1} + if isinstance(obj, MaxKey): + return {"$maxKey": 1} + if isinstance(obj, Timestamp): + return {"$timestamp": SON([("t", obj.time), ("i", obj.inc)])} + if isinstance(obj, Code): + if obj.scope is None: + return {"$code": str(obj)} + return SON( + [ + ("$code", str(obj)), + ("$scope", _json_convert(obj.scope, json_options)), + ] + ) + if isinstance(obj, Binary): + return _encode_binary(obj, obj.subtype, json_options) + if isinstance(obj, bytes): + return _encode_binary(obj, 0, json_options) + if isinstance(obj, uuid.UUID): + if json_options.strict_uuid: + binval = Binary.from_uuid( + obj, uuid_representation=json_options.uuid_representation + ) + return _encode_binary(binval, binval.subtype, json_options) + else: + return {"$uuid": obj.hex} + if isinstance(obj, Decimal128): + return {"$numberDecimal": str(obj)} + if isinstance(obj, bool): + return obj + if json_options.json_mode == JSONMode.CANONICAL and isinstance(obj, int): + if -(2**31) <= obj < 2**31: + return {"$numberInt": str(obj)} + return {"$numberLong": str(obj)} + if json_options.json_mode != JSONMode.LEGACY and isinstance(obj, float): + if math.isnan(obj): + return {"$numberDouble": "NaN"} + elif math.isinf(obj): + representation = "Infinity" if obj > 0 else "-Infinity" + return {"$numberDouble": representation} + elif json_options.json_mode == JSONMode.CANONICAL: + # repr() will return the shortest string guaranteed to produce the + # original value, when float() is called on it. + return {"$numberDouble": str(repr(obj))} + raise TypeError("%r is not JSON serializable" % obj) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[196:288] +==backtrader.samples.oco.oco:[167:259] + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[45:186] +==backtrader.samples.writer-test.writer-test:[37:178] +class LongShortStrategy(bt.Strategy): + """This strategy buys/sells upong the close price crossing + upwards/downwards a Simple Moving Average. + + It can be a long-only strategy by setting the param "onlylong" to True + + + """ + + params = dict( + period=15, + stake=1, + printout=False, + onlylong=False, + csvcross=False, + ) + + def start(self): + """ """ + + def stop(self): + """ """ + + def log(self, txt, dt=None): + """ + + :param txt: + :param dt: (Default value = None) + + """ + if self.p.printout: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + + def __init__(self): + """ """ + # To control operation entries + self.orderid = None + + # Create SMA on 2nd data + sma = btind.MovAv.SMA(self.data, period=self.p.period) + # Create a CrossOver Signal from close an moving average + self.signal = btind.CrossOver(self.data.close, sma) + self.signal.csv = self.p.csvcross + + def next(self): + """ """ + if self.orderid: + return # if an order is active, no new orders are allowed + + if self.signal > 0.0: # cross upwards + if self.position: + self.log("CLOSE SHORT , %.2f" % self.data.close[0]) + self.close() + + self.log("BUY CREATE , %.2f" % self.data.close[0]) + self.buy(size=self.p.stake) + + elif self.signal < 0.0: + if self.position: + self.log("CLOSE LONG , %.2f" % self.data.close[0]) + self.close() + + if not self.p.onlylong: + self.log("SELL CREATE , %.2f" % self.data.close[0]) + self.sell(size=self.p.stake) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders + self.orderid = None + + def notify_trade(self, trade): + """ + + :param trade: + + """ + if trade.isclosed: + self.log("TRADE PROFIT, GROSS %.2f, NET %.2f" % (trade.pnl, trade.pnlcomm)) + + elif trade.justopened: + self.log("TRADE OPENED, SIZE %2d" % trade.size) + + +def runstrategy(): + """ """ + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( + dataname=args.data, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro + cerebro.adddata(data) + + # Add the strategy + cerebro.addstrategy( + LongShortStrategy, + period=args.period, + onlylong=args.onlylong, + csvcross=args.csvcross, + stake=args.stake, + ) + + # Add the commission - only stocks like a for each operation + cerebro.broker.setcash(args.cash) + + # Add the commission - only stocks like a for each operation + cerebro.broker.setcommission( + commission=args.comm, mult=args.mult, margin=args.margin + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[120:210] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[120:216] + if self.position_type is not None: + days_in_trade = len(self) - self.entry_day + + # 根据持仓方向和偏度差值决定是否平仓 + if self.position_type == "long_j_short_jm" and ( + current_delta > self.lower_exit_threshold + or days_in_trade >= self.p.max_hold_days + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM偏度差={current_delta:.2f}," + f" 持仓天数={days_in_trade}," + f" 平仓阈值={self.lower_exit_threshold:.2f}" + ) + + elif self.position_type == "short_j_long_jm" and ( + current_delta < self.upper_exit_threshold + or days_in_trade >= self.p.max_hold_days + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM偏度差={current_delta:.2f}," + f" 持仓天数={days_in_trade}," + f" 平仓阈值={self.upper_exit_threshold:.2f}" + ) + + else: + # 开仓逻辑 + if current_delta > self.upper_entry_threshold: + # J的偏度显著高于历史均值,做空J,做多JM + self.order = self.sell(data=self.data0, size=10) + self.order = self.buy(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "short_j_long_jm" + if self.p.printlog: + print( + f"开仓: 做空J,做多JM, 偏度差={current_delta:.2f}," + f" 开仓阈值={self.upper_entry_threshold:.2f}" + ) + + elif current_delta < self.lower_entry_threshold: + # J的偏度显著低于历史均值,做多J,做空JM + self.order = self.buy(data=self.data0, size=10) + self.order = self.sell(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "long_j_short_jm" + if self.p.printlog: + print( + f"开仓: 做多J,做空JM, 偏度差={current_delta:.2f}," + f" 开仓阈值={self.lower_entry_threshold:.2f}" + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + def notify_trade(self, trade): + """ + + :param trade: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[10:127] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[10:127] +class SharpeDiffStrategy(bt.Strategy): + """ """ + + params = ( + ("return_period", 15), # 计算收益率的周期(15日收益率) + ("ma_period", 10), # 计算移动平均的周期(20日移动平均线) + ("entry_std_multiplier", 0.3), # 开仓标准差乘数 + ("max_hold_days", 15), # 最大持仓天数 + ("printlog", False), + ) + + def __init__(self): + """ """ + # 存储夏普比率序列用于绘图 + self.sharpe_j_values = [] + self.sharpe_jm_values = [] + self.delta_sharpe_values = [] + self.dates = [] + + # 布林带数据 + self.delta_sharpe_ma = [] # 移动平均 + self.delta_sharpe_std = [] # 标准差 + self.upper_band = [] # 上轨 + self.lower_band = [] # 下轨 + + # 存储J和JM的收益率序列 + self.returns_j = [] + self.returns_jm = [] + + # 初始化交易相关变量 + self.order = None + self.position_type = None + self.entry_day = 0 + + # 存储历史价格数据 + self.j_prices = [] + self.jm_prices = [] + + def next(self): + """ """ + if self.order: + return + + # 添加日期到列表 + self.dates.append(self.data0.datetime.date()) + + # 保存最新价格 + self.j_prices.append(self.data0.close[0]) + self.jm_prices.append(self.data1.close[0]) + + # 当价格数据不足时,跳过 + if len(self.j_prices) < self.p.return_period + 1: + return + + # 计算15日收益率 + j_ret_15d = (self.j_prices[-1] / self.j_prices[-self.p.return_period - 1]) - 1 + jm_ret_15d = ( + self.jm_prices[-1] / self.jm_prices[-self.p.return_period - 1] + ) - 1 + + # 保存每日收益率用于计算波动率 + if len(self) > 1: # 确保有前一个价格 + ret_j = (self.data0.close[0] / self.data0.close[-1]) - 1 + ret_jm = (self.data1.close[0] / self.data1.close[-1]) - 1 + self.returns_j.append(ret_j) + self.returns_jm.append(ret_jm) + else: + return # 第一个bar没有前一天价格,跳过 + + # 当收益率数据不足时,跳过 + if len(self.returns_j) < self.p.return_period: + return + + # 计算15日波动率 + j_vol_15d = np.std(self.returns_j[-self.p.return_period:]) * np.sqrt( + self.p.return_period + ) + jm_vol_15d = np.std(self.returns_jm[-self.p.return_period:]) * np.sqrt( + self.p.return_period + ) + + # 计算夏普比率 + sharpe_j = j_ret_15d / j_vol_15d if j_vol_15d > 0 else 0 + sharpe_jm = jm_ret_15d / jm_vol_15d if jm_vol_15d > 0 else 0 + + # 存储夏普比率用于绘图 + self.sharpe_j_values.append(sharpe_j) + self.sharpe_jm_values.append(sharpe_jm) + + # 计算夏普差值 ΔSharpe = μJ/σJ - μJM/σJM + delta_sharpe = sharpe_j - sharpe_jm + self.delta_sharpe_values.append(delta_sharpe) + + # 计算20日移动平均和标准差 + if len(self.delta_sharpe_values) >= self.p.ma_period: + # 计算20日移动平均 MA(ΔSharpe) = MA20(ΔSharpe) + ma_delta = np.mean(self.delta_sharpe_values[-self.p.ma_period:]) + self.delta_sharpe_ma.append(ma_delta) + + # 计算20日标准差 σΔSharpe = Std20(ΔSharpe) + std_delta = np.std(self.delta_sharpe_values[-self.p.ma_period:]) + self.delta_sharpe_std.append(std_delta) + + # 计算布林带上下轨 + # Upper Band = MAΔSharpe + 2 × σΔSharpe + upper = ma_delta + self.p.entry_std_multiplier * std_delta + self.upper_band.append(upper) + + # Lower Band = MAΔSharpe - 2 × σΔSharpe + lower = ma_delta - self.p.entry_std_multiplier * std_delta + self.lower_band.append(lower) + else: + # 数据不足以计算移动平均和标准差时,跳过 + return + + # 交易逻辑 - 基于夏普差值与布林带的关系 + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[640:742] +==backtrader.xtquant.xtbson.bson37.json_util:[726:843] + return Binary(data, subtype) + + +def _parse_legacy_binary(doc, json_options): + """ + + :param doc: + :param json_options: + + """ + if isinstance(doc["$type"], int): + doc["$type"] = "%02x" % doc["$type"] + subtype = int(doc["$type"], 16) + if subtype >= 0xFFFFFF80: # Handle mongoexport values + subtype = int(doc["$type"][6:], 16) + data = base64.b64decode(doc["$binary"].encode()) + return _binary_or_uuid(data, subtype, json_options) + + +def _parse_canonical_binary(doc, json_options): + """ + + :param doc: + :param json_options: + + """ + binary = doc["$binary"] + b64 = binary["base64"] + subtype = binary["subType"] + if not isinstance(b64, str): + raise TypeError("$binary base64 must be a string: %s" % (doc,)) + if not isinstance(subtype, str) or len(subtype) > 2: + raise TypeError( + "$binary subType must be a string at most 2 characters: %s" % (doc,) + ) + if len(binary) != 2: + raise TypeError( + '$binary must include only "base64" and "subType" components: %s' % (doc,) + ) + + data = base64.b64decode(b64.encode()) + return _binary_or_uuid(data, int(subtype, 16), json_options) + + +def _parse_canonical_datetime(doc, json_options): + """Decode a JSON datetime to python datetime.datetime. + + :param doc: + :param json_options: + + """ + dtm = doc["$date"] + if len(doc) != 1: + raise TypeError("Bad $date, extra field(s): %s" % (doc,)) + # mongoexport 2.6 and newer + if isinstance(dtm, str): + # Parse offset + if dtm[-1] == "Z": + dt = dtm[:-1] + offset = "Z" + elif dtm[-6] in ("+", "-") and dtm[-3] == ":": + # (+|-)HH:MM + dt = dtm[:-6] + offset = dtm[-6:] + elif dtm[-5] in ("+", "-"): + # (+|-)HHMM + dt = dtm[:-5] + offset = dtm[-5:] + elif dtm[-3] in ("+", "-"): + # (+|-)HH + dt = dtm[:-3] + offset = dtm[-3:] + else: + dt = dtm + offset = "" + + # Parse the optional factional seconds portion. + dot_index = dt.rfind(".") + microsecond = 0 + if dot_index != -1: + microsecond = int(float(dt[dot_index:]) * 1000000) + dt = dt[:dot_index] + + aware = datetime.datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S").replace( + microsecond=microsecond, tzinfo=utc + ) + + if offset and offset != "Z": + if len(offset) == 6: + hours, minutes = offset[1:].split(":") + secs = int(hours) * 3600 + int(minutes) * 60 + elif len(offset) == 5: + secs = int(offset[1:3]) * 3600 + int(offset[3:]) * 60 + elif len(offset) == 3: + secs = int(offset[1:3]) * 3600 + if offset[0] == "-": + secs *= -1 + aware = aware - datetime.timedelta(seconds=secs) + + if json_options.tz_aware: + if json_options.tzinfo: + aware = aware.astimezone(json_options.tzinfo) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[222:298] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[216:293] + if len(self.dates) > len(self.skew_j_values): + dates = self.dates[-(len(self.skew_j_values)):] + else: + dates = self.dates + + # 创建一个新的图形 + plt.figure(figsize=(12, 10)) + + # 绘制J和JM的偏度 + plt.subplot(3, 1, 1) + plt.plot(dates, self.skew_j_values, label="J Skewness", color="blue") + plt.plot(dates, self.skew_jm_values, label="JM Skewness", color="red") + plt.title("Skewness of J and JM Contracts") + plt.legend() + plt.grid(True) + + # 绘制偏度差值 + plt.subplot(3, 1, 2) + plt.plot( + dates, + self.delta_skew_values, + label="Skewness Difference (J-JM)", + color="green", + ) + + # 只绘制最后一个交易日的阈值线 + if len(self.delta_skew_values) > 0: + plt.axhline( + y=self.upper_entry_threshold, + color="r", + linestyle="--", + label=f"Upper Entry Threshold (Mean + {self.p.entry_std_multiplier}σ)", + ) + plt.axhline( + y=self.lower_entry_threshold, + color="r", + linestyle="--", + label=f"Lower Entry Threshold (Mean - {self.p.entry_std_multiplier}σ)", + ) + plt.axhline( + y=self.upper_exit_threshold, + color="g", + linestyle=":", + label=f"Upper Exit Threshold (Mean + {self.p.exit_std_multiplier}σ)", + ) + plt.axhline( + y=self.lower_exit_threshold, + color="g", + linestyle=":", + label=f"Lower Exit Threshold (Mean - {self.p.exit_std_multiplier}σ)", + ) + plt.axhline(y=self.delta_mean, color="k", linestyle="-", label="Mean") + + plt.title("Skewness Difference (J-JM) with Dynamic Thresholds") + plt.legend() + plt.grid(True) + + # 绘制价格 + plt.subplot(3, 1, 3) + plt.plot( + dates, + [self.data0.close[i] for i in range(-len(dates), 0)], + label="J Price", + color="blue", + ) + plt.plot( + dates, + [self.data1.close[i] for i in range(-len(dates), 0)], + label="JM Price", + color="red", + ) + plt.title("Price of J and JM Contracts") + plt.legend() + plt.grid(True) + + plt.tight_layout() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[17:119] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[18:120] + ("max_hold_days", 15), # 最大持仓天数 + ("printlog", False), + ) + + def __init__(self): + """ """ + # 存储偏度序列用于绘图 + self.skew_j_values = [] + self.skew_jm_values = [] + self.delta_skew_values = [] + self.dates = [] + + # 存储偏度差的历史统计量 + self.delta_mean = 0 + self.delta_std = 0 + + # 存储开仓和平仓阈值 + self.upper_entry_threshold = 0 + self.lower_entry_threshold = 0 + self.upper_exit_threshold = 0 + self.lower_exit_threshold = 0 + + # 为两个数据集创建收益率序列 + self.returns_j = [] + self.returns_jm = [] + + # 初始化交易相关变量 + self.order = None + self.position_type = None + self.entry_day = 0 + + def next(self): + """ """ + if self.order: + return + + # 添加日期到列表 + self.dates.append(self.data0.datetime.date()) + + # 计算最新收益率 + if len(self) > 1: # 确保有前一个价格 + ret_j = (self.data0.close[0] / self.data0.close[-1]) - 1 + ret_jm = (self.data1.close[0] / self.data1.close[-1]) - 1 + self.returns_j.append(ret_j) + self.returns_jm.append(ret_jm) + else: + return # 第一个bar没有前一天价格,跳过 + + # 当收益率数据不足时,跳过 + if len(self.returns_j) < self.p.skew_period: + return + + # 计算偏度 - 只保留最近的skew_period个收益率 + j_returns = np.array(self.returns_j[-self.p.skew_period:]) + jm_returns = np.array(self.returns_jm[-self.p.skew_period:]) + + # 计算J合约偏度 + j_mean = np.mean(j_returns) + j_std = np.std(j_returns) + skew_j = np.mean((j_returns - j_mean) ** 3) / (j_std**3) if j_std > 0 else 0 + + # 计算JM合约偏度 + jm_mean = np.mean(jm_returns) + jm_std = np.std(jm_returns) + skew_jm = ( + np.mean((jm_returns - jm_mean) ** 3) / (jm_std**3) if jm_std > 0 else 0 + ) + + # 存储偏度值用于绘图 + self.skew_j_values.append(skew_j) + self.skew_jm_values.append(skew_jm) + + # 计算当前的偏度差值 + current_delta = skew_j - skew_jm + self.delta_skew_values.append(current_delta) + + # 计算历史偏度差的均值和标准差 + if len(self.delta_skew_values) >= self.p.lookback_period: + hist_delta_values = np.array( + self.delta_skew_values[-self.p.lookback_period:] + ) + self.delta_mean = np.mean(hist_delta_values) + self.delta_std = np.std(hist_delta_values) + + # 更新开仓和平仓阈值 + self.upper_entry_threshold = ( + self.delta_mean + self.p.entry_std_multiplier * self.delta_std + ) + self.lower_entry_threshold = ( + self.delta_mean - self.p.entry_std_multiplier * self.delta_std + ) + self.upper_exit_threshold = ( + self.delta_mean + self.p.exit_std_multiplier * self.delta_std + ) + self.lower_exit_threshold = ( + self.delta_mean - self.p.exit_std_multiplier * self.delta_std + ) + else: + # 数据不足以计算历史统计量时,跳过 + return + + # 交易逻辑 - 基于偏度差与历史均值的关系 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.son:[91:258] +==backtrader.xtquant.xtbson.bson37.son:[92:208] + other.update(self) + return other + + # TODO this is all from UserDict.DictMixin. it could probably be made more + # efficient. + # second level definitions support higher levels + def __iter__(self) -> Iterator[_Key]: + for k in self.__keys: + yield k + + def has_key(self, key: _Key) -> bool: + return key in self.__keys + + def iterkeys(self) -> Iterator[_Key]: + return self.__iter__() + + # fourth level uses definitions from lower levels + def itervalues(self) -> Iterator[_Value]: + for _, v in self.items(): + yield v + + def values(self) -> List[_Value]: # type: ignore[override] + return [v for _, v in self.items()] + + def clear(self) -> None: + self.__keys = [] + super(SON, self).clear() + + # type: ignore[override] + def setdefault(self, key: _Key, default: _Value) -> _Value: + try: + return self[key] + except KeyError: + self[key] = default + return default + + def pop(self, key: _Key, *args: Union[_Value, _T]) -> Union[_Value, _T]: + if len(args) > 1: + raise TypeError( + "pop expected at most 2 arguments, got " + repr(1 + len(args)) + ) + try: + value = self[key] + except KeyError: + if args: + return args[0] + raise + del self[key] + return value + + def popitem(self) -> Tuple[_Key, _Value]: + try: + k, v = next(iter(self.items())) + except StopIteration: + raise KeyError("container is empty") + del self[k] + return (k, v) + + # type: ignore[override] + def update(self, other: Optional[Any] = None, **kwargs: _Value) -> None: + # Make progressively weaker assumptions about "other" + if other is None: + pass + elif hasattr(other, "items"): + for k, v in other.items(): + self[k] = v + elif hasattr(other, "keys"): + for k in other.keys(): + self[k] = other[k] + else: + for k, v in other: + self[k] = v + if kwargs: + self.update(kwargs) + + # type: ignore[override] + def get( + self, key: _Key, default: Optional[Union[_Value, _T]] = None + ) -> Union[_Value, _T, None]: + try: + return self[key] + except KeyError: + return default + + def __eq__(self, other: Any) -> bool: + """Comparison to another SON is order-sensitive while comparison to a + regular dictionary is order-insensitive. + """ + if isinstance(other, SON): + return len(self) == len(other) and list(self.items()) == list(other.items()) + return self.to_dict() == other + + def __ne__(self, other: Any) -> bool: + return not self == other + + def __len__(self) -> int: + return len(self.__keys) + + def to_dict(self) -> Dict[_Key, _Value]: + """Convert a SON document to a normal Python dictionary instance. + + This is trickier than just *dict(...)* because it needs to be + recursive. + """ + + def transform_value(value: Any) -> Any: + if isinstance(value, list): + return [transform_value(v) for v in value] + elif isinstance(value, _Mapping): + return dict([(k, transform_value(v)) for k, v in value.items()]) + else: + return value + + return transform_value(dict(self)) + + def __deepcopy__(self, memo: Dict[int, "SON[_Key, _Value]"]) -> "SON[_Key, _Value]": (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[128:213] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[128:218] + days_in_trade = len(self) - self.entry_day + + # 根据持仓方向和夏普差值决定是否平仓 + if ( + self.position_type == "long_j_short_jm" and delta_sharpe >= ma_delta + ) or days_in_trade >= self.p.max_hold_days: + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM夏普差={delta_sharpe:.4f}," + f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + ) + + elif ( + self.position_type == "short_j_long_jm" and delta_sharpe <= ma_delta + ) or days_in_trade >= self.p.max_hold_days: + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM夏普差={delta_sharpe:.4f}," + f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + ) + + else: + # 开仓逻辑 + if delta_sharpe >= upper: + # 夏普差值突破上轨,做多J,做空JM + self.order = self.buy(data=self.data0, size=10) + self.order = self.sell(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "long_j_short_jm" + if self.p.printlog: + print( + f"开仓: 做多J,做空JM, 夏普差={delta_sharpe:.4f}," + f" 上轨={upper:.4f}" + ) + + elif delta_sharpe <= lower: + # 夏普差值突破下轨,做空J,做多JM + self.order = self.sell(data=self.data0, size=10) + self.order = self.buy(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "short_j_long_jm" + if self.p.printlog: + print( + f"开仓: 做空J,做多JM, 夏普差={delta_sharpe:.4f}," + f" 下轨={lower:.4f}" + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + +# 数据加载函数,处理索引问题 +def load_data(symbol1, symbol2, fromdate, todate): + """ + + :param symbol1: + :param symbol2: + :param fromdate: + :param todate: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.btcsv:[151:238] +==backtrader.backtrader.feeds.ibdata:[284:408] + env.addstore(self.ib) + + CONTRACT_TYPE = [ + "BOND", + "CFD", + "CMDTY", + "CRYPTO", + "CONTFUT", + "CASH", + "IND", + "FUND", + "STK", + "IOPT", + "FIGI", + "CUSIP", + "ISIN", + "FUT", + "FOP", + "OPT", + "WAR", + ] + + def parsecontract(self, dataname): + """Parses dataname generates a default contract + + Pattern: secType-others + + BONDS & CFDs & CommoditiesCopy & CryptocurrencyCopy & Continuous Futures * + Forex Pairs & IndicesCopy & Mutual Funds & STK & Standard Warrants: + secType-symbol-currency-exchange-primaryExchange(only for STK) + BOND-122014AJ2-USD-SMART #EndData=datetime(2024, 5, 16) / '' + CFD-IBUS30-USD-SMART #EndData=datetime(2014, 12, 31) / '' + CMDTY-XAUUSD-USD-SMART #EndData=datetime(2024, 5, 16) / '' + CRYPTO-ETH-USD-PAXOS #EndData=datetime(2024, 5, 16) / '' + CONTFUT-ES-USD-CME #'', Not supoort EndData + CASH-EUR-GBP-IDEALPRO #EndData=datetime(2024, 5, 16) / '' + IND-DAX-EUR-EUREX #EndData=datetime(2014, 12, 31) / '', not support bid/ask + FUND-VWELX-USD-FUNDSERV #EndData=datetime(2014, 12, 31) / '', only support trades + STK-AAPL-USD-SMART #EndData=datetime(2014, 12, 31) / '' + STK-SPY-USD-SMART-ARCA #EndData=datetime(2014, 12, 31) / '' + STK-EMCGU-USD-SMART #Stock Contract with IPO price #EndData=datetime(2024, 5, 16) / '' + IOPT-B881G-EUR-SBF #Not Found suitable example for IOPT + + + + Contracts specified by CUSIP, FIGI, or ISIN + secIdType-secId-exchange + FIGI-BBG000B9XRY4-SMART + + Futures + secType-symbol-currency-exchange-lastTradeDateOrContractMonth-multiplier-IncludeExpired + FUT-ES-USD-CME-202809-50-False #EndData=datetime(2024, 5, 16) / '' + FUT-ES-USD-CME-202309-None-True #not supported + + Futures Options + secType-symbol-currency-exchange-lastTradeDateOrContractMonth-multiplier-strike-right + FOP-GBL-EUR-EUREX-'20230224'-'1000'-138-C + OPT-GOOG-USD-SMART-20241220-100-180-C #EndData=datetime(2024, 10, 16) / '' 1M 1hour + WAR-GOOG-EUR-FWB-20201117-001-15000-C + + :param dataname: + + """ + + # Set defaults for optional tokens in the ticker string + if dataname is None: + return None + + # Make the initial contract + precon = self.ib.makecontract() + + # split the ticker string + tokens = iter(dataname.split("-")) + + # Symbol and security type are compulsory + sectype = next(tokens) + + assert sectype in self.CONTRACT_TYPE + + if sectype in ["CUSIP", "FIGI", "ISIN"]: + precon.secIdType = self.p.secType = sectype + precon.secId = next(tokens) + precon.exchange = self.p.exchange = next(tokens) + else: + precon.secType = self.p.secType = sectype + if sectype == "IOPT": + precon.localsymbol = self.p.localsymbol = next(tokens) + else: + precon.symbol = self.p.symbol = next(tokens) + precon.currency = self.p.currency = next(tokens) + precon.exchange = self.p.exchange = next(tokens) + + if sectype == "STK": + try: + precon.primaryExchange = self.p.primaryExchange = next(tokens) + except StopIteration: + pass + elif sectype in ["FUT", "FOP", "OPT", "WAR"]: + expiry = next(tokens) + multiplier = next(tokens) + strike = next(tokens) + if sectype == "FUT": + precon.lastTradeDateOrContractMonth = self.p.expiry = expiry + precon.IncludeExpired = self.p.IncludeExpired = bool( + strike + ) # 只是同一位置,变量名与实际变更不一致 + if multiplier != "None": + precon.multiplier = self.p.multiplier = multiplier + else: + precon.lastTradeDateOrContractMonth = self.p.expiry = expiry + precon.multiplier = self.p.multiplier = multiplier + precon.strike = self.p.strike = int(strike) + precon.right = self.p.right = next(tokens) + + print(f"precon= {precon}") + return precon + + def updatecomminfo(self, contract=None): + """ + + :param contract: (Default value = None) + + """ + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stoptrail.trail:[163:234] +==backtrader.samples.timers.scheduled:[172:243] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[104:175] +==backtrader.samples.psar.psar:[99:170] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[98:169] +==backtrader.samples.oco.oco:[188:259] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[217:288] +==backtrader.samples.cheat-on-open.cheat-on-open:[153:224] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[217:283] +==backtrader.samples.renko.renko:[110:176] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[103:169] +==backtrader.samples.timers.scheduled-min:[188:254] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[158:224] +==backtrader.samples.psar.psar-intraday:[121:187] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[222:288] +==backtrader.samples.calmar.calmar-test:[109:175] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-timereturn:[40:131] +==backtrader.tests.test_strategy_unoptimized:[97:189] +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), + ("printdata", True), + ("printops", True), + ("stocklike", True), + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if isinstance(order, bt.BuyOrder): + if self.p.printops: + txt = "BUY, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + chkprice = "%.2f" % order.executed.price + self.buyexec.append(chkprice) + else: # elif isinstance(order, SellOrder): + if self.p.printops: + txt = "SELL, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + + chkprice = "%.2f" % order.executed.price + self.sellexec.append(chkprice) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + if self.p.printops: + self.log("%s ," % order.Status[order.status]) + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # Flag to allow new orders in the system or not + self.orderid = None + + self.sma = btind.SMA(self.data, period=self.p.period) + self.cross = btind.CrossOver(self.data.close, self.sma, plot=True) + + def start(self): + """ """ + if not self.p.stocklike: + self.broker.setcommission(commission=2.0, mult=10.0, margin=1000.0) + + if self.p.printdata: + self.log("-------------------------", nodate=True) + self.log( + "Starting portfolio value: %.2f" % self.broker.getvalue(), + nodate=True, + ) + + self.tstart = time_clock() + + self.buycreate = list() + self.sellcreate = list() + self.buyexec = list() + self.sellexec = list() + + def stop(self): + """ """ + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[142:213] +==backtrader.samples.slippage.slippage:[118:189] + cerebro.run() + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for Slippage", + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/2005-2006-day-001.txt", + help="Specific data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( + "--period1", + required=False, + action="store", + type=int, + default=10, + help="Fast moving average period", + ) + + parser.add_argument( + "--period2", + required=False, + action="store", + type=int, + default=30, + help="Slow moving average period", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[224:288] +==backtrader.samples.stop-trading.stop-loss-approaches:[265:329] + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[109:170] +==backtrader.samples.renko.renko:[115:176] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[94:174] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[86:166] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + +def load_data(symbol1, symbol2, fromdate, todate): + """ + + :param symbol1: + :param symbol2: + :param fromdate: + :param todate: + + """ + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + data0 = bt.feeds.PandasData( + dataname=df0, + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) + return data0, data1 + except Exception as e: + print(f"加载数据时出错: {e}") + return None, None + + +def optimize_parameters(): + """ """ + # 定义参数范围 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.renko.renko:[117:176] +==backtrader.samples.stop-trading.stop-loss-approaches:[265:324] + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[381:450] +==backtrader.backtrader.brokers.ibbroker:[445:519] + pos_value = 0.0 + pos_value_unlever = 0.0 + unrealized = 0.0 + + while self._cash_addition: + c = self._cash_addition.popleft() + self._fundshares += c / self._fundval + self.cash += c + + for data in datas or self.positions: + comminfo = self.getcommissioninfo(data) + position = self.positions[data] + # use valuesize: returns raw value, rather than negative adj val + if not self.p.shortcash: + dvalue = comminfo.getvalue(position, data.close[0]) + else: + dvalue = comminfo.getvaluesize(position.size, data.close[0]) + + dunrealized = comminfo.profitandloss( + position.size, position.price, data.close[0] + ) + if datas and len(datas) == 1: + if lever and dvalue > 0: + dvalue -= dunrealized + return (dvalue / comminfo.get_leverage()) + dunrealized + return dvalue # raw data value requested, short selling is neg + + if not self.p.shortcash: + dvalue = abs(dvalue) # short selling adds value in this case + + pos_value += dvalue + unrealized += dunrealized + + if dvalue > 0: # long position - unlever + dvalue -= dunrealized + pos_value_unlever += dvalue / comminfo.get_leverage() + pos_value_unlever += dunrealized + else: + pos_value_unlever += dvalue + + if not self._fundhist: + self._value = v = self.cash + pos_value_unlever + self._fundval = self._value / self._fundshares # update fundvalue + else: + # Try to fetch a value + fval, fvalue = self._process_fund_history() + + self._value = fvalue + self.cash = fvalue - pos_value_unlever + self._fundval = fval + self._fundshares = fvalue / fval + lev = pos_value / (pos_value_unlever or 1.0) + + # update the calculated values above to the historical values + pos_value_unlever = fvalue + pos_value = fvalue * lev + # print(self.cash,pos_value_unlever,pos_value) + self._valuemkt = pos_value_unlever + + self._valuelever = self.cash + pos_value + self._valuemktlever = pos_value + + self._leverage = pos_value / (pos_value_unlever or 1.0) + self._unrealized = unrealized + + return self._value if not lever else self._valuelever + + def get_leverage(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[916:1072] +==backtrader.xtquant.xtbson.bson37.__init__:[1386:1589] + return b"\x09" + name + _PACK_LONG(millis) + + +def _encode_none(name: bytes, dummy0: Any, dummy1: Any, dummy2: Any) -> bytes: + """Encode python None. + + :param name: + :type name: bytes + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: bytes + + """ + return b"\x0a" + name + + +def _encode_regex(name: bytes, value: Regex, dummy0: Any, dummy1: Any) -> bytes: + """Encode a python regex or bson.regex.Regex. + + :param name: + :type name: bytes + :param value: + :type value: Regex + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + flags = value.flags + # Python 3 common case + if flags == re.UNICODE: + return b"\x0b" + name + _make_c_string_check(value.pattern) + b"u\x00" + elif flags == 0: + return b"\x0b" + name + _make_c_string_check(value.pattern) + b"\x00" + else: + sflags = b"" + if flags & re.IGNORECASE: + sflags += b"i" + if flags & re.LOCALE: + sflags += b"l" + if flags & re.MULTILINE: + sflags += b"m" + if flags & re.DOTALL: + sflags += b"s" + if flags & re.UNICODE: + sflags += b"u" + if flags & re.VERBOSE: + sflags += b"x" + sflags += b"\x00" + return b"\x0b" + name + _make_c_string_check(value.pattern) + sflags + + +def _encode_code(name: bytes, value: Code, dummy: Any, opts: CodecOptions) -> bytes: + """Encode bson.code.Code. + + :param name: + :type name: bytes + :param value: + :type value: Code + :param dummy: + :type dummy: Any + :param opts: + :type opts: CodecOptions + :rtype: bytes + + """ + cstring = _make_c_string(value) + cstrlen = len(cstring) + if value.scope is None: + return b"\x0d" + name + _PACK_INT(cstrlen) + cstring + scope = _dict_to_bson(value.scope, False, opts, False) + full_length = _PACK_INT(8 + cstrlen + len(scope)) + return b"\x0f" + name + full_length + _PACK_INT(cstrlen) + cstring + scope + + +def _encode_int(name: bytes, value: int, dummy0: Any, dummy1: Any) -> bytes: + """Encode a python int. + + :param name: + :type name: bytes + :param value: + :type value: int + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + if -2147483648 <= value <= 2147483647: + return b"\x10" + name + _PACK_INT(value) + else: + try: + return b"\x12" + name + _PACK_LONG(value) + except struct.error: + raise OverflowError("BSON can only handle up to 8-byte ints") + + +def _encode_timestamp(name: bytes, value: Any, dummy0: Any, dummy1: Any) -> bytes: + """Encode bson.timestamp.Timestamp. + + :param name: + :type name: bytes + :param value: + :type value: Any + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + return b"\x11" + name + _PACK_TIMESTAMP(value.inc, value.time) + + +def _encode_long(name: bytes, value: Any, dummy0: Any, dummy1: Any) -> bytes: + """Encode a python long (python 2.x) + + :param name: + :type name: bytes + :param value: + :type value: Any + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + try: + return b"\x12" + name + _PACK_LONG(value) + except struct.error: + raise OverflowError("BSON can only handle up to 8-byte ints") + + +def _encode_decimal128( + name: bytes, value: Decimal128, dummy0: Any, dummy1: Any +) -> bytes: + """Encode bson.decimal128.Decimal128. + + :param name: + :type name: bytes + :param value: + :type value: Decimal128 + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :rtype: bytes + + """ + return b"\x13" + name + value.bid + + +def _encode_minkey(name: bytes, dummy0: Any, dummy1: Any, dummy2: Any) -> bytes: + """Encode bson.min_key.MinKey. + + :param name: + :type name: bytes + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: bytes + + """ + return b"\xff" + name + + +def _encode_maxkey(name: bytes, dummy0: Any, dummy1: Any, dummy2: Any) -> bytes: + """Encode bson.max_key.MaxKey. + + :param name: + :type name: bytes + :param dummy0: + :type dummy0: Any + :param dummy1: + :type dummy1: Any + :param dummy2: + :type dummy2: Any + :rtype: bytes + + """ + return b"\x7f" + name + + +# Each encoder function's signature is: +# - name: utf-8 bytes +# - value: a Python data type, e.g. a Python int for _encode_int +# - check_keys: bool, whether to check for invalid names +# - opts: a CodecOptions +_ENCODERS = { + bool: _encode_bool, + bytes: _encode_bytes, + datetime.datetime: _encode_datetime, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[196:258] +==backtrader.samples.multidata-strategy.multidata-strategy:[198:260] + help="2nd data into the system", + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2003-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2005-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument("--cash", default=100000, type=int, help="Starting Cash") + + parser.add_argument( + "--runnext", + action="store_true", + help="Use next by next instead of runonce", + ) + + parser.add_argument( + "--nopreload", action="store_true", help="Do not preload the data" + ) + + parser.add_argument( + "--oldsync", + action="store_true", + help="Use old data synchronization method", + ) + + parser.add_argument( + "--commperc", + default=0.005, + type=float, + help="Percentage commission (0.005 is 0.5%%", + ) + + parser.add_argument( + "--stake", default=10, type=int, help="Stake to apply in each operation" + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.dbref:[64:170] +==backtrader.xtquant.xtbson.bson37.dbref:[78:211] + self.__kwargs = kwargs + + @property + def collection(self) -> str: + """Get the name of this DBRef's collection. + + + :rtype: str + + """ + return self.__collection + + @property + def id(self) -> Any: + """Get this DBRef's _id. + + + :rtype: Any + + """ + return self.__id + + @property + def database(self) -> Optional[str]: + """Get the name of this DBRef's database. + + Returns None if this DBRef doesn't specify a database. + + + :rtype: Optional[str] + + """ + return self.__database + + def __getattr__(self, key: Any) -> Any: + """ + + :param key: + :type key: Any + :rtype: Any + + """ + try: + return self.__kwargs[key] + except KeyError: + raise AttributeError(key) + + def as_doc(self) -> SON[str, Any]: + """Get the SON document representation of this DBRef. + + Generally not needed by application developers + + + :rtype: SON[str,Any] + + """ + doc = SON([("$ref", self.collection), ("$id", self.id)]) + if self.database is not None: + doc["$db"] = self.database + doc.update(self.__kwargs) + return doc + + def __repr__(self): + """ """ + extra = "".join([", %s=%r" % (k, v) for k, v in self.__kwargs.items()]) + if self.database is None: + return "DBRef(%r, %r%s)" % (self.collection, self.id, extra) + return "DBRef(%r, %r, %r%s)" % ( + self.collection, + self.id, + self.database, + extra, + ) + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, DBRef): + us = (self.__database, self.__collection, self.__id, self.__kwargs) + them = ( + other.__database, + other.__collection, + other.__id, + other.__kwargs, + ) + return us == them + return NotImplemented + + def __ne__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not self == other + + def __hash__(self) -> int: + """Get a hash value for this :class:`DBRef`. + + + :rtype: int + + """ + return hash( + ( + self.__collection, + self.__id, + self.__database, + tuple(sorted(self.__kwargs.items())), + ) + ) + + def __deepcopy__(self, memo: Any) -> "DBRef": + """Support function for `copy.deepcopy()`. + + :param memo: + :type memo: Any + :rtype: "DBRef" + + """ + return DBRef( + deepcopy(self.__collection, memo), + deepcopy(self.__id, memo), + deepcopy(self.__database, memo), + deepcopy(self.__kwargs, memo), + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[306:370] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[313:377] + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + # 加载数据时不保留原有索引结构 + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + # 查找日期列(兼容不同命名) + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + # 设置日期索引 + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + # 创建数据feed + data0 = bt.feeds.PandasData( + dataname=df0, + datetime=None, # 使用索引 + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg + data1 = bt.feeds.PandasData( + dataname=df1, + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg + return data0, data1 + except Exception as e: + print(f"加载数据时出错: {e}") + return None, None + + +# 配置回测引擎 +def configure_cerebro(**kwargs): + """ + + :param **kwargs: + + """ + cerebro = bt.Cerebro(stdstats=False) # 启用标准统计 + data0, data1 = load_data( + "/J", + "/JM", + datetime.datetime(2017, 1, 1), + datetime.datetime(2025, 1, 1), + ) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return None + + cerebro.adddata(data0, name="J") + cerebro.adddata(data1, name="JM") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[173:222] +==backtrader.samples.order-close.close-minute:[141:190] + help="File to be read in", + ) + + parser.add_argument( + "--csvformat", + "-c", + required=False, + default="bt", + choices=[ + "bt", + "visualchart", + "sierrachart", + "yahoo", + "yahoo_unreversed", + ], + help="CSV Format", + ) + + parser.add_argument( + "--fromdate", + "-f", + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--eosbar", + required=False, + action="store_true", + help="Consider a bar with the end of session time tobe the end of the session", + ) + + parser.add_argument( + "--tend", + "-te", + default=None, + required=False, + help="End time for the Session Filter (HH:MM)", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[371:433] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[378:440] + cerebro.broker.setcash(80000) + # cerebro.broker.setcommission(0.0003) + cerebro.broker.set_shortcash(False) + + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 + ) + cerebro.addanalyzer( + bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days, plot=True + ) # 这里的period可以是daily, weekly, monthly等 + # cerebro.broker.setcommission(commission=0.001) + cerebro.broker.set_shortcash(False) + # cerebro.addobserver(bt.observers.Trades) + # # cerebro.addobserver(bt.observers.BuySell) + # cerebro.addobserver(bt.observers.CumValue) + return cerebro + + +def analyze_results(results): + """ + + :param results: + + """ + if not results: + print("没有回测结果可分析") + return + + try: + # 获取分析结果 + drawdown = results[0].analyzers.drawdown.get_analysis() + sharpe = results[0].analyzers.sharperatio.get_analysis() + roi = results[0].analyzers.roianalyzer.get_analysis() + total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 + cagr = results[0].analyzers.cagranalyzer.get_analysis() + # # 打印分析结果 + print("=============回测结果================") + print(f"\nSharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") + print(f"Drawdown: {drawdown.get('max', {}).get('drawdown', 0):.2f} %") + print( + f"Annualized/Normalized return: {total_returns.get('rnorm100', 0):.2f}%" + ) # + print(f"Total compound return: {roi.get('roi100', 0):.2f}%") + print(f"年化收益: {cagr.get('cagr', 0):.2f} ") + print(f"夏普比率: {cagr.get('sharpe', 0):.2f}") + except Exception as e: + print(f"分析结果时出错: {e}") + + +if __name__ == "__main__": + cerebro = configure_cerebro() + if cerebro: + print("开始回测...") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[125:175] +==backtrader.samples.multi-example.mult-values:[270:320] + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[238:288] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[180:230] + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observers.observers-orderobserver:[41:119] +==backtrader.samples.order-execution.order-execution:[44:123] + ) + + def log(self, txt, dt=None): + """Logging function fot this strategy + + :param txt: + :param dt: (Default value = None) + + """ + dt = dt or self.data.datetime[0] + if isinstance(dt, float): + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Submitted, order.Accepted]: + # Buy/Sell order submitted/accepted to/by broker - Nothing to do + self.log("ORDER ACCEPTED/SUBMITTED", dt=order.created.dt) + self.order = order + return + + if order.status in [order.Expired]: + self.log("BUY EXPIRED") + + elif order.status in [order.Completed]: + if order.isbuy(): + self.log( + "BUY EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f" + % ( + order.executed.price, + order.executed.value, + order.executed.comm, + ) + ) + + else: # Sell + self.log( + "SELL EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f" + % ( + order.executed.price, + order.executed.value, + order.executed.comm, + ) + ) + + # Sentinel to None: new orders allowed + self.order = None + + def __init__(self): + """ """ + # SimpleMovingAverage on main data + # Equivalent to -> sma = btind.SMA(self.data, period=self.p.smaperiod) + sma = btind.SMA(period=self.p.smaperiod) + + # CrossOver (1: up, -1: down) close / sma + self.buysell = btind.CrossOver(self.data.close, sma, plot=True) + + # Sentinel to None: new ordersa allowed + self.order = None + + def next(self): + """ """ + if self.order: + # An order is pending ... nothing can be done + return + + # Check if we are in the market + if self.position: + # In the maerket - check if it's the time to sell + if self.buysell < 0: + self.log("SELL CREATE, %.2f" % self.data.close[0]) + self.sell() + + elif self.buysell > 0: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[181:230] +==backtrader.samples.order-history.order-history:[229:278] + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[9:117] +==backtrader.strategies:[16:127] +class MyXtQuantTraderCallback(XtQuantTraderCallback): + """ """ + + def on_disconnected(self): + """ """ + print("[连接状态] 与交易服务器连接断开") + + def on_stock_order(self, order): + """ + + :param order: + + """ + print("\n[委托单回调] 订单状态更新") + print(f"证券代码: {order.stock_code}") + print(f"订单状态: {order.order_status}") # 需根据券商文档映射状态码含义 + print(f"系统订单号: {order.order_sysid}") + + def on_stock_asset(self, asset): + """ + + :param asset: + + """ + print("\n[账户资产] 资金变动通知") + print(f"账户ID: {asset.account_id}") + print(f"可用资金: {asset.cash}") + print(f"总资产估值: {asset.total_asset}") + + def on_stock_trade(self, trade): + """ + + :param trade: + + """ + print("\n[成交记录] 交易已达成") + print(f"账户ID: {trade.account_id}") + print(f"证券代码: {trade.stock_code}") + print(f"关联订单号: {trade.order_id}") + + def on_stock_position(self, position): + """ + + :param position: + + """ + print("\n[持仓变动] 头寸更新") + print(f"证券代码: {position.stock_code}") + print(f"当前持仓量: {position.volume}") + + def on_order_error(self, order_error): + """ + + :param order_error: + + """ + print("\n[委托失败] 订单提交错误") + print(f"错误订单号: {order_error.order_id}") + print(f"错误代码: {order_error.error_id}") + print(f"错误详情: {order_error.error_msg}") # 建议根据error_id映射具体原因 + + def on_cancel_error(self, cancel_error): + """ + + :param cancel_error: + + """ + print("\n[撤单失败] 取消订单错误") + print(f"目标订单号: {cancel_error.order_id}") + print(f"错误代码: {cancel_error.error_id}") + print(f"错误信息: {cancel_error.error_msg}") + + def on_order_stock_async_response(self, response): + """ + + :param response: + + """ + print("\n[异步响应] 委托请求已受理") + print(f"账户ID: {response.account_id}") + print(f"订单号: {response.order_id}") + print(f"请求序列号: {response.seq}") + + def on_account_status(self, status): + """ + + :param status: + + """ + print("\n[账户状态] 登录/连接状态变化") + print(f"账户ID: {status.account_id}") + print(f"账户类型: {status.account_type}") # 如普通户/信用户 + print(f"当前状态: {status.status}") + # 需映射状态码(如已连接/断开) + + +class my_broker: + """ """ + + def __init__(self, use_real_trading=False): + """ + + :param use_real_trading: (Default value = False) + + """ + self.path = r"E:\software\QMT\userdata_mini" + self.session_id = 123456 + self.xt_trader = XtQuantTrader(self.path, self.session_id) + callback = MyXtQuantTraderCallback() + self.acc = StockAccount("39131771") + self.xt_trader.register_callback(callback) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[36:120] +==backtrader.samples.multidata-strategy.multidata-strategy:[36:119] +class MultiDataStrategy(bt.Strategy): + """This strategy operates on 2 datas. The expectation is that the 2 datas are + correlated and the 2nd data is used to generate signals on the 1st + + - Buy/Sell Operationss will be executed on the 1st data + - The signals are generated using a Simple Moving Average on the 2nd data + when the close price crosses upwwards/downwards + + The strategy is a long-only strategy + + + """ + + params = dict( + period=15, + stake=10, + printout=True, + ) + + def log(self, txt, dt=None): + """ + + :param txt: + :param dt: (Default value = None) + + """ + if self.p.printout: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # To control operation entries + self.orderid = None + + # Create SMA on 2nd data + sma = btind.MovAv.SMA(self.data1, period=self.p.period) + # Create a CrossOver Signal from close an moving average + self.signal = btind.CrossOver(self.data1.close, sma) + + def next(self): + """ """ + if self.orderid: + return # if an order is active, no new orders are allowed + + if self.p.printout: + print("Self len:", len(self)) + print("Data0 len:", len(self.data0)) + print("Data1 len:", len(self.data1)) + print("Data0 len == Data1 len:", len(self.data0) == len(self.data1)) + + print("Data0 dt:", self.data0.datetime.datetime()) + print("Data1 dt:", self.data1.datetime.datetime()) + + if not self.position: # not yet in market + if self.signal > 0.0: # cross upwards + self.log("BUY CREATE , %.2f" % self.data1.close[0]) + self.buy(size=self.p.stake) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[350:397] +==backtrader.samples.oandatest.oandatest:[313:360] + else: + data1 = data0 + + rekwargs = dict( + timeframe=timeframe, + compression=args.compression, + bar2edge=not args.no_bar2edge, + adjbartime=not args.no_adjbartime, + rightedge=not args.no_rightedge, + takelate=not args.no_takelate, + ) + + if args.replay: + cerebro.replaydata(data0, **rekwargs) + + if data1 is not None: + rekwargs["timeframe"] = tf1 + rekwargs["compression"] = cp1 + cerebro.replaydata(data1, **rekwargs) + + elif args.resample: + cerebro.resampledata(data0, **rekwargs) + + if data1 is not None: + rekwargs["timeframe"] = tf1 + rekwargs["compression"] = cp1 + cerebro.resampledata(data1, **rekwargs) + + else: + cerebro.adddata(data0) + if data1 is not None: + cerebro.adddata(data1) + + if args.valid is None: + valid = None + else: + valid = datetime.timedelta(seconds=args.valid) + # Add the strategy + cerebro.addstrategy( + TestStrategy, + smaperiod=args.smaperiod, + trade=args.trade, + exectype=bt.Order.ExecType(args.exectype), + stake=args.stake, + stopafter=args.stopafter, + valid=valid, + cancel=args.cancel, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[125:170] +==backtrader.samples.tradingcalendar.tcal:[183:228] + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[238:283] +==backtrader.samples.tradingcalendar.tcal-intra:[181:226] + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[180:225] +==backtrader.samples.renko.renko:[131:176] + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.binary:[224:316] +==backtrader.xtquant.xtbson.bson37.binary:[237:338] + if not isinstance(subtype, int): + raise TypeError("subtype must be an instance of int") + if subtype >= 256 or subtype < 0: + raise ValueError("subtype must be contained in [0, 256)") + # Support any type that implements the buffer protocol. + self = bytes.__new__(cls, memoryview(data).tobytes()) + self.__subtype = subtype + return self + + @classmethod + def from_uuid(cls, uuid, uuid_representation=UuidRepresentation.STANDARD): + """Create a BSON Binary object from a Python UUID. + + Creates a :class:`~bson.binary.Binary` object from a + :class:`uuid.UUID` instance. Assumes that the native + :class:`uuid.UUID` instance uses the byte-order implied by the + provided ``uuid_representation``. + + Raises :exc:`TypeError` if `uuid` is not an instance of + :class:`~uuid.UUID`. + + :Parameters: + - `uuid`: A :class:`uuid.UUID` instance. + - `uuid_representation`: A member of + :class:`~bson.binary.UuidRepresentation`. Default: + :const:`~bson.binary.UuidRepresentation.STANDARD`. + See :ref:`handling-uuid-data-example` for details. + + .. versionadded:: 3.11 + + :param uuid: + :param uuid_representation: (Default value = UuidRepresentation.STANDARD) + + """ + if not isinstance(uuid, UUID): + raise TypeError("uuid must be an instance of uuid.UUID") + + if uuid_representation not in ALL_UUID_REPRESENTATIONS: + raise ValueError( + "uuid_representation must be a value from .binary.UuidRepresentation" + ) + + if uuid_representation == UuidRepresentation.UNSPECIFIED: + raise ValueError( + "cannot encode native uuid.UUID with " + "UuidRepresentation.UNSPECIFIED. UUIDs can be manually " + "converted to bson.Binary instances using " + "bson.Binary.from_uuid() or a different UuidRepresentation " + "can be configured. See the documentation for " + "UuidRepresentation for more information." + ) + + subtype = OLD_UUID_SUBTYPE + if uuid_representation == UuidRepresentation.PYTHON_LEGACY: + payload = uuid.bytes + elif uuid_representation == UuidRepresentation.JAVA_LEGACY: + from_uuid = uuid.bytes + payload = from_uuid[0:8][::-1] + from_uuid[8:16][::-1] + elif uuid_representation == UuidRepresentation.CSHARP_LEGACY: + payload = uuid.bytes_le + else: + # uuid_representation == UuidRepresentation.STANDARD + subtype = UUID_SUBTYPE + payload = uuid.bytes + + return cls(payload, subtype) + + def as_uuid(self, uuid_representation=UuidRepresentation.STANDARD): + """Create a Python UUID from this BSON Binary object. + + Decodes this binary object as a native :class:`uuid.UUID` instance + with the provided ``uuid_representation``. + + Raises :exc:`ValueError` if this :class:`~bson.binary.Binary` instance + does not contain a UUID. + + :Parameters: + - `uuid_representation`: A member of + :class:`~bson.binary.UuidRepresentation`. Default: + :const:`~bson.binary.UuidRepresentation.STANDARD`. + See :ref:`handling-uuid-data-example` for details. + + .. versionadded:: 3.11 + + :param uuid_representation: (Default value = UuidRepresentation.STANDARD) + + """ + if self.subtype not in ALL_UUID_SUBTYPES: + raise ValueError("cannot decode subtype %s as a uuid" % (self.subtype,)) + + if uuid_representation not in ALL_UUID_REPRESENTATIONS: + raise ValueError( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-history.order-history:[229:273] +==backtrader.samples.renko.renko:[132:176] + ) + + parser.add_argument( + "--cerebro", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--sizer", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", + const="{}", + metavar="kwargs", + help="kwargs in key=value format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[19:71] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[54:106] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + +class DynamicSpreadCUSUMStrategy(bt.Strategy): + params = ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[75:130] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[18:73] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) Estimate β_t, then shift one day forward + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + # Prevent lookahead + keep 1 decimal + beta_shift = beta_raw.shift(1).round(1) + + # 3) Append β to main table (for later vectorized calculation) + df = df.assign(beta=beta_shift) + + # 4) Calculate spread for each field + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"Unknown field {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) Organize output + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# Create custom data class to support beta column + + +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread as close + ("beta", "beta"), # beta column + ("nocase", True), # Column names are case insensitive + ) + + +class DynamicSpreadCUSUMStrategy(bt.Strategy): + params = ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[604:650] +==backtrader.samples.vctest.vctest:[425:471] + ) + + parser.add_argument( + "--smaperiod", + default=5, + type=int, + required=False, + action="store", + help="Period to apply to the Simple Moving Average", + ) + + pgroup = parser.add_mutually_exclusive_group(required=False) + + pgroup.add_argument( + "--replay", + required=False, + action="store_true", + help="replay to chosen timeframe", + ) + + pgroup.add_argument( + "--resample", + required=False, + action="store_true", + help="resample to chosen timeframe", + ) + + parser.add_argument( + "--timeframe", + default=bt.TimeFrame.Names[0], + choices=bt.TimeFrame.Names, + required=False, + action="store", + help="TimeFrame for Resample/Replay", + ) + + parser.add_argument( + "--compression", + default=1, + type=int, + required=False, + action="store", + help="Compression for Resample/Replay", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[590:633] +==backtrader.samples.oandatest.oandatest:[505:548] + ) + + parser.add_argument( + "--historical", + required=False, + action="store_true", + help="do only historical download", + ) + + parser.add_argument( + "--fromdate", + required=False, + action="store", + help="Starting date for historical download with format: YYYY-MM-DD[THH:MM:SS]", + ) + + parser.add_argument( + "--smaperiod", + default=5, + type=int, + required=False, + action="store", + help="Period to apply to the Simple Moving Average", + ) + + pgroup = parser.add_mutually_exclusive_group(required=False) + + pgroup.add_argument( + "--replay", + required=False, + action="store_true", + help="replay to chosen timeframe", + ) + + pgroup.add_argument( + "--resample", + required=False, + action="store_true", + help="resample to chosen timeframe", + ) + + parser.add_argument( + "--timeframe", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[17:67] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[20:70] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[182:229] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[183:230] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { + "win": win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[214:261] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[206:253] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { + "rsi_period": rsi_period, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[54:104] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[17:67] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[19:69] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[17:67] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[80:131] +==backtrader.tests.test_analyzer-timereturn:[71:125] + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if isinstance(order, bt.BuyOrder): + if self.p.printops: + txt = "BUY, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + chkprice = "%.2f" % order.executed.price + self.buyexec.append(chkprice) + else: # elif isinstance(order, SellOrder): + if self.p.printops: + txt = "SELL, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + + chkprice = "%.2f" % order.executed.price + self.sellexec.append(chkprice) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + if self.p.printops: + self.log("%s ," % order.Status[order.status]) + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # Flag to allow new orders in the system or not + self.orderid = None + + self.sma = btind.SMA(self.data, period=self.p.period) + self.cross = btind.CrossOver(self.data.close, self.sma, plot=True) + + def start(self): + """ """ + if not self.p.stocklike: + self.broker.setcommission(commission=2.0, mult=10.0, margin=1000.0) + + if self.p.printdata: + self.log("-------------------------", nodate=True) + self.log( + "Starting portfolio value: %.2f" % self.broker.getvalue(), + nodate=True, + ) + + self.tstart = time_clock() + + self.buycreate = list() + self.sellcreate = list() + self.buyexec = list() + self.sellexec = list() + + def stop(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[206:252] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[183:229] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[214:260] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[182:228] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1381:1431] +==backtrader.backtrader.brokers.ibbroker:[1335:1386] + while self._toactivate: + self._toactivate.popleft().activate() + + if self.p.checksubmit: + self.check_submitted() + + # Discount any cash for positions hold + credit = 0.0 + for data, pos in self.positions.items(): + if pos: + comminfo = self.getcommissioninfo(data) + dt0 = data.datetime.datetime() + dcredit = comminfo.get_credit_interest(data, pos, dt0) + self.d_credit[data] += dcredit + credit += dcredit + pos.datetime = dt0 # mark last credit operation + + self.cash -= credit + + self._process_order_history() + + # Iterate once over all elements of the pending queue + self.pending.append(None) + while True: + order = self.pending.popleft() + if order is None: + break + + if order.expire(): + self.notify(order) + self._ococheck(order) + self._bracketize(order, cancel=True) + + elif not order.active(): # 只针对子订单 + self.pending.append(order) # cannot yet be processed + + else: + self._try_exec(order) + + if order.alive(): + self.pending.append(order) + + elif order.status == Order.Completed: + # a bracket parent order may have been executed + self._bracketize(order) + + # Operations have been executed ... adjust cash end of bar + for data, pos in self.positions.items(): + # futures change cash every bar + if pos: + comminfo = self.getcommissioninfo(data) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.timestamp:[59:159] +==backtrader.xtquant.xtbson.bson37.timestamp:[64:193] + time = int(calendar.timegm(time.timetuple())) + if not isinstance(time, int): + raise TypeError("time must be an instance of int") + if not isinstance(inc, int): + raise TypeError("inc must be an instance of int") + if not 0 <= time < UPPERBOUND: + raise ValueError("time must be contained in [0, 2**32)") + if not 0 <= inc < UPPERBOUND: + raise ValueError("inc must be contained in [0, 2**32)") + + self.__time = time + self.__inc = inc + + @property + def time(self) -> int: + """Get the time portion of this :class:`Timestamp`. + + + :rtype: int + + """ + return self.__time + + @property + def inc(self) -> int: + """Get the inc portion of this :class:`Timestamp`. + + + :rtype: int + + """ + return self.__inc + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Timestamp): + return self.__time == other.time and self.__inc == other.inc + else: + return NotImplemented + + def __hash__(self) -> int: + """ + + + :rtype: int + + """ + return hash(self.time) ^ hash(self.inc) + + def __ne__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not self == other + + def __lt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Timestamp): + return (self.time, self.inc) < (other.time, other.inc) + return NotImplemented + + def __le__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Timestamp): + return (self.time, self.inc) <= (other.time, other.inc) + return NotImplemented + + def __gt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Timestamp): + return (self.time, self.inc) > (other.time, other.inc) + return NotImplemented + + def __ge__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Timestamp): + return (self.time, self.inc) >= (other.time, other.inc) + return NotImplemented + + def __repr__(self): + """ """ + return "Timestamp(%s, %s)" % (self.__time, self.__inc) + + def as_datetime(self) -> datetime.datetime: + """ + + + :returns: to the time portion of this :class:`Timestamp`. + + The returned datetime's timezone is UTC. + + :rtype: datetime.datetime + + """ + return datetime.datetime.fromtimestamp(self.__time, utc) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.binary:[318:385] +==backtrader.xtquant.xtbson.bson37.binary:[339:425] + ) + + if uuid_representation == UuidRepresentation.UNSPECIFIED: + raise ValueError("uuid_representation cannot be UNSPECIFIED") + elif uuid_representation == UuidRepresentation.PYTHON_LEGACY: + if self.subtype == OLD_UUID_SUBTYPE: + return UUID(bytes=self) + elif uuid_representation == UuidRepresentation.JAVA_LEGACY: + if self.subtype == OLD_UUID_SUBTYPE: + return UUID(bytes=self[0:8][::-1] + self[8:16][::-1]) + elif uuid_representation == UuidRepresentation.CSHARP_LEGACY: + if self.subtype == OLD_UUID_SUBTYPE: + return UUID(bytes_le=self) + else: + # uuid_representation == UuidRepresentation.STANDARD + if self.subtype == UUID_SUBTYPE: + return UUID(bytes=self) + + raise ValueError( + "cannot decode subtype %s to %s" + % (self.subtype, UUID_REPRESENTATION_NAMES[uuid_representation]) + ) + + @property + def subtype(self): + """Subtype of this binary data.""" + return self.__subtype + + def __getnewargs__(self): + """ """ + # Work around http://bugs.python.org/issue7382 + data = super(Binary, self).__getnewargs__()[0] + if not isinstance(data, bytes): + data = data.encode("latin-1") + return data, self.__subtype + + def __eq__(self, other): + """ + + :param other: + + """ + if isinstance(other, Binary): + return (self.__subtype, bytes(self)) == ( + other.subtype, + bytes(other), + ) + # We don't return NotImplemented here because if we did then + # Binary("foo") == "foo" would return True, since Binary is a + # subclass of str... + return False + + def __hash__(self): + """ """ + return super(Binary, self).__hash__() ^ hash(self.__subtype) + + def __ne__(self, other): + """ + + :param other: + + """ + return not self == other + + def __repr__(self): + """ """ + return "Binary(%s, %s)" % (bytes.__repr__(self), self.__subtype) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.rsi_strategy:[124:166] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[313:363] + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + # 加载数据时不保留原有索引结构 + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + # 查找日期列(兼容不同命名) + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + # 设置日期索引 + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + # 创建数据feed + data0 = bt.feeds.PandasData( + dataname=df0, + datetime=None, # 使用索引 + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) + return data0, data1 + except Exception as e: + print(f"加载数据时出错: {e}") + return None, None + + +# 其余代码保持不变 +def configure_cerebro(**kwargs): + """ + + :param **kwargs: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[132:174] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[306:356] + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + # 加载数据时不保留原有索引结构 + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + # 查找日期列(兼容不同命名) + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + # 设置日期索引 + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + # 创建数据feed + data0 = bt.feeds.PandasData( + dataname=df0, + datetime=None, # 使用索引 + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg + data1 = bt.feeds.PandasData( + dataname=df1, + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg + return data0, data1 + except Exception as e: + print(f"加载数据时出错: {e}") + return None, None + + +# 配置回测引擎 +def configure_cerebro(**kwargs): + """ + + :param **kwargs: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[198:240] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[187:229] + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { + "win": win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[198:239] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[219:260] + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # 获取交易统计 + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, + "total_trades": total_trades, + "win_trades": win_trades, + "loss_trades": loss_trades, + "win_rate": win_rate, + "params": { (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[173:208] +==backtrader.samples.order-execution.order-execution:[254:289] + help="File to be read in", + ) + + parser.add_argument( + "--csvformat", + "-c", + required=False, + default="bt", + choices=[ + "bt", + "visualchart", + "sierrachart", + "yahoo", + "yahoo_unreversed", + ], + help="CSV Format", + ) + + parser.add_argument( + "--fromdate", + "-f", + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[244:295] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[135:189] + ) + + # Take previous win spread series (excluding current bar) + hist = self.spread_series.get(size=self.p.win, ago=0) + mu = np.mean(hist) + sigma = np.std(hist, ddof=1) + + if np.isnan(sigma) or sigma == 0: + return + + kappa = self.p.k_coeff * sigma + h = self.p.h_coeff * sigma + + s_t = self.spread_series[0] + + # Use corrected spread + s_t_corrected = s_t - mu # Corrected spread + + # Update positive/negative cumulative sums (using corrected spread) + self.g_pos = max(0, self.g_pos + s_t_corrected - kappa) + self.g_neg = max(0, self.g_neg - s_t_corrected - kappa) + + position_size = self.getposition(self.data0).size + + # Open position logic + if position_size == 0: + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + + if self.g_pos > h: + # Calculate signal strength: magnitude of cumulative sum + # exceeding threshold h + signal_strength = (self.g_pos - h) / h + self._open_position(short=True, signal_strength=signal_strength) + self.g_pos = self.g_neg = 0 + elif self.g_neg > h: + # Calculate signal strength: magnitude of cumulative sum + # exceeding threshold h + signal_strength = (self.g_neg - h) / h + self._open_position(short=False, signal_strength=signal_strength) + self.g_pos = self.g_neg = 0 + else: + # Existing position: increase holding days counter + if self.in_position: + self.holding_counter += 1 + + # Close position when target holding days are reached + if self.holding_counter >= self.target_holding_days: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.binary:[58:224] +==backtrader.xtquant.xtbson.bson37.binary:[63:221] +class UuidRepresentation: + """ """ + + UNSPECIFIED = 0 + """An unspecified UUID representation. + + When configured, :class:`uuid.UUID` instances will **not** be + automatically encoded to or decoded from :class:`~bson.binary.Binary`. + When encoding a :class:`uuid.UUID` instance, an error will be raised. + To encode a :class:`uuid.UUID` instance with this configuration, it must + be wrapped in the :class:`~bson.binary.Binary` class by the application + code. When decoding a BSON binary field with a UUID subtype, a + :class:`~bson.binary.Binary` instance will be returned instead of a + :class:`uuid.UUID` instance. + + See :ref:`unspecified-representation-details` for details. + + .. versionadded:: 3.11 + """ + + STANDARD = UUID_SUBTYPE + """The standard UUID representation. + + :class:`uuid.UUID` instances will automatically be encoded to + and decoded from . binary, using RFC-4122 byte order with + binary subtype :data:`UUID_SUBTYPE`. + + See :ref:`standard-representation-details` for details. + + .. versionadded:: 3.11 + """ + + PYTHON_LEGACY = OLD_UUID_SUBTYPE + """The Python legacy UUID representation. + + :class:`uuid.UUID` instances will automatically be encoded to + and decoded from . binary, using RFC-4122 byte order with + binary subtype :data:`OLD_UUID_SUBTYPE`. + + See :ref:`python-legacy-representation-details` for details. + + .. versionadded:: 3.11 + """ + + JAVA_LEGACY = 5 + """The Java legacy UUID representation. + + :class:`uuid.UUID` instances will automatically be encoded to + and decoded from . binary subtype :data:`OLD_UUID_SUBTYPE`, + using the Java driver's legacy byte order. + + See :ref:`java-legacy-representation-details` for details. + + .. versionadded:: 3.11 + """ + + CSHARP_LEGACY = 6 + """The C#/.net legacy UUID representation. + + :class:`uuid.UUID` instances will automatically be encoded to + and decoded from . binary subtype :data:`OLD_UUID_SUBTYPE`, + using the C# driver's legacy byte order. + + See :ref:`csharp-legacy-representation-details` for details. + + .. versionadded:: 3.11 + """ + + +STANDARD = UuidRepresentation.STANDARD +"""An alias for :data:`UuidRepresentation.STANDARD`. + +.. versionadded:: 3.0 +""" + +PYTHON_LEGACY = UuidRepresentation.PYTHON_LEGACY +"""An alias for :data:`UuidRepresentation.PYTHON_LEGACY`. + +.. versionadded:: 3.0 +""" + +JAVA_LEGACY = UuidRepresentation.JAVA_LEGACY +"""An alias for :data:`UuidRepresentation.JAVA_LEGACY`. + +.. versionchanged:: 3.6 + BSON binary subtype 4 is decoded using RFC-4122 byte order. +.. versionadded:: 2.3 +""" + +CSHARP_LEGACY = UuidRepresentation.CSHARP_LEGACY +"""An alias for :data:`UuidRepresentation.CSHARP_LEGACY`. + +.. versionchanged:: 3.6 + BSON binary subtype 4 is decoded using RFC-4122 byte order. +.. versionadded:: 2.3 +""" + +ALL_UUID_SUBTYPES = (OLD_UUID_SUBTYPE, UUID_SUBTYPE) +ALL_UUID_REPRESENTATIONS = ( + UuidRepresentation.UNSPECIFIED, + UuidRepresentation.STANDARD, + UuidRepresentation.PYTHON_LEGACY, + UuidRepresentation.JAVA_LEGACY, + UuidRepresentation.CSHARP_LEGACY, +) +UUID_REPRESENTATION_NAMES = { + UuidRepresentation.UNSPECIFIED: "UuidRepresentation.UNSPECIFIED", + UuidRepresentation.STANDARD: "UuidRepresentation.STANDARD", + UuidRepresentation.PYTHON_LEGACY: "UuidRepresentation.PYTHON_LEGACY", + UuidRepresentation.JAVA_LEGACY: "UuidRepresentation.JAVA_LEGACY", + UuidRepresentation.CSHARP_LEGACY: "UuidRepresentation.CSHARP_LEGACY", +} + +MD5_SUBTYPE = 5 +"""BSON binary subtype for an MD5 hash. +""" + +COLUMN_SUBTYPE = 7 +"""BSON binary subtype for columns. + +.. versionadded:: 4.0 +""" + +USER_DEFINED_SUBTYPE = 128 +"""BSON binary subtype for any user defined structure. +""" + + +class Binary(bytes): + """Representation of BSON binary data. + + This is necessary because we want to represent Python strings as + the BSON string type. We need to wrap binary data so we can tell + the difference between what should be considered binary data and + what should be considered a string when we encode to BSON. + + Raises TypeError if `data` is not an instance of :class:`bytes` + (:class:`str` in python 2) or `subtype` is not an instance of + :class:`int`. Raises ValueError if `subtype` is not in [0, 256). + + .. note:: + In python 3 instances of Binary with subtype 0 will be decoded + directly to :class:`bytes`. + + :Parameters: + - `data`: the binary data to represent. Can be any bytes-like type + that implements the buffer protocol. + - `subtype` (optional): the `binary subtype + `_ + to use + + .. versionchanged:: 3.9 + Support any bytes-like type that implements the buffer protocol. + + + """ + + _type_marker = 5 + + def __new__(cls, data, subtype=BINARY_SUBTYPE): + """ + + :param data: + :param subtype: (Default value = BINARY_SUBTYPE) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[127:188] +==backtrader.samples.multidata-strategy.multidata-strategy:[129:190] + print("==================================================") + print("Starting Value - %.2f" % self.broker.startingcash) + print("Ending Value - %.2f" % self.broker.getvalue()) + print("==================================================") + + +def runstrategy(): + """ """ + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data0 = btfeeds.YahooFinanceCSVData( + dataname=args.data0, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro + cerebro.adddata(data0) + + # Create the 2nd data + data1 = btfeeds.YahooFinanceCSVData( + dataname=args.data1, fromdate=fromdate, todate=todate + ) + + # Add the 2nd data to cerebro + cerebro.adddata(data1) + + # Add the strategy + cerebro.addstrategy(MultiDataStrategy, period=args.period, stake=args.stake) + + # Add the commission - only stocks like a for each operation + cerebro.broker.setcash(args.cash) + + # Add the commission - only stocks like a for each operation + cerebro.broker.setcommission(commission=args.commperc) + + # And run it + cerebro.run( + runonce=not args.runnext, + preload=not args.nopreload, + oldsync=args.oldsync, + ) + + # Plot if requested + if args.plot: + cerebro.plot(numfigs=args.numfigs, volume=False, zdown=False) + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser(description="MultiData Strategy") + + parser.add_argument( + "--data0", + "-d0", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[358:397] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[236:284] + print(f"加仓做空J {add_size0}手, 做多JM {add_size1}手") + self.sell(data=self.data0, size=add_size0) + self.buy(data=self.data1, size=add_size1) + self.position_layers += 1 + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_layers = 0 # 平仓重置加仓层数 + + def notify_trade(self, trade): + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + lookback_period, + upper_quantile, + lower_quantile, + spread_window=60, +): + """运行单次回测""" + # 创建回测引擎 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[128:177] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[150:200] + ): + self._close_positions() + + def notify_trade(self, trade): + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + rsi_period, + rsi_threshold, + macd_fast, + macd_slow, + macd_signal, + spread_window=60, +): + """运行单次回测""" + # 创建回测引擎 + cerebro = bt.Cerebro(stdstats=False) + cerebro.adddata(data0, name="data0") + cerebro.adddata(data1, name="data1") + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[38:93] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[56:111] + ) + + return parser.parse_args() + + +def calculate_rolling_spread( + df0: pd.DataFrame, # 必含 'date' 与价格列 + df1: pd.DataFrame, + window: int = 30, + fields=("open", "high", "low", "close"), +) -> pd.DataFrame: + """ + 计算滚动 β,并为指定价格字段生成价差 (spread): + spread_x = price0_x - β_{t-1} * price1_x + """ + # 1) 用收盘价对齐合并(β 仍用 close 估计) + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.talib.tablibsartest:[66:109] +==backtrader.samples.talib.talibtest:[184:227] + if args.plot: + pkwargs = dict(style="candle") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for sizer", + ) + + parser.add_argument( + "--data0", + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[248:289] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[407:448] + df0 = pd.read_hdf(output_file, key=args.df0_key).reset_index() + df1 = pd.read_hdf(output_file, key=args.df1_key).reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + # 计算滚动价差 + df_spread = calculate_rolling_spread(df0, df1, window=args.window) + print("滚动价差计算完成,系数示例:") + print(df_spread.head()) + + # 设置回测日期 + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + + # 创建回测引擎 + cerebro = bt.Cerebro(stdstats=False) + cerebro.adddata(data0, name=args.df0_key.replace("/", "")) + cerebro.adddata(data1, name=args.df1_key.replace("/", "")) + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[141:189] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[159:208] + self._close_positions() + + def notify_trade(self, trade): + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, + spread_window=60, + initial_cash=100000, +): + """运行单次回测""" + # 创建回测引擎 + cerebro = bt.Cerebro(stdstats=False) + cerebro.adddata(data0, name="data0") + cerebro.adddata(data1, name="data1") + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[102:144] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[172:214] + if len(self.spread_series) < self.p.win + 2: + return + + # 2) 取"上一 bar"结束时的 rolling σ,避免未来函数 + hist = self.spread_series.get(size=self.p.win + 1)[:-1] # 不含当根 + sigma = np.std(hist, ddof=1) + if np.isnan(sigma) or sigma == 0: + return + + kappa = self.p.k_coeff * sigma + h = self.p.h_coeff * sigma + s_t = self.spread_series[0] + + # 3) 更新正/负累积和 + self.g_pos = max(0, self.g_pos + s_t - kappa) + self.g_neg = max(0, self.g_neg - s_t - kappa) + + position_size = self.getposition(self.data0).size + + # 4) 开仓逻辑——当 g 超过 h + if position_size == 0: + # 计算动态配比(与原来一致) + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + + if self.g_pos > h: # 价差持续走高 → 做空价差 + self._open_position(short=True) + self.g_pos = self.g_neg = 0 # 归零累积和 + elif self.g_neg > h: # 价差持续走低 → 做多价差 + self._open_position(short=False) + self.g_pos = self.g_neg = 0 + else: + # 5) 平仓逻辑——价差回到 0 附近 + if position_size > 0 and abs(s_t) < kappa: + self._close_positions() + elif position_size < 0 and abs(s_t) < kappa: + self._close_positions() + + def notify_trade(self, trade): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[149:285] +==backtrader.backtrader.brokers.ibbroker:[202:335] + try: + return self.notifs.popleft() + except IndexError: + pass + + return None + + def set_fundmode(self, fundmode, fundstartval=None): + """Set the actual fundmode (True or False) + + If the argument fundstartval is not ``None``, it will used + + :param fundmode: + :param fundstartval: (Default value = None) + + """ + self.p.fundmode = fundmode + if fundstartval is not None: + self.set_fundstartval(fundstartval) + + def get_fundmode(self): + """Returns the actual fundmode (True or False)""" + return self.p.fundmode + + fundmode = property(get_fundmode, set_fundmode) + + def set_fundstartval(self, fundstartval): + """Set the starting value of the fund-like performance tracker + + :param fundstartval: + + """ + self.p.fundstartval = fundstartval + + def set_int2pnl(self, int2pnl): + """Configure assignment of interest to profit and loss + + :param int2pnl: + + """ + self.p.int2pnl = int2pnl + + def set_coc(self, coc): + """Configure the Cheat-On-Close method to buy the close on order bar + + :param coc: + + """ + self.p.coc = coc + + def set_coo(self, coo): + """Configure the Cheat-On-Open method to buy the close on order bar + + :param coo: + + """ + self.p.coo = coo + + def set_shortcash(self, shortcash): + """Configure the shortcash parameters + + :param shortcash: + + """ + self.p.shortcash = shortcash + + def set_slippage_perc( + self, + perc, + slip_open=True, + slip_limit=True, + slip_match=True, + slip_out=False, + ): + """Configure slippage to be percentage based + + :param perc: + :param slip_open: (Default value = True) + :param slip_limit: (Default value = True) + :param slip_match: (Default value = True) + :param slip_out: (Default value = False) + + """ + self.p.slip_perc = perc + self.p.slip_fixed = 0.0 + self.p.slip_open = slip_open + self.p.slip_limit = slip_limit + self.p.slip_match = slip_match + self.p.slip_out = slip_out + + def set_slippage_fixed( + self, + fixed, + slip_open=True, + slip_limit=True, + slip_match=True, + slip_out=False, + ): + """Configure slippage to be fixed points based + + :param fixed: + :param slip_open: (Default value = True) + :param slip_limit: (Default value = True) + :param slip_match: (Default value = True) + :param slip_out: (Default value = False) + + """ + self.p.slip_perc = 0.0 + self.p.slip_fixed = fixed + self.p.slip_open = slip_open + self.p.slip_limit = slip_limit + self.p.slip_match = slip_match + self.p.slip_out = slip_out + + def set_filler(self, filler): + """Sets a volume filler for volume filling execution + + :param filler: + + """ + self.p.filler = filler + + def set_checksubmit(self, checksubmit): + """Sets the checksubmit parameter + + :param checksubmit: + + """ + self.p.checksubmit = checksubmit + + def set_eosbar(self, eosbar): + """Sets the eosbar parameter (alias: ``seteosbar`` + + :param eosbar: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.decimal128:[23:64] +==backtrader.xtquant.xtbson.bson37.decimal128:[22:55] +_PACK_64 = struct.Struct(" 0.0: + if self.p.printops: + self.log("BUY CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.buy() + chkprice = "%.2f" % self.data.close[0] + self.buycreate.append(chkprice) + + elif self.cross < 0.0: + if self.p.printops: + self.log("SELL CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.close() + chkprice = "%.2f" % self.data.close[0] + self.sellcreate.append(chkprice) + + +chkdatas = 1 + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[107:154] +==backtrader.samples.order-close.close-minute:[79:126] + args = parse_args() + + cerebro = bt.Cerebro() + cerebro.adddata(getdata(args)) + cerebro.addstrategy(St) + if args.eosbar: + cerebro.broker.seteosbar(True) + + cerebro.run() + + +def getdata(args): + """ + + :param args: + + """ + + dataformat = dict( + bt=btfeeds.BacktraderCSVData, + visualchart=btfeeds.VChartCSVData, + sierrachart=btfeeds.SierraChartCSVData, + yahoo=btfeeds.YahooFinanceCSVData, + yahoo_unreversed=btfeeds.YahooFinanceCSVData, + ) + + dfkwargs = dict() + if args.csvformat == "yahoo_unreversed": + dfkwargs["reverse"] = True + + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dfkwargs["fromdate"] = fromdate + + if args.todate: + fromdate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dfkwargs["todate"] = todate + + if args.tend is not None: + # internally only the "time" part is used + dfkwargs["sessionend"] = datetime.datetime.strptime(args.tend, "%H:%M") + + dfkwargs["dataname"] = args.infile + dfcls = dataformat[args.csvformat] + + data = dfcls(**dfkwargs) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[184:217] +==backtrader.samples.pyfoliotest.pyfoliotest:[186:219] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--printout", + required=False, + action="store_true", + help="Print data lines", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[162:195] +==backtrader.samples.signals-strategy.signals-strategy:[128:161] + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/2005-2006-day-001.txt", + help="Specific data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[229:263] +==backtrader.samples.writer-test.writer-test:[205:239] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( + "--onlylong", "-ol", action="store_true", help="Do only long operations" + ) + + parser.add_argument( + "--writercsv", + "-wcsv", + action="store_true", + help="Tell the writer to produce a csv stream", + ) + + parser.add_argument( + "--csvcross", + action="store_true", + help="Output the CrossOver signals to CSV", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[54:93] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[18:57] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建分位数指标(自定义) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[144:189] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[247:291] + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + lookback_period, + upper_quantile, + lower_quantile, + spread_window=60, +): + """运行单次回测""" + # 创建回测引擎 + cerebro = bt.Cerebro(stdstats=False) + cerebro.adddata(data0, name="data0") + cerebro.adddata(data1, name="data1") + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[19:58] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[72:111] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): + raise ValueError(f"未知字段 {f}") + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.talib.tablibsartest:[106:140] +==backtrader.samples.talib.talibtest:[240:274] + ) + + parser.add_argument( + "--use-next", + required=False, + action="store_true", + help="Use next (step by step) instead of once (batch)", + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example (escape the quotes if needed):\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[53:132] +==backtrader.samples.oandatest.oandatest:[52:131] + ) + + def __init__(self): + """ """ + # To control operation entries + self.orderid = list() + self.order = None + + self.counttostop = 0 + self.datastatus = 0 + + # Create SMA on 2nd data + self.sma = bt.indicators.MovAv.SMA(self.data, period=self.p.smaperiod) + + print("--------------------------------------------------") + print("Strategy Created") + print("--------------------------------------------------") + + def notify_data(self, data, status, *args, **kwargs): + """ + + :param data: + :param status: + :param *args: + :param **kwargs: + + """ + print("*" * 5, "DATA NOTIF:", data._getstatusname(status), *args) + if status == data.LIVE: + self.counttostop = self.p.stopafter + self.datastatus = 1 + + def notify_store(self, msg, *args, **kwargs): + """ + + :param msg: + :param *args: + :param **kwargs: + + """ + print("*" * 5, "STORE NOTIF:", msg) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed, order.Cancelled, order.Rejected]: + self.order = None + + print("-" * 50, "ORDER BEGIN", datetime.datetime.now()) + print(order) + print("-" * 50, "ORDER END") + + def notify_trade(self, trade): + """ + + :param trade: + + """ + print("-" * 50, "TRADE BEGIN", datetime.datetime.now()) + print(trade) + print("-" * 50, "TRADE END") + + def prenext(self): + """ """ + self.next(frompre=True) + + def next(self, frompre=False): + """ + + :param frompre: (Default value = False) + + """ + txt = list() + txt.append("Data0") + txt.append("%04d" % len(self.data0)) + dtfmt = "%Y-%m-%dT%H:%M:%S.%f" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-filler.data-filler:[152:188] +==backtrader.samples.relative-volume.relative-volume:[101:137] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--writer", "-w", action="store_true", help="Add a writer to cerebro" + ) + + parser.add_argument( + "--wrcsv", + "-wc", + action="store_true", + help="Enable CSV Output in the writer", + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.filters.bsplitter:[62:124] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[131:195] + params = (("closevol", 0.5),) # 0 -> 1 amount of volume to keep for close + + # replaying = True + + def __init__(self, data): + """ + + :param data: + + """ + self.lastdt = None + + def __call__(self, data): + """ + + :param data: + + """ + # Make a copy of the new bar and remove it from stream + datadt = data.datetime.date() # keep the date + + if self.lastdt == datadt: + return False # skip bars that come again in the filter + + self.lastdt = datadt # keep ref to last seen bar + + # Make a copy of current data for ohlbar + ohlbar = [data.lines[i][0] for i in range(data.size())] + closebar = ohlbar[:] # Make a copy for the close + + # replace close price with o-h-l average + ohlprice = ohlbar[data.Open] + ohlbar[data.High] + ohlbar[data.Low] + ohlbar[data.Close] = ohlprice / 3.0 + + vol = ohlbar[data.Volume] # adjust volume + ohlbar[data.Volume] = vohl = int(vol * (1.0 - self.p.closevol)) + + oi = ohlbar[data.OpenInterest] # adjust open interst + ohlbar[data.OpenInterest] = 0 + + # Adjust times + dt = datetime.datetime.combine(datadt, data.p.sessionstart) + ohlbar[data.DateTime] = data.date2num(dt) + + # Ajust closebar to generate a single tick -> close price + closebar[data.Open] = cprice = closebar[data.Close] + closebar[data.High] = cprice + closebar[data.Low] = cprice + closebar[data.Volume] = vol - vohl + ohlbar[data.OpenInterest] = oi + + # Adjust times + dt = datetime.datetime.combine(datadt, data.p.sessionend) + closebar[data.DateTime] = data.date2num(dt) + + # Update stream + data.backwards(force=True) # remove the copied bar from stream + data._add2stack(ohlbar) # add ohlbar to stack + # Add 2nd part to stash to delay processing to next round + data._add2stack(closebar, stash=True) + + return False # initial tick can be further processed from stack (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.kselrsi.ksignal:[161:192] +==backtrader.samples.sigsmacross.sigsmacross:[141:172] + ) + + parser.add_argument( + "--strat", + required=False, + action="store", + default="", + help="Arguments for the strategy", + ) + + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const="{}", + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[286:319] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[216:249] + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument("--cash", default=100000, type=int, help="Starting Cash") + + parser.add_argument( + "--runnext", + action="store_true", + help="Use next by next instead of runonce", + ) + + parser.add_argument( + "--nopreload", action="store_true", help="Do not preload the data" + ) + + parser.add_argument( + "--oldsync", + action="store_true", + help="Use old data synchronization method", + ) + + parser.add_argument( + "--commperc", + default=0.005, + type=float, + help="Percentage commission (0.005 is 0.5%%", + ) + + parser.add_argument( + "--stake", default=10, type=int, help="Stake to apply in each operation" + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[156:191] +==backtrader.xtquant.xtbson.bson37.codec_options:[199:236] + if self._fallback_encoder is not None: + if not callable(fallback_encoder): + raise TypeError( + "fallback_encoder %r is not a callable" % (fallback_encoder) + ) + + for codec in self.__type_codecs: + is_valid_codec = False + if isinstance(codec, TypeEncoder): + self._validate_type_encoder(codec) + is_valid_codec = True + self._encoder_map[codec.python_type] = codec.transform_python + if isinstance(codec, TypeDecoder): + is_valid_codec = True + self._decoder_map[codec.bson_type] = codec.transform_bson + if not is_valid_codec: + raise TypeError( + "Expected an instance of %s, %s, or %s, got %r instead" + % ( + TypeEncoder.__name__, + TypeDecoder.__name__, + TypeCodec.__name__, + codec, + ) + ) + + def _validate_type_encoder(self, codec): + """ + + :param codec: + + """ + from . import _BUILT_IN_TYPES + + for pytype in _BUILT_IN_TYPES: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.code:[57:102] +==backtrader.xtquant.xtbson.bson37.code:[68:120] + if not isinstance(code, str): + raise TypeError("code must be an instance of str") + + self = str.__new__(cls, code) + + try: + self.__scope = code.scope # type: ignore + except AttributeError: + self.__scope = None + + if scope is not None: + if not isinstance(scope, _Mapping): + raise TypeError("scope must be an instance of dict") + if self.__scope is not None: + self.__scope.update(scope) # type: ignore + else: + self.__scope = scope + + if kwargs: + if self.__scope is not None: + self.__scope.update(kwargs) # type: ignore + else: + self.__scope = kwargs + + return self + + @property + def scope(self) -> Optional[Mapping[str, Any]]: + """Scope dictionary for this instance or ``None``. + + + :rtype: Optional[Mapping[str,Any]] + + """ + return self.__scope + + def __repr__(self): + """ """ + return "Code(%s, %r)" % (str.__repr__(self), self.__scope) + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, Code): + return (self.__scope, str(self)) == (other.__scope, str(other)) + return False + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-timereturn:[48:94] +==backtrader.tests.test_bbroker_try_exec_limit:[42:88] + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if isinstance(order, bt.BuyOrder): + if self.p.printops: + txt = "BUY, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + chkprice = "%.2f" % order.executed.price + self.buyexec.append(chkprice) + else: # elif isinstance(order, SellOrder): + if self.p.printops: + txt = "SELL, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + + chkprice = "%.2f" % order.executed.price + self.sellexec.append(chkprice) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + if self.p.printops: + self.log("%s ," % order.Status[order.status]) + + # Allow new orders (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[351:380] +==backtrader.samples.sizertest.sizertest:[149:178] + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[37:82] +==backtrader.samples.data-pandas.data_ploars_optix:[44:89] + lines = ( + "optix_close", + "optix_pess", + "optix_opt", + ) + params = (("optix_close", -1), ("optix_pess", -1), ("optix_opt", -1)) + + if False: + # No longer needed with version 1.9.62.122 + datafields = btfeeds.PandasData.datafields + ( + ["optix_close", "optix_pess", "optix_opt"] + ) + + +class StrategyOptix(bt.Strategy): + """ """ + + def next(self): + """ """ + print( + "%03d %f %f, %f" + % ( + len(self), + self.data.optix_close[0], + self.data.lines.optix_pess[0], + self.data.optix_opt[0], + ) + ) + + +def runstrat(): + """ """ + args = parse_args() + + # Create a cerebro entity + cerebro = bt.Cerebro(stdstats=False) + + # Add a strategy + cerebro.addstrategy(StrategyOptix) + + # Get a polars dataframe + datapath = "../../datas/2006-day-001-optix.txt" + + # Simulate the header row isn't there if noheaders requested + skiprows = 1 if args.noheaders else 0 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sizertest.sizertest:[132:169] +==backtrader.samples.talib.tablibsartest:[72:109] + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for sizer", + ) + + parser.add_argument( + "--data0", + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[519:548] +==backtrader.samples.vctest.vctest:[425:454] + ) + + parser.add_argument( + "--smaperiod", + default=5, + type=int, + required=False, + action="store", + help="Period to apply to the Simple Moving Average", + ) + + pgroup = parser.add_mutually_exclusive_group(required=False) + + pgroup.add_argument( + "--replay", + required=False, + action="store_true", + help="replay to chosen timeframe", + ) + + pgroup.add_argument( + "--resample", + required=False, + action="store_true", + help="resample to chosen timeframe", + ) + + parser.add_argument( + "--timeframe", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[53:129] +==backtrader.samples.vctest.vctest:[48:124] + ) + + def __init__(self): + """ """ + # To control operation entries + self.orderid = list() + self.order = None + + self.counttostop = 0 + self.datastatus = 0 + + # Create SMA on 2nd data + self.sma = bt.indicators.MovAv.SMA(self.data, period=self.p.smaperiod) + + print("--------------------------------------------------") + print("Strategy Created") + print("--------------------------------------------------") + + def notify_data(self, data, status, *args, **kwargs): + """ + + :param data: + :param status: + :param *args: + :param **kwargs: + + """ + print("*" * 5, "DATA NOTIF:", data._getstatusname(status), *args) + if status == data.LIVE: + self.counttostop = self.p.stopafter + self.datastatus = 1 + + def notify_store(self, msg, *args, **kwargs): + """ + + :param msg: + :param *args: + :param **kwargs: + + """ + print("*" * 5, "STORE NOTIF:", msg) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed, order.Cancelled, order.Rejected]: + self.order = None + + print("-" * 50, "ORDER BEGIN", datetime.datetime.now()) + print(order) + print("-" * 50, "ORDER END") + + def notify_trade(self, trade): + """ + + :param trade: + + """ + print("-" * 50, "TRADE BEGIN", datetime.datetime.now()) + print(trade) + print("-" * 50, "TRADE END") + + def prenext(self): + """ """ + self.next(frompre=True) + + def next(self, frompre=False): + """ + + :param frompre: (Default value = False) + + """ + txt = list() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[141:169] +==backtrader.samples.oandatest.oandatest:[140:168] + print(", ".join(txt)) + + if len(self.datas) > 1 and len(self.data1): + txt = list() + txt.append("Data1") + txt.append("%04d" % len(self.data1)) + dtfmt = "%Y-%m-%dT%H:%M:%S.%f" + txt.append("{}".format(self.data1.datetime[0])) + txt.append("%s" % self.data1.datetime.datetime(0).strftime(dtfmt)) + txt.append("{}".format(self.data1.open[0])) + txt.append("{}".format(self.data1.high[0])) + txt.append("{}".format(self.data1.low[0])) + txt.append("{}".format(self.data1.close[0])) + txt.append("{}".format(self.data1.volume[0])) + txt.append("{}".format(self.data1.openinterest[0])) + txt.append("{}".format(float("NaN"))) + print(", ".join(txt)) + + if self.counttostop: # stop after x live lines + self.counttostop -= 1 + if not self.counttostop: + self.env.runstop() + return + + if not self.p.trade: + return + + if self.datastatus and not self.position and len(self.orderid) < 1: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[214:247] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[373:406] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + def get_backtest_data(self): + """获取回测数据,用于导出到CSV""" + return pd.DataFrame(self.record_data) + + +def main(): + # 解析命令行参数 + args = parse_args() + print(f"解析参数: {args}") + + # 读取数据 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[141:182] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[194:224] + self._close_positions() + + def notify_trade(self, trade): + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, + spread_window=60, + initial_cash=100000, +): + """运行单次回测""" + # 创建回测引擎 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[548:573] +==backtrader.xtquant.xtbson.bson37.__init__:[850:875] + ord(BSONNUM): _get_float, + ord(BSONSTR): _get_string, + ord(BSONOBJ): _get_object, + ord(BSONARR): _get_array, + ord(BSONBIN): _get_binary, + ord(BSONUND): lambda u, v, w, x, y, z: (None, w), # Deprecated undefined + ord(BSONOID): _get_oid, + ord(BSONBOO): _get_boolean, + ord(BSONDAT): _get_date, + ord(BSONNUL): lambda u, v, w, x, y, z: (None, w), + ord(BSONRGX): _get_regex, + ord(BSONREF): _get_ref, # Deprecated DBPointer + ord(BSONCOD): _get_code, + ord(BSONSYM): _get_string, # Deprecated symbol + ord(BSONCWS): _get_code_w_scope, + ord(BSONINT): _get_int, + ord(BSONTIM): _get_timestamp, + ord(BSONLON): _get_int64, + ord(BSONDEC): _get_decimal128, + ord(BSONMIN): lambda u, v, w, x, y, z: (MinKey(), w), + ord(BSONMAX): lambda u, v, w, x, y, z: (MaxKey(), w), +} + +if _USE_C: + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[135:164] +==backtrader.tests.test_analyzer-timereturn:[125:154] + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") + else: + pass + + def next(self): + """ """ + if self.p.printdata: + self.log( + "Open, High, Low, Close, %.2f, %.2f, %.2f, %.2f, Sma, %f" + % ( + self.data.open[0], + self.data.high[0], + self.data.low[0], + self.data.close[0], + self.sma[0], + ) + ) + self.log("Close %.2f - Sma %.2f" % (self.data.close[0], self.sma[0])) + + if self.orderid: + # if an order is active, no new orders are allowed + return + + if not self.position.size: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[587:614] +==backtrader.samples.vctest.vctest:[468:495] + ) + + parser.add_argument( + "--no-bar2edge", + required=False, + action="store_true", + help="no bar2edge for resample/replay", + ) + + parser.add_argument( + "--no-adjbartime", + required=False, + action="store_true", + help="no adjbartime for resample/replay", + ) + + parser.add_argument( + "--no-rightedge", + required=False, + action="store_true", + help="no rightedge for resample/replay", + ) + + parser.add_argument( + "--broker", + required=False, + action="store_true", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[525:552] +==backtrader.samples.oandatest.oandatest:[451:478] + ) + + parser.add_argument( + "--data0", + default=None, + required=True, + action="store", + help="data 0 into the system", + ) + + parser.add_argument( + "--data1", + default=None, + required=False, + action="store", + help="data 1 into the system", + ) + + parser.add_argument( + "--timezone", + default=None, + required=False, + action="store", + help="timezone to get time output into (pytz names)", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[110:133] +==backtrader.contrib.utils.iqfeed-to-influxdb:[233:256] + ) + parser.add_argument( + "--username", + required=False, + action="store", + default=None, + help="InfluxDB username.", + ) + parser.add_argument( + "--password", + required=False, + action="store", + default=None, + help="InfluxDB password.", + ) + parser.add_argument( + "--database", + required=False, + action="store", + default=None, + help="InfluxDB database to use.", + ) + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[177:220] +==backtrader.arbitrage.classic_indicators.bollingband:[64:108] + self.close(data=self.data0) + self.close(data=self.data1) + + def notify_trade(self, trade): + """ + + :param trade: + + """ + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + # def notify_order(self, order): + # if order.status in [order.Submitted, order.Accepted]: + # # Order status submitted/accepted, in pending order status. + # return + # + # # Order is decided, execute the following statements + # if order.status in [order.Completed]: + # if order.isbuy(): + # print(f'executed date {bt.num2date(order.executed.dt)},executed price {order.executed.price}, created date {bt.num2date(order.created.dt)}') + + +# Create backtest engine (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[197:224] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[370:397] + if not self.p.verbose: + return + + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + def get_backtest_data(self): + """获取回测数据,用于导出到CSV""" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[43:74] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[43:76] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + +class DynamicSpreadCUSUMStrategy(bt.Strategy): + params = ( + ("win", 20), # rolling 窗口 + ("k_coeff", 0.5), # κ = k_coeff * σ + ("h_coeff", 5.0), # h = h_coeff * σ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[211:243] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[299:330] + self._close_positions() + + def notify_trade(self, trade): + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + def get_backtest_data(self): + """获取回测数据,用于导出到CSV""" + return pd.DataFrame(self.record_data) + + +def main(): + # 解析命令行参数 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[49:76] +==backtrader.samples.pyfoliotest.pyfoliotest:[47:75] + if self.p.printout: + txtfields = list() + txtfields.append("Len") + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + def next(self): + """ """ + if self.p.printout: + # Print only 1st data ... is just a check that things are running + txtfields = list() + txtfields.append("%04d" % len(self)) + txtfields.append(self.data.datetime.datetime(0).isoformat()) + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[235:261] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[354:380] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[701:727] +==backtrader.samples.vctest.vctest:[504:530] + ) + + parser.add_argument( + "--trade", + required=False, + action="store_true", + help="Do Sample Buy/Sell operations", + ) + + parser.add_argument( + "--donotsell", + required=False, + action="store_true", + help="Do not sell after a buy", + ) + + parser.add_argument( + "--exectype", + default=bt.Order.ExecTypes[0], + choices=bt.Order.ExecTypes, + required=False, + action="store", + help="Execution to Use when opening position", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[114:141] +==backtrader.samples.data-pandas.data_ploars_optix:[120:147] + parser.add_argument( + "--noheaders", + action="store_true", + default=False, + required=False, + help="Do not use header rows", + ) + + parser.add_argument( + "--noprint", + action="store_true", + default=False, + help="Print the dataframe", + ) + + parser.add_argument( + "--noplot", + action="store_true", + default=False, + help="Do not plot the chart", + ) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[290:318] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[202:230] + ), + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[302:330] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[373:402] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + def get_backtest_data(self): + """获取回测数据,用于导出到CSV""" + return pd.DataFrame(self.record_data) + + +def main(): + # 解析命令行参数 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-timereturn:[109:138] +==backtrader.tests.test_bbroker_try_exec_limit:[100:129] + if self.p.printdata: + self.log("-------------------------", nodate=True) + self.log( + "Starting portfolio value: %.2f" % self.broker.getvalue(), + nodate=True, + ) + + self.tstart = time_clock() + + self.buycreate = list() + self.sellcreate = list() + self.buyexec = list() + self.sellexec = list() + + def stop(self): + """ """ + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") + else: + pass + + def print_signal(self): + """ """ + if self.p.printdata: + self.log( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[72:112] +==backtrader.samples.timers.scheduled:[60:100] + cheat=True, + ) + + self.order = None + + def prenext(self): + """ """ + self.next() + + def next(self): + """ """ + _, isowk, isowkday = self.datetime.date().isocalendar() + txt = "{}, {}, Week {}, Day {}, O {}, H {}, L {}, C {}".format( + len(self), + self.datetime.datetime(), + isowk, + isowkday, + self.data.open[0], + self.data.high[0], + self.data.low[0], + self.data.close[0], + ) + + print(txt) + + def notify_timer(self, timer, when, *args, **kwargs): + """ + + :param timer: + :param when: + :param *args: + :param **kwargs: + + """ + print( + "strategy notify_timer with tid {}, when {} cheat {}".format( + timer.p.tid, when, timer.p.cheat + ) + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.slippage.slippage:[231:258] +==backtrader.samples.vwr.vwr:[197:224] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[194:221] +==backtrader.samples.sizertest.sizertest:[200:227] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfolio2.pyfoliotest:[295:322] +==backtrader.samples.rollover.rollover:[195:222] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[416:443] +==backtrader.samples.talib.tablibsartest:[113:140] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example (escape the quotes if needed):\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[291:318] +==backtrader.samples.order_target.order_target:[238:265] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[121:147] +==backtrader.samples.macd-settings.macd-settings:[379:405] + ) + + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[419:444] +==backtrader.samples.vctest.vctest:[324:349] + ) + + parser.add_argument( + "--exactbars", + default=1, + type=int, + required=False, + action="store", + help="exactbars level, use 0/-1/-2 to enable plotting", + ) + + parser.add_argument( + "--plot", required=False, action="store_true", help="Plot if possible" + ) + + parser.add_argument( + "--stopafter", + default=0, + type=int, + required=False, + action="store", + help="Stop after x lines of LIVE data", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[289:316] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[203:230] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[135:170] +==backtrader.arbitrage.classic_indicators.bollingband:[73:108] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + # def notify_order(self, order): + # if order.status in [order.Submitted, order.Accepted]: + # # 订单状态 submitted/accepted,处于未决订单状态。 + # return + # + # # 订单已决,执行如下语句 + # if order.status in [order.Completed]: + # if order.isbuy(): + # print(f'executed date {bt.num2date(order.executed.dt)},executed price {order.executed.price}, created date {bt.num2date(order.created.dt)}') + + +# 读取数据 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[256:283] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[336:363] + spread_windows = [20, 30, 60] # 价差计算窗口 + + # 生成参数组合 + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + + for win in win_values: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[165:201] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[186:220] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + # def notify_order(self, order): + # if order.status in [order.Submitted, order.Accepted]: + # # Order status submitted/accepted, in pending order status. + # return + # + # # Order is decided, execute the following statements + # if order.status in [order.Completed]: + # if order.isbuy(): + # print(f'executed date {bt.num2date(order.executed.dt)},executed price {order.executed.price}, created date {bt.num2date(order.created.dt)}') + + +# Create backtest engine (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[147:182] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[214:238] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + +def run_strategy( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, + spread_window=60, + initial_cash=100000, +): + """运行单次回测""" + # 创建回测引擎 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[302:326] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[200:224] + if trade.isclosed: + print( + "TRADE %s CLOSED %s, PROFIT: GROSS %.2f, NET %.2f, PRICE %d" + % ( + trade.ref, + bt.num2date(trade.dtclose), + trade.pnl, + trade.pnlcomm, + trade.value, + ) + ) + elif trade.justopened: + print( + "TRADE %s OPENED %s , SIZE %2d, PRICE %d " + % ( + trade.ref, + bt.num2date(trade.dtopen), + trade.size, + trade.value, + ) + ) + + def get_backtest_data(self): + """Get backtest data for export to CSV""" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_kamaenvelope:[30:61] +==backtrader.tests.test_ind_smaenvelope:[30:61] +chkdatas = 1 +chkvals = [ + ["4063.463000", "3644.444667", "3554.693333"], + ["4165.049575", "3735.555783", "3643.560667"], + ["3961.876425", "3553.333550", "3465.826000"], +] + +chkmin = 30 +chkind = btind.SMAEnvelope + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[679:705] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[416:442] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example (escape the quotes if needed):\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[715:738] +==backtrader.samples.oandatest.oandatest:[640:663] + ) + + parser.add_argument( + "--exectype", + default=bt.Order.ExecTypes[0], + choices=bt.Order.ExecTypes, + required=False, + action="store", + help="Execution to Use when opening position", + ) + + parser.add_argument( + "--stake", + default=10, + type=int, + required=False, + action="store", + help="Stake to use in buy operations", + ) + + parser.add_argument( + "--valid", + default=None, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[676:700] +==backtrader.samples.oandatest.oandatest:[587:611] + ) + + parser.add_argument( + "--no-bar2edge", + required=False, + action="store_true", + help="no bar2edge for resample/replay", + ) + + parser.add_argument( + "--no-adjbartime", + required=False, + action="store_true", + help="no adjbartime for resample/replay", + ) + + parser.add_argument( + "--no-rightedge", + required=False, + action="store_true", + help="no rightedge for resample/replay", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[86:110] +==backtrader.samples.commission-schemes.commission-schemes:[165:189] + ) + + parser.add_argument( + "--data", + "-d", + default="../../datas/2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[217:242] +==backtrader.samples.order-history.order-history:[200:225] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.writer-test.writer-test:[199:223] +==backtrader.samples.yahoo-test.yahoo-test:[85:109] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[179:219] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[176:216] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + def notify_trade(self, trade): + """ + + :param trade: + + """ + if self.p.printlog and trade.isclosed: + print(f"平仓盈利: {trade.pnlcomm:.2f}") + + def stop(self): + """ """ + # 策略结束时绘制偏度图形 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[214:242] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[295:323] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(100000) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[368:394] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[361:387] + spread_window, + ) + results.append(result) + + # 打印当前结果 + print( + f" 夏普比率: {result['sharpe']:.4f}, 最大回撤:" + f" {result['drawdown']:.2f}%, 年化收益: {result['returns']:.2f}%, 胜率:" + f" {result['win_rate']:.2f}%" + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") + print(f"价差计算窗口: {best_result['params']['spread_window']}") + print(f"RSI周期: {best_result['params']['rsi_period']}") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[293:317] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[285:309] + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + + for rsi_period in rsi_period_values: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[290:316] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[256:282] + spread_windows = [20, 30, 60] # 价差计算窗口 + + # 生成参数组合 + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[302:326] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[259:283] + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + + for win in win_values: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[78:106] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[43:73] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) Clean up output + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# Create custom data class to support beta column + + +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread as close + ("beta", "beta"), # beta column + ("nocase", True), # Column names are case insensitive + ) + + +class DynamicSpreadCUSUMStrategy(bt.Strategy): + params = ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[43:71] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[100:130] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + +class DynamicSpreadCUSUMStrategy(bt.Strategy): + params = ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.objectid:[29:143] +==backtrader.xtquant.xtbson.bson37.objectid:[28:155] +_MAX_COUNTER_VALUE = 0xFFFFFF + + +def _raise_invalid_id(oid): + """ + + :param oid: + + """ + raise InvalidId( + "%r is not a valid ObjectId, it must be a 12-byte input" + " or a 24-character hex string" % oid + ) + + +def _random_bytes(): + """Get the 5-byte random field of an ObjectId.""" + return os.urandom(5) + + +class ObjectId(object): + """A MongoDB ObjectId.""" + + _pid = os.getpid() + + _inc = SystemRandom().randint(0, _MAX_COUNTER_VALUE) + _inc_lock = threading.Lock() + + __random = _random_bytes() + + __slots__ = ("__id",) + + _type_marker = 7 + + def __init__(self, oid=None): + """Initialize a new ObjectId. + + An ObjectId is a 12-byte unique identifier consisting of: + + - a 4-byte value representing the seconds since the Unix epoch, + - a 5-byte random value, + - a 3-byte counter, starting with a random value. + + By default, ``ObjectId()`` creates a new unique identifier. The + optional parameter `oid` can be an :class:`ObjectId`, or any 12 + :class:`bytes`. + + For example, the 12 bytes b'foo-bar-quux' do not follow the ObjectId + specification but they are acceptable input:: + + + `oid` can also be a :class:`str` of 24 hex digits:: + + + Raises :class:`~bson.errors.InvalidId` if `oid` is not 12 bytes nor + 24 hex digits, or :class:`TypeError` if `oid` is not an accepted type. + + :Parameters: + - `oid` (optional): a valid ObjectId. + + .. seealso:: The MongoDB documentation on `ObjectIds`_. + + .. versionchanged:: 3.8 + :class:`~bson.objectid.ObjectId` now implements the `ObjectID + specification version 0.2 + `_. + + :param oid: (Default value = None) + + >>> ObjectId(b'foo-bar-quux') + ObjectId('666f6f2d6261722d71757578') + + >>> ObjectId('0123456789ab0123456789ab') + ObjectId('0123456789ab0123456789ab') + """ + if oid is None: + self.__generate() + elif isinstance(oid, bytes) and len(oid) == 12: + self.__id = oid + else: + self.__validate(oid) + + @classmethod + def from_datetime(cls, generation_time): + """Create a dummy ObjectId instance with a specific generation time. + + This method is useful for doing range queries on a field + containing :class:`ObjectId` instances. + + .. warning:: + It is not safe to insert a document containing an ObjectId + generated using this method. This method deliberately + eliminates the uniqueness guarantee that ObjectIds + generally provide. ObjectIds generated with this method + should be used exclusively in queries. + + `generation_time` will be converted to UTC. Naive datetime + instances will be treated as though they already contain UTC. + + An example using this helper to get documents where ``"_id"`` + was generated before January 1, 2010 would be: + + + :Parameters: + - `generation_time`: :class:`~datetime.datetime` to be used + as the generation time for the resulting ObjectId. + + :param generation_time: + + >>> gen_time = datetime.datetime(2010, 1, 1) + >>> dummy_id = ObjectId.from_datetime(gen_time) + >>> result = collection.find({"_id": {"$lt": dummy_id}}) + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.commission-schemes.commission-schemes:[167:189] +==backtrader.samples.writer-test.writer-test:[194:216] + parser.add_argument( + "--data", + "-d", + default="../../datas/2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[88:110] +==backtrader.samples.plot-same-axis.plot-same-axis:[110:132] + parser.add_argument( + "--data", + "-d", + default="../../datas/2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[38:80] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[53:97] + ) + + def log(self, txt, dt=None): + """ + + :param txt: + :param dt: (Default value = None) + + """ + if self.p.printout: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # To control operation entries + self.orderid = None + + # Create SMA on 2nd data (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[107:141] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[94:134] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + +def load_data(symbol1, symbol2, fromdate, todate): + """ + + :param symbol1: + :param symbol2: + :param fromdate: + :param todate: + + """ + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[339:362] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[360:383] + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[361:386] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[406:431] + spread_window, + ) + results.append(result) + + # 打印当前结果 + print( + f" 夏普比率: {result['sharpe']:.4f}, 最大回撤:" + f" {result['drawdown']:.2f}%, 年化收益: {result['returns']:.2f}%, 胜率:" + f" {result['win_rate']:.2f}%" + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") + print(f"价差计算窗口: {best_result['params']['spread_window']}") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[259:282] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[285:308] + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[368:393] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[330:355] + spread_window, + ) + results.append(result) + + # 打印当前结果 + print( + f" 夏普比率: {result['sharpe']:.4f}, 最大回撤:" + f" {result['drawdown']:.2f}%, 年化收益: {result['returns']:.2f}%, 胜率:" + f" {result['win_rate']:.2f}%" + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") + print(f"价差计算窗口: {best_result['params']['spread_window']}") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[302:325] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[293:316] + param_combinations = [] + for spread_window in spread_windows: + # 计算当前窗口下的滚动价差 + print(f"计算滚动价差 (window={spread_window})...") + df_spread = calculate_rolling_spread(df0, df1, window=spread_window) + + # 添加数据 + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[38:77] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[59:99] + ) + + return parser.parse_args() + + +def calculate_rolling_spread( + df0: pd.DataFrame, # 必含 'date' 与价格列 + df1: pd.DataFrame, + window: int = 30, + fields=("open", "high", "low", "close"), +) -> pd.DataFrame: + """ + 计算滚动 β,并为指定价格字段生成价差 (spread): + spread_x = price0_x - β_{t-1} * price1_x + """ + # 1) 用收盘价对齐合并(β 仍用 close 估计) + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[80:103] +==backtrader.tests.test_bbroker_try_exec_limit:[65:88] + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if isinstance(order, bt.BuyOrder): + if self.p.printops: + txt = "BUY, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + chkprice = "%.2f" % order.executed.price + self.buyexec.append(chkprice) + else: # elif isinstance(order, SellOrder): + if self.p.printops: + txt = "SELL, %.2f" % order.executed.price + self.log(txt, order.executed.dt) + + chkprice = "%.2f" % order.executed.price + self.sellexec.append(chkprice) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + if self.p.printops: + self.log("%s ," % order.Status[order.status]) + + # Allow new orders (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[143:182] +==backtrader.samples.timers.scheduled:[132:171] + sessionstart=datetime.time(9, 0), + sessionend=datetime.time(17, 30), + ) + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[145:187] +==backtrader.samples.stoptrail.trail:[120:162] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[235:256] +==backtrader.samples.order_target.order_target:[192:213] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[300:323] +==backtrader.samples.oandatest.oandatest:[264:287] + cerebro.setbroker(broker) + + timeframe = bt.TimeFrame.TFrame(args.timeframe) + # Manage data1 parameters + tf1 = args.timeframe1 + tf1 = bt.TimeFrame.TFrame(tf1) if tf1 is not None else timeframe + cp1 = args.compression1 + cp1 = cp1 if cp1 is not None else args.compression + + if args.resample or args.replay: + datatf = datatf1 = bt.TimeFrame.Ticks + datacomp = datacomp1 = 1 + else: + datatf = timeframe + datacomp = args.compression + datatf1 = tf1 + datacomp1 = cp1 + + fromdate = None + if args.fromdate: + dtformat = "%Y-%m-%d" + ("T%H:%M:%S" * ("T" in args.fromdate)) + fromdate = datetime.datetime.strptime(args.fromdate, dtformat) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.commission-schemes.commission-schemes:[66:91] +==backtrader.samples.observers.observers-orderobserver:[71:92] + if order.isbuy(): + self.log( + "BUY EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f" + % ( + order.executed.price, + order.executed.value, + order.executed.comm, + ) + ) + else: # Sell + self.log( + "SELL EXECUTED, Price: %.2f, Cost: %.2f, Comm %.2f" + % ( + order.executed.price, + order.executed.value, + order.executed.comm, + ) + ) + + def notify_trade(self, trade): + """ + + :param trade: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[110:152] +==backtrader.samples.lrsi.lrsi-test:[55:97] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[88:109] +==backtrader.samples.multitrades.multitrades:[196:217] + parser.add_argument( + "--data", + "-d", + default="../../datas/2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.rsi_strategy:[86:124] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[176:216] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + # def notify_trade(self, trade): + # if self.p.printlog and trade.isclosed: + # print(f'平仓盈利: {trade.pnlcomm:.2f}') + + # def stop(self): + # # 策略结束时绘制偏度图形 + # if len(self.skew_j_values) > 0: + # self.plot_skewness() + + def plot_skewness(self): + """ """ + # 创建日期索引 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[94:132] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[176:210] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + +def load_data(symbol1, symbol2, fromdate, todate): + """ + + :param symbol1: + :param symbol2: + :param fromdate: + :param todate: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[107:140] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[179:213] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status in [order.Completed]: + if self.p.printlog: + if order.isbuy(): + print( + f"买入执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + else: + print( + f"卖出执行: 价格={order.executed.price:.2f}," + f" 成本={order.executed.value:.2f}," + f" 手续费={order.executed.comm:.2f}" + ) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + print("订单被取消/拒绝") + + self.order = None + + +def load_data(symbol1, symbol2, fromdate, todate): + """ + Load two symbols from HDF5 and return as Backtrader PandasData feeds. + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[43:71] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[41:67] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建自定义数据类以支持beta列 +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[100:128] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[41:67] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) Organize output + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# Create custom data class to support beta column + + +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread as close + ("beta", "beta"), # beta column + ("nocase", True), # Column names are case insensitive + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.blaze:[47:71] +==backtrader.backtrader.feeds.pandafeed:[50:72] + params = ( + # datetime must be present + ("datetime", 0), + # pass -1 for any of the following to indicate absence + ("open", 1), + ("high", 2), + ("low", 3), + ("close", 4), + ("volume", 5), + ("openinterest", 6), + ) + + datafields = [ + "datetime", + "open", + "high", + "low", + "close", + "volume", + "openinterest", + ] + + def start(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[110:272] +==backtrader.xtquant.xtbson.bson37.json_util:[126:277] +_RE_OPT_TABLE = { + "i": re.I, + "l": re.L, + "m": re.M, + "s": re.S, + "u": re.U, + "x": re.X, +} + + +class DatetimeRepresentation: + """ """ + + LEGACY = 0 + """Legacy MongoDB Extended JSON datetime representation. + + :class:`datetime.datetime` instances will be encoded to JSON in the + format `{"$date": }`, where `dateAsMilliseconds` is + a 64-bit signed integer giving the number of milliseconds since the Unix + epoch UTC. This was the default encoding before PyMongo version 3.4. + + .. versionadded:: 3.4 + """ + + NUMBERLONG = 1 + """NumberLong datetime representation. + + :class:`datetime.datetime` instances will be encoded to JSON in the + format `{"$date": {"$numberLong": ""}}`, + where `dateAsMilliseconds` is the string representation of a 64-bit signed + integer giving the number of milliseconds since the Unix epoch UTC. + + .. versionadded:: 3.4 + """ + + ISO8601 = 2 + """ISO-8601 datetime representation. + + :class:`datetime.datetime` instances greater than or equal to the Unix + epoch UTC will be encoded to JSON in the format `{"$date": ""}`. + :class:`datetime.datetime` instances before the Unix epoch UTC will be + encoded as if the datetime representation is + :const:`~DatetimeRepresentation.NUMBERLONG`. + + .. versionadded:: 3.4 + """ + + +class JSONMode: + """ """ + + LEGACY = 0 + """Legacy Extended JSON representation. + + In this mode, :func:`~bson.json_util.dumps` produces PyMongo's legacy + non-standard JSON output. Consider using + :const:`~bson.json_util.JSONMode.RELAXED` or + :const:`~bson.json_util.JSONMode.CANONICAL` instead. + + .. versionadded:: 3.5 + """ + + RELAXED = 1 + """Relaxed Extended JSON representation. + + In this mode, :func:`~bson.json_util.dumps` produces Relaxed Extended JSON, + a mostly JSON-like format. Consider using this for things like a web API, + where one is sending a document (or a projection of a document) that only + uses ordinary JSON type primitives. In particular, the ``int``, + :class:`~bson.int64.Int64`, and ``float`` numeric types are represented in + the native JSON number format. This output is also the most human readable + and is useful for debugging and documentation. + + .. seealso:: The specification for Relaxed `Extended JSON`_. + + .. versionadded:: 3.5 + """ + + CANONICAL = 2 + """Canonical Extended JSON representation. + + In this mode, :func:`~bson.json_util.dumps` produces Canonical Extended + JSON, a type preserving format. Consider using this for things like + testing, where one has to precisely specify expected types in JSON. In + particular, the ``int``, :class:`~bson.int64.Int64`, and ``float`` numeric + types are encoded with type wrappers. + + .. seealso:: The specification for Canonical `Extended JSON`_. + + .. versionadded:: 3.5 + """ + + +class JSONOptions(CodecOptions): + """Encapsulates JSON options for :func:`dumps` and :func:`loads`. + + :Parameters: + - `strict_number_long`: If ``True``, :class:`~bson.int64.Int64` objects + are encoded to MongoDB Extended JSON's *Strict mode* type + `NumberLong`, ie ``'{"$numberLong": "" }'``. Otherwise they + will be encoded as an `int`. Defaults to ``False``. + - `datetime_representation`: The representation to use when encoding + instances of :class:`datetime.datetime`. Defaults to + :const:`~DatetimeRepresentation.LEGACY`. + - `strict_uuid`: If ``True``, :class:`uuid.UUID` object are encoded to + MongoDB Extended JSON's *Strict mode* type `Binary`. Otherwise it + will be encoded as ``'{"$uuid": "" }'``. Defaults to ``False``. + - `json_mode`: The :class:`JSONMode` to use when encoding BSON types to + Extended JSON. Defaults to :const:`~JSONMode.LEGACY`. + - `document_class`: BSON documents returned by :func:`loads` will be + decoded to an instance of this class. Must be a subclass of + :class:`collections.MutableMapping`. Defaults to :class:`dict`. + - `uuid_representation`: The :class:`~bson.binary.UuidRepresentation` + to use when encoding and decoding instances of :class:`uuid.UUID`. + Defaults to :const:`~bson.binary.UuidRepresentation.UNSPECIFIED`. + - `tz_aware`: If ``True``, MongoDB Extended JSON's *Strict mode* type + `Date` will be decoded to timezone aware instances of + :class:`datetime.datetime`. Otherwise they will be naive. Defaults + to ``False``. + - `tzinfo`: A :class:`datetime.tzinfo` subclass that specifies the + timezone from which :class:`~datetime.datetime` objects should be + decoded. Defaults to :const:`~bson.tz_util.utc`. + - `args`: arguments to :class:`~bson.codec_options.CodecOptions` + - `kwargs`: arguments to :class:`~bson.codec_options.CodecOptions` + + .. seealso:: The specification for Relaxed and Canonical `Extended JSON`_. + + .. versionchanged:: 4.0 + The default for `json_mode` was changed from :const:`JSONMode.LEGACY` + to :const:`JSONMode.RELAXED`. + The default for `uuid_representation` was changed from + :const:`~bson.binary.UuidRepresentation.PYTHON_LEGACY` to + :const:`~bson.binary.UuidRepresentation.UNSPECIFIED`. + + .. versionchanged:: 3.5 + Accepts the optional parameter `json_mode`. + + .. versionchanged:: 4.0 + Changed default value of `tz_aware` to False. + + + """ + + def __new__( + cls, + strict_number_long=None, + datetime_representation=None, + strict_uuid=None, + json_mode=JSONMode.RELAXED, + *args, + **kwargs, + ): + """ + + :param strict_number_long: (Default value = None) + :param datetime_representation: (Default value = None) + :param strict_uuid: (Default value = None) + :param json_mode: (Default value = JSONMode.RELAXED) + :param *args: + :param **kwargs: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[192:221] +==backtrader.xtquant.xtbson.bson37.codec_options:[237:268] + err_msg = ( + "TypeEncoders cannot change how built-in types are " + "encoded (encoder %s transforms type %s)" % (codec, pytype) + ) + raise TypeError(err_msg) + + def __repr__(self): + """ """ + return "%s(type_codecs=%r, fallback_encoder=%r)" % ( + self.__class__.__name__, + self.__type_codecs, + self._fallback_encoder, + ) + + def __eq__(self, other): + """ + + :param other: + + """ + if not isinstance(other, type(self)): + return NotImplemented + return ( + (self._decoder_map == other._decoder_map) + and (self._encoder_map == other._encoder_map) + and (self._fallback_encoder == other._fallback_encoder) + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_bbroker_try_exec_limit:[100:122] +==backtrader.tests.test_strategy_unoptimized:[166:189] + if self.p.printdata: + self.log("-------------------------", nodate=True) + self.log( + "Starting portfolio value: %.2f" % self.broker.getvalue(), + nodate=True, + ) + + self.tstart = time_clock() + + self.buycreate = list() + self.sellcreate = list() + self.buyexec = list() + self.sellexec = list() + + def stop(self): + """ """ + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[351:371] +==backtrader.samples.talib.tablibsartest:[89:109] + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[149:169] +==backtrader.samples.vctest.vctest:[140:161] + txt.append("%s" % self.data1.datetime.datetime(0).strftime(dtfmt)) + txt.append("{}".format(self.data1.open[0])) + txt.append("{}".format(self.data1.high[0])) + txt.append("{}".format(self.data1.low[0])) + txt.append("{}".format(self.data1.close[0])) + txt.append("{}".format(self.data1.volume[0])) + txt.append("{}".format(self.data1.openinterest[0])) + txt.append("{}".format(float("NaN"))) + print(", ".join(txt)) + + if self.counttostop: # stop after x live lines + self.counttostop -= 1 + if not self.counttostop: + self.env.runstop() + return + + if not self.p.trade: + return + + # if True and len(self.orderid) < 1: + if self.datastatus and not self.position and len(self.orderid) < 1: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[175:195] +==backtrader.samples.macd-settings.macd-settings:[272:292] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[137:159] +==backtrader.samples.yahoo-test.yahoo-test:[99:121] + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( + "--writer", "-w", action="store_true", help="Add a writer to cerebro" + ) + + parser.add_argument( + "--wrcsv", + "-wc", + action="store_true", + help="Enable CSV Output in the writer", + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[276:303] +==backtrader.samples.multitrades.multitrades:[234:261] + ) + + parser.add_argument("--cash", default=100000, type=int, help="Starting Cash") + + parser.add_argument( + "--comm", default=2, type=float, help="Commission for operation" + ) + + parser.add_argument("--mult", default=10, type=int, help="Multiplier for futures") + + parser.add_argument( + "--margin", default=2000.0, type=float, help="Margin for each future" + ) + + parser.add_argument( + "--stake", default=1, type=int, help="Stake to apply in each operation" + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[157:181] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[63:87] + ) + + def __init__(self): + self.addminperiod(self.p.period) + self.spread_data = [] + + def next(self): + self.spread_data.append(self.data[0]) + if len(self.spread_data) > self.p.period: + self.spread_data.pop(0) # 保持固定长度 + + if len(self.spread_data) >= self.p.period: + spread_array = np.array(self.spread_data) + self.lines.upper[0] = np.quantile(spread_array, self.p.upper_quantile) + self.lines.lower[0] = np.quantile(spread_array, self.p.lower_quantile) + self.lines.mid[0] = np.median(spread_array) + else: + self.lines.upper[0] = self.data[0] + self.lines.lower[0] = self.data[0] + self.lines.mid[0] = self.data[0] + + +class DynamicSpreadQuantileStrategy(bt.Strategy): + params = ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[198:221] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[300:323] + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # 运行回测 + results = cerebro.run() + + # 获取分析结果 + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) + roi = strat.analyzers.roianalyzer.get_analysis().get("roi100", 0) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[371:394] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[369:392] + ) + results.append(result) + + # 打印当前结果 + print( + f" 夏普比率: {result['sharpe']:.4f}, 最大回撤:" + f" {result['drawdown']:.2f}%, 年化收益: {result['returns']:.2f}%, 胜率:" + f" {result['win_rate']:.2f}%" + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[54:77] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[18:42] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) Estimate β_t, and shift one day forward + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + # Prevent future + keep 1 decimal place + beta_shift = beta_raw.shift(1).round(1) + + # 3) Append β to main table (for later vectorized calculation) + df = df.assign(beta=beta_shift) + + # 4) Calculate spread for each field + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[19:42] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[75:99] + df = ( + df0.set_index("date")[["close"]] + .rename(columns={"close": "close0"}) + .join( + df1.set_index("date")[["close"]].rename(columns={"close": "close1"}), + how="inner", + ) + ) + + # 2) 估计 β_t ,再向前挪一天 + beta_raw = ( + df["close0"].rolling(window).cov(df["close1"]) + / df["close1"].rolling(window).var() + ) + beta_shift = beta_raw.shift(1).round(1) # 防未来 + 保留 1 位小数 + + # 3) 把 β 拼回主表(便于后面 vectorized 计算) + df = df.assign(beta=beta_shift) + + # 4) 对每个字段算 spread + out_cols = {"date": df.index, "beta": beta_shift} + for f in fields: + if f not in ("open", "high", "low", "close"): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.btrun.btrun:[313:334] +==backtrader.tools.rewrite-data:[109:130] + dfkwargs = dict() + if args.format == "yahoo_unreversed": + dfkwargs["reverse"] = True + + fmtstr = "%Y-%m-%d" + if args.fromdate: + dtsplit = args.fromdate.split("T") + if len(dtsplit) > 1: + fmtstr += "T%H:%M:%S" + + fromdate = datetime.datetime.strptime(args.fromdate, fmtstr) + dfkwargs["fromdate"] = fromdate + + fmtstr = "%Y-%m-%d" + if args.todate: + dtsplit = args.todate.split("T") + if len(dtsplit) > 1: + fmtstr += "T%H:%M:%S" + todate = datetime.datetime.strptime(args.todate, fmtstr) + dfkwargs["todate"] = todate + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.son:[45:90] +==backtrader.xtquant.xtbson.bson37.son:[63:91] + self.__keys = [] + dict.__init__(self) + self.update(data) + self.update(kwargs) + + def __new__( + cls: Type["SON[_Key, _Value]"], *args: Any, **kwargs: Any + ) -> "SON[_Key, _Value]": + instance = super(SON, cls).__new__(cls, *args, **kwargs) + instance.__keys = [] + return instance + + def __repr__(self): + result = [] + for key in self.__keys: + result.append("(%r, %r)" % (key, self[key])) + return "SON([%s])" % ", ".join(result) + + def __setitem__(self, key: _Key, value: _Value) -> None: + if key not in self.__keys: + self.__keys.append(key) + dict.__setitem__(self, key, value) + + def __delitem__(self, key: _Key) -> None: + self.__keys.remove(key) + dict.__delitem__(self, key) + + def copy(self) -> "SON[_Key, _Value]": (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_envelope:[41:71] +==backtrader.tests.test_ind_oscillator:[37:67] +class TS2(testcommon.TestStrategy): + """ """ + + def __init__(self): + """ """ + ind = btind.MovAv.SMA(self.data) + self.p.inddata = [ind] + super(TS2, self).__init__() + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + TS2, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[189:208] +==backtrader.samples.volumefilling.volumefilling:[198:217] + ) + + parser.add_argument( + "--fromdate", + "-f", + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + required=False, + default=None, + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[125:145] +==backtrader.samples.order-execution.order-execution:[218:238] + dataformat = dict( + bt=btfeeds.BacktraderCSVData, + visualchart=btfeeds.VChartCSVData, + sierrachart=btfeeds.SierraChartCSVData, + yahoo=btfeeds.YahooFinanceCSVData, + yahoo_unreversed=btfeeds.YahooFinanceCSVData, + ) + + dfkwargs = dict() + if args.csvformat == "yahoo_unreversed": + dfkwargs["reverse"] = True + + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dfkwargs["fromdate"] = fromdate + + if args.todate: + fromdate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dfkwargs["todate"] = todate + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[533:552] +==backtrader.samples.vctest.vctest:[388:407] + ) + + parser.add_argument( + "--data1", + default=None, + required=False, + action="store", + help="data 1 into the system", + ) + + parser.add_argument( + "--timezone", + default=None, + required=False, + action="store", + help="timezone to get time output into (pytz names)", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[232:251] +==backtrader.samples.data-replay.data-replay:[118:137] + ) + + parser.add_argument( + "--timeframe", + default="weekly", + required=False, + choices=["daily", "weekly", "monthly"], + help="Timeframe to resample to", + ) + + parser.add_argument( + "--compression", + default=1, + required=False, + type=int, + help="Compress n bars into 1", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[109:129] +==backtrader.samples.order-history.order-history:[205:225] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[249:268] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[203:222] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[293:313] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[455:475] + ) + + # 设置初始资金和滑点 + cerebro.broker.setcash(args.setcash) + cerebro.broker.set_shortcash(False) + cerebro.broker.set_slippage_perc(args.setslippage) + + # 添加分析器 + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 风险无风险利率 + annualize=True, # 年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[967:983] +==backtrader.xtquant.xtbson.bson37.json_util:[1109:1125] + tz_string = "Z" + else: + tz_string = obj.strftime("%z") + millis = int(obj.microsecond / 1000) + fracsecs = ".%03d" % (millis,) if millis else "" + return { + "$date": ( + "%s%s%s" + % ( + obj.strftime("%Y-%m-%dT%H:%M:%S"), + fracsecs, + tz_string, + ) + ) + } + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1476:1522] +==backtrader.xtquant.xtbson.bson37.__init__:[2074:2125] + if not codec_options.type_registry._decoder_map: + return decode_all(data, codec_options) + + if not fields: + return decode_all(data, codec_options.with_options(type_registry=None)) + + # Decode documents for internal use. + from .raw_bson import RawBSONDocument + + internal_codec_options = codec_options.with_options( + document_class=RawBSONDocument, type_registry=None + ) + _doc = _bson_to_dict(data, internal_codec_options) + return [ + _decode_selective( + _doc, + fields, + codec_options, + ) + ] + + +def decode_iter( + data: bytes, codec_options: "Optional[CodecOptions[_DocumentType]]" = None +) -> Iterator[_DocumentType]: + """Decode BSON data to multiple documents as a generator. + + Works similarly to the decode_all function, but yields one document at a + time. + + `data` must be a string of concatenated, valid, BSON-encoded + documents. + + :Parameters: + - `data`: BSON data + - `codec_options` (optional): An instance of + :class:`~bson.codec_options.CodecOptions`. + + .. versionchanged:: 3.0 + Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with + `codec_options`. + + .. versionadded:: 2.8 + + :param data: + :type data: bytes + :param codec_options: (Default value = None) + :type codec_options: "Optional[CodecOptions[_DocumentType]]" + :rtype: Iterator[_DocumentType] + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1216:1243] +==backtrader.xtquant.xtbson.bson37.__init__:[1760:1779] + try: + elements = [] + if top_level and "_id" in doc: + elements.append( + _name_value_to_bson(b"_id\x00", doc["_id"], check_keys, opts) + ) + for key, value in doc.items(): + if not top_level or key != "_id": + elements.append(_element_to_bson(key, value, check_keys, opts)) + except AttributeError: + raise TypeError("encoder expected a mapping type but got: %r" % (doc,)) + + encoded = b"".join(elements) + return _PACK_INT(len(encoded) + 5) + encoded + b"\x00" + + +if _USE_C: + _dict_to_bson = _cbson._dict_to_bson + + +def _millis_to_datetime(millis, opts): + """Convert milliseconds since epoch UTC to datetime. + + :param millis: + :param opts: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[146:164] +==backtrader.tests.test_strategy_unoptimized:[213:231] + if self.p.printdata: + self.log( + "Open, High, Low, Close, %.2f, %.2f, %.2f, %.2f, Sma, %f" + % ( + self.data.open[0], + self.data.high[0], + self.data.low[0], + self.data.close[0], + self.sma[0], + ) + ) + self.log("Close %.2f - Sma %.2f" % (self.data.close[0], self.sma[0])) + + if self.orderid: + # if an order is active, no new orders are allowed + return + + if not self.position.size: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_bbroker_try_exec_limit:[28:65] +==backtrader.tests.test_math_function_scalar:[29:62] +try: + time_clock = time.process_time +except BaseException: + time_clock = time.clock + +import backtrader as bt + + +class SlipTestStrategy(bt.SignalStrategy): + """ """ + + params = ( + ("printdata", False), + ("printops", False), + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def notify_order(self, order): + """ + + :param order: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[353:371] +==backtrader.samples.pyfoliotest.pyfoliotest:[185:203] + help="Data to be read in", + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[63:97] +==backtrader.samples.timers.scheduled:[137:171] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[107:129] +==backtrader.samples.data-pandas.data-pandas:[77:99] + cerebro.plot(style="bar") + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser(description="Pandas test script") + + parser.add_argument( + "--noheaders", + action="store_true", + default=False, + required=False, + help="Do not use header rows", + ) + + parser.add_argument( + "--noprint", + action="store_true", + default=False, + help="Print the dataframe", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[232:250] +==backtrader.samples.data-resample.data-resample:[93:111] + ) + + parser.add_argument( + "--timeframe", + default="weekly", + required=False, + choices=["daily", "weekly", "monthly"], + help="Timeframe to resample to", + ) + + parser.add_argument( + "--compression", + default=1, + required=False, + type=int, + help="Compress n bars into 1", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[118:152] +==backtrader.samples.timers.scheduled-min:[148:182] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[229:247] +==backtrader.samples.yahoo-test.yahoo-test:[91:109] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[300:316] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[424:441] + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[309:325] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[265:282] + data0 = bt.feeds.PandasData( + dataname=df0, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( + dataname=df1, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data2 = SpreadData(dataname=df_spread, fromdate=fromdate, todate=todate) + + # 创建回测引擎 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.regex:[108:156] +==backtrader.xtquant.xtbson.bson37.regex:[119:173] + if isinstance(flags, str): + self.flags = str_flags_to_int(flags) + elif isinstance(flags, int): + self.flags = flags + else: + raise TypeError("flags must be a string or int, not %s" % type(flags)) + + def __eq__(self, other): + """ + + :param other: + + """ + if isinstance(other, Regex): + return self.pattern == other.pattern and self.flags == other.flags + else: + return NotImplemented + + __hash__ = None + + def __ne__(self, other): + """ + + :param other: + + """ + return not self == other + + def __repr__(self): + """ """ + return "Regex(%r, %r)" % (self.pattern, self.flags) + + def try_compile(self): + """Compile this :class:`Regex` as a Python regular expression. + + .. warning:: + Python regular expressions use a different syntax and different + set of flags than MongoDB, which uses `PCRE`_. A regular + expression retrieved from the server may not compile in + Python, or may match a different set of strings in Python than + when used in a MongoDB query. :meth:`try_compile()` may raise + :exc:`re.error`. + + .. _PCRE: http://www.pcre.org/ + + + """ + return re.compile(self.pattern, self.flags) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.regex:[27:44] +==backtrader.xtquant.xtbson.bson37.regex:[30:47] + flags = 0 + if "i" in str_flags: + flags |= re.IGNORECASE + if "l" in str_flags: + flags |= re.LOCALE + if "m" in str_flags: + flags |= re.MULTILINE + if "s" in str_flags: + flags |= re.DOTALL + if "u" in str_flags: + flags |= re.UNICODE + if "x" in str_flags: + flags |= re.VERBOSE + + return flags + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[409:452] +==backtrader.xtquant.xtbson.bson37.codec_options:[527:574] + } + + def __repr__(self): + """ """ + return "%s(%s)" % (self.__class__.__name__, self._arguments_repr()) + + def with_options(self, **kwargs): + """Make a copy of this CodecOptions, overriding some options:: + + + .. versionadded:: 3.5 + + :param **kwargs: + + >>> from .codec_options import DEFAULT_CODEC_OPTIONS + >>> DEFAULT_CODEC_OPTIONS.tz_aware + False + >>> options = DEFAULT_CODEC_OPTIONS.with_options(tz_aware=True) + >>> options.tz_aware + True + """ + opts = self._options_dict() + opts.update(kwargs) + return CodecOptions(**opts) + + +DEFAULT_CODEC_OPTIONS = CodecOptions() + + +def _parse_codec_options(options): + """Parse BSON codec options. + + :param options: + + """ + kwargs = {} + for k in set(options) & { + "document_class", + "tz_aware", + "uuidrepresentation", + "unicode_decode_error_handler", + "tzinfo", + "type_registry", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36._helpers:[24:51] +==backtrader.xtquant.xtbson.bson37._helpers:[28:63] + for slot, value in state.items(): + setattr(self, slot, value) + + +def _mangle_name(name, prefix): + """ + + :param name: + :param prefix: + + """ + if name.startswith("__"): + prefix = "_" + prefix + else: + prefix = "" + return prefix + name + + +def _getstate_slots(self): + """ """ + prefix = self.__class__.__name__ + ret = dict() + for name in self.__slots__: + mangled_name = _mangle_name(name, prefix) + if hasattr(self, mangled_name): + ret[mangled_name] = getattr(self, mangled_name) + return ret (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_highest:[37:61] +==backtrader.tests.test_ind_lowest:[37:61] +chkargs = dict(period=14) + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[35:59] +==backtrader.tests.test_ind_minperiod:[35:59] +chkargs = dict() + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[165:193] +==backtrader.tests.test_analyzer-timereturn:[154:181] + if self.cross > 0.0: + if self.p.printops: + self.log("BUY CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.buy() + chkprice = "%.2f" % self.data.close[0] + self.buycreate.append(chkprice) + + elif self.cross < 0.0: + if self.p.printops: + self.log("SELL CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.close() + chkprice = "%.2f" % self.data.close[0] + self.sellcreate.append(chkprice) + + +chkdatas = 1 + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ + datas = [testcommon.getdata(i) for i in range(chkdatas)] + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_resample_live:[63:85] +==backtrader.tests.test_resampler:[66:88] + data = bt.feeds.FakeFeed( + timeframe=data_timeframe, + compression=data_compression, + run_duration=datetime.timedelta(seconds=runtime_seconds), + starting_value=starting_value, + tick_interval=tick_interval, + live=live, + num_gen_bars=num_gen_bars, + ) + + cerebro.resampledata( + data, timeframe=resample_timeframe, compression=resample_compression + ) + + # return the recorded bars attribute from the first strategy + return cerebro.run()[0] + + +@freeze_time("Jan 1th, 2000", tick=True) +def test_ticks_to_m1_no_startedge(): + """Backtest ticks resampled to M1 bars using tickedgestart=False.""" + strat = _run_resampler( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order_target.order_target:[192:209] +==backtrader.samples.pyfoliotest.pyfoliotest:[186:203] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-history.order-history:[207:225] +==backtrader.samples.stop-trading.stop-loss-approaches:[265:283] + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( + "--todate", + required=False, + default="", + help="Date[time] in YYYY-MM-DD[THH:MM:SS] format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.optimization.optimization:[126:143] +==backtrader.samples.relative-volume.relative-volume:[101:118] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[235:252] +==backtrader.samples.observer-benchmark.observer-benchmark:[184:201] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, + default="2006-12-31", + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[100:117] +==backtrader.samples.vwr.vwr:[133:150] + ) + + parser.add_argument( + "--fromdate", + "-f", + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[590:607] +==backtrader.samples.vctest.vctest:[404:421] + ) + + parser.add_argument( + "--historical", + required=False, + action="store_true", + help="do only historical download", + ) + + parser.add_argument( + "--fromdate", + required=False, + action="store", + help="Starting date for historical download with format: YYYY-MM-DD[THH:MM:SS]", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[258:280] +==backtrader.samples.oandatest.oandatest:[231:253] + header = [ + "Datetime", + "Open", + "High", + "Low", + "Close", + "Volume", + "OpenInterest", + "SMA", + ] + print(", ".join(header)) + + self.done = False + + +def runstrategy(): + """ """ + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[42:60] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[209:224] + self.callcounter = 0 + txtfields = list() + txtfields.append("Calls") + txtfields.append("Len Strat") + txtfields.append("Len Data") + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + self.lcontrol = 0 # control if 1st or 2nd call (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.commission-schemes.commission-schemes:[172:189] +==backtrader.samples.data-filler.data-filler:[152:169] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[144:165] +==backtrader.samples.data-filler.data-filler:[166:187] + ) + + parser.add_argument( + "--writer", "-w", action="store_true", help="Add a writer to cerebro" + ) + + parser.add_argument( + "--wrcsv", + "-wc", + action="store_true", + help="Enable CSV Output in the writer", + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[93:110] +==backtrader.samples.yahoo-test.yahoo-test:[85:102] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[223:240] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[128:145] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[144:160] +==backtrader.contrib.utils.iqfeed-to-influxdb:[272:288] + ) + parser.add_argument( + "--debug", + required=False, + action="store_true", + help="Turn on debug logging level.", + ) + parser.add_argument( + "--info", + required=False, + action="store_true", + help="Turn on info logging level.", + ) + + args = parser.parse_args() + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[248:271] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[465:482] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 风险无风险利率 + annualize=True, # 年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子 + ) + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + cerebro.addobserver(bt.observers.Trades) + cerebro.addobserver(bt.observers.CumValue) + + # 运行回测 + results = cerebro.run() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.btrun.btrun:[279:310] +==backtrader.samples.slippage.slippage:[102:118] + if args.slip_perc is not None: + cerebro.broker.set_slippage_perc( + args.slip_perc, + slip_open=args.slip_open, + slip_match=not args.no_slip_match, + slip_out=args.slip_out, + ) + elif args.slip_fixed is not None: + cerebro.broker.set_slippage_fixed( + args.slip_fixed, + slip_open=args.slip_open, + slip_match=not args.no_slip_match, + slip_out=args.slip_out, + ) + + +def getdatas(args): + """ + Create and return a list of Backtrader data feed objects based on the parsed + arguments. + + Args: + args: Parsed command-line arguments. + + Returns: + list: List of Backtrader data feed objects. + + Side Effects: + Instantiates data feed objects, may parse dates from arguments. + """ + # Get the data feed class from the global dictionary (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.vcbroker:[574:589] +==backtrader.tests.test_order:[120:135] + size, + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, + margin, + pnl, + psize, + pprice, + ) # pnl + + if partial: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.sharpe:[50:69] +==backtrader.backtrader.analyzers.sortino:[50:68] + ("factor", None), + ("convertrate", True), + ("annualize", False), + ("stddev_sample", False), + ("daysfactor", None), + ("legacyannual", False), + ("fund", None), + ) + + RATEFACTORS = { + TimeFrame.Days: 252, + TimeFrame.Weeks: 52, + TimeFrame.Months: 12, + TimeFrame.Years: 1, + } + + def __init__(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.json_util:[272:285] +==backtrader.xtquant.xtbson.bson37.json_util:[308:321] + kwargs["tz_aware"] = kwargs.get("tz_aware", False) + if kwargs["tz_aware"]: + kwargs["tzinfo"] = kwargs.get("tzinfo", utc) + if datetime_representation not in ( + DatetimeRepresentation.LEGACY, + DatetimeRepresentation.NUMBERLONG, + DatetimeRepresentation.ISO8601, + None, + ): + raise ValueError( + "JSONOptions.datetime_representation must be one of LEGACY, " + "NUMBERLONG, or ISO8601 from DatetimeRepresentation." + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1415:1439] +==backtrader.xtquant.xtbson.bson37.__init__:[1969:1996] + if _raw_document_class(codec_options.document_class): + # If document_class is RawBSONDocument, use vanilla dictionary for + # decoding command response. + doc = {} + else: + # Else, use the specified document_class. + doc = codec_options.document_class() + for key, value in rawdoc.items(): + if key in fields: + if fields[key] == 1: + doc[key] = _bson_to_dict(rawdoc.raw, codec_options)[key] + else: + doc[key] = _decode_selective(value, fields[key], codec_options) + else: + doc[key] = value + return doc + + +def _convert_raw_document_lists_to_streams(document): + """ + + :param document: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[350:366] +==backtrader.xtquant.xtbson.bson37.codec_options:[455:471] + if tzinfo is not None: + if not isinstance(tzinfo, datetime.tzinfo): + raise TypeError("tzinfo must be an instance of datetime.tzinfo") + if not tz_aware: + raise ValueError( + "cannot specify tzinfo without also setting tz_aware=True" + ) + + type_registry = type_registry or TypeRegistry() + + if not isinstance(type_registry, TypeRegistry): + raise TypeError("type_registry must be an instance of TypeRegistry") + + return tuple.__new__( + cls, + ( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_lowest:[46:61] +==backtrader.tests.test_ind_minperiod:[44:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[44:59] +==backtrader.tests.test_ind_highest:[46:61] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[165:191] +==backtrader.tests.test_strategy_unoptimized:[231:257] + if self.cross > 0.0: + if self.p.printops: + self.log("BUY CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.buy() + chkprice = "%.2f" % self.data.close[0] + self.buycreate.append(chkprice) + + elif self.cross < 0.0: + if self.p.printops: + self.log("SELL CREATE , %.2f" % self.data.close[0]) + + self.orderid = self.close() + chkprice = "%.2f" % self.data.close[0] + self.sellcreate.append(chkprice) + + +chkdatas = 1 + + +def test_run(main=False): + """ + + :param main: (Default value = False) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stop-trading.stop-loss-approaches:[201:234] +==backtrader.samples.stoptrail.trail:[111:145] + ) + + +def runstrat(args=None): + """ + + :param args: (Default value = None) + + """ + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[73:94] +==backtrader.samples.writer-test.writer-test:[111:135] + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # To control operation entries (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.mixing-timeframes.mixing-timeframes:[80:99] +==backtrader.samples.pivot-point.ppsample:[71:90] + if args.plot: + cerebro.plot(style="bar") + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for pivot point and cross plotting", + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/2005-2006-day-001.txt", + help="Data to be read in", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[60:75] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[246:261] + self.callcounter += 1 + + txtfields = list() + txtfields.append("%04d" % self.callcounter) + txtfields.append("%04d" % len(self)) + txtfields.append("%04d" % len(self.data0)) + txtfields.append(self.data.datetime.datetime(0).isoformat()) + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[81:98] +==backtrader.samples.data-pandas.data-pandas:[47:65] + skiprows = 1 if args.noheaders else 0 + header = None if args.noheaders else 0 + + dataframe = pandas.read_csv( + datapath, + skiprows=skiprows, + header=header, + parse_dates=True, + index_col=0, + ) + + if not args.noprint: + print("--------------------------------------------------") + print(dataframe) + print("--------------------------------------------------") + + # Pass it to the backtrader datafeed and add it to the cerebro (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas:[84:99] +==backtrader.samples.data-pandas.data_ploars_optix:[120:135] + parser.add_argument( + "--noheaders", + action="store_true", + default=False, + required=False, + help="Do not use header rows", + ) + + parser.add_argument( + "--noprint", + action="store_true", + default=False, + help="Print the dataframe", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multitrades.multitrades:[201:217] +==backtrader.samples.yahoo-test.yahoo-test:[85:101] + ) + + parser.add_argument( + "--fromdate", + "-f", + default="2006-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[117:133] +==backtrader.samples.vwr.vwr:[122:138] + ) + + parser.add_argument( + "--data", + "-d", + default="../../datas/2005-2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--cash", default=None, type=float, required=False, help="Starting Cash" + ) + + parser.add_argument( + "--fromdate", + "-f", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[143:171] +==backtrader.samples.multitrades.multitrades:[137:165] + if trade.isclosed: + self.log("TRADE PROFIT, GROSS %.2f, NET %.2f" % (trade.pnl, trade.pnlcomm)) + + elif trade.justopened: + self.log("TRADE OPENED, SIZE %2d" % trade.size) + + +def runstrategy(): + """ """ + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( + dataname=args.data, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro + cerebro.adddata(data) + + # Add the strategy + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[84:97] +==backtrader.contrib.utils.iqfeed-to-influxdb:[192:205] + exoptgroup.add_argument( + "--ticker", + action="store", + default="SPY", + help="Ticker to request data for.", + ) + exoptgroup.add_argument( + "--ticker-list", + action="store", + default=None, + help="Path to folder to create files.", + ) + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[234:258] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[164:188] + cerebro.broker.setcash(args.cash) + + # Add the commission - only stocks like a for each operation + cerebro.broker.setcommission(commission=args.commperc) + + # And run it + cerebro.run( + runonce=not args.runnext, + preload=not args.nopreload, + oldsync=args.oldsync, + ) + + # Plot if requested + if args.plot: + cerebro.plot(numfigs=args.numfigs, volume=False, zdown=False) + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser(description="MultiData Strategy") + + parser.add_argument( + "--data0", + "-d0", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[292:308] +==backtrader.samples.data-multitimeframe.data-multitimeframe:[206:222] + parser.add_argument( + "--runnext", + action="store_true", + help="Use next by next instead of runonce", + ) + + parser.add_argument( + "--nopreload", action="store_true", help="Do not preload the data" + ) + + parser.add_argument( + "--oldsync", + action="store_true", + help="Use old data synchronization method", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[58:79] +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[119:143] + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders + self.orderid = None + + def __init__(self): + """ """ + # To control operation entries (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[299:332] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[293:326] + plt.show() + print("偏度图表已保存为 'skewness_plot.png'") + + +# 关键修复:处理索引问题 +def load_data(symbol1, symbol2, fromdate, todate): + """ + + :param symbol1: + :param symbol2: + :param fromdate: + :param todate: + + """ + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + # 加载数据时不保留原有索引结构 + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + # 查找日期列(兼容不同命名) + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + # 设置日期索引 + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + # 创建数据feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[104:122] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[100:118] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + def next(self): + # 确保有足够的历史数据 + if ( + len(self.rsi) < self.p.rsi_period + 2 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[301:314] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[375:388] + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 + ) + cerebro.addanalyzer( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[26:40] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[38:51] + parser.add_argument( + "--plot", + type=lambda x: x.lower() == "true", + default=True, + help="是否绘制结果(True/False)", + ) + parser.add_argument("--setslippage", type=float, default=0.0, help="设置滑点率") + parser.add_argument( + "--export_csv", + type=lambda x: x.lower() == "true", + default=False, + help="是否导出回测数据到CSV(True/False)", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[85:106] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[87:108] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + # ---------- 主循环 ---------- + def next(self): + # 1) 确保有足够历史用于计算均值和标准差 + if len(self.spread_series) < self.p.win + 2: + return + + # 2) 计算当前价差的Z-Score (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[401:416] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[245:265] + cerebro.addanalyzer(bt.analyzers.DrawDown) # Drawdown analyzer + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Use daily data + riskfreerate=0, # Default risk-free rate + annualize=True, # Do not annualize + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # Annualization factor, 252 trading days + ) + # The period here can be daily, weekly, monthly, etc. + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + cerebro.addobserver(bt.observers.Trades) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.btcsv:[245:262] +==backtrader.backtrader.feeds.ibdata:[451:468] + self._state = self._ST_START # initial state for _load + self._statelivereconn = False # if reconnecting in live state + self._subcription_valid = False # subscription state + self._storedmsg = dict() # keep pending live message (under None) + + if not self.ib.isConnected(): + return + + self.put_notification(self.CONNECTED) + # get real contract details with real conId (contractId) + cds = self.ib.reqContractDetails(self.precontract) + assert len(cds) == 1 + + if cds is not None: + cdetails = cds[0] + self.contract = cdetails.contract + self.contractdetails = cdetails (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.ibdata:[768:790] +==backtrader.backtrader.feeds.oanda:[324:346] + return False # end of historical + + # Live is also wished - go for it + self._state = self._ST_LIVE + continue + + elif self._state == self._ST_FROM: + if not self.p.backfill_from.next(): + # additional data source is consumed + self._state = self._ST_START + continue + + # copy lines of the same name + for alias in self.lines.getlinealiases(): + lsrc = getattr(self.p.backfill_from.lines, alias) + ldst = getattr(self.lines, alias) + + ldst[0] = lsrc[0] + + return True + + elif self._state == self._ST_START: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[711:724] +==backtrader.backtrader.brokers.oandabroker:[477:490] + order = BuyOrder( + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, + parent=parent, + transmit=transmit, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[127:149] +==backtrader.backtrader.brokers.ibbroker:[153:173] + self.orders = list() # will only be appending + self.pending = collections.deque() # popleft and append(right) + self._toactivate = collections.deque() # to activate in next cycle + + self.positions = collections.defaultdict(Position) + self.d_credit = collections.defaultdict(float) # credit per data + self.notifs = collections.deque() + + self.submitted = collections.deque() + + # to keep dependent orders if needed + self._pchildren = collections.defaultdict(collections.deque) + + self._ocos = dict() + self._ocol = collections.defaultdict(list) + + self._fundval = self.p.fundstartval + self._fundshares = self.p.cash / self._fundval + self._cash_addition = collections.deque() + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[90:104] +==backtrader.backtrader.brokers.ibbroker:[101:115] + ("filler", None), + # slippage options 滑点 + ("slip_perc", 0.0), + ("slip_fixed", 0.0), + ("slip_open", False), + ("slip_match", True), + ("slip_limit", True), + ("slip_out", False), + ("coc", False), + ("coo", False), + ("int2pnl", True), + ("shortcash", True), + ("fundstartval", 100.0), + ("fundmode", False), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.sharpe:[103:125] +==backtrader.backtrader.analyzers.sortino:[87:109] + if self.p.factor is not None: + factor = self.p.factor # user specified factor + elif self.p.timeframe in self.RATEFACTORS: + # Get the conversion factor from the default table + factor = self.RATEFACTORS[self.p.timeframe] + + if factor is not None: + # A factor was found + + if self.p.convertrate: + # Standard: downgrade annual returns to timeframe factor + rate = pow(1.0 + rate, 1.0 / factor) - 1.0 + else: + # Else upgrade returns to yearly returns + returns = [pow(1.0 + x, factor) - 1.0 for x in returns] + + lrets = len(returns) - self.p.stddev_sample + # Check if the ratio can be calculated + if lrets: + # Get the excess returns - arithmetic mean - original sharpe + ret_free = [r - rate for r in returns] + ret_free_avg = average(ret_free) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.oandabroker:[389:403] +==backtrader.backtrader.order:[885:899] + size, + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, + margin, + pnl, + psize, + pprice, + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.cerebro:[247:263] +==backtrader.backtrader.utils.timer:[110:133] + offset=offset, + repeat=repeat, + weekdays=weekdays, + weekcarry=weekcarry, + monthdays=monthdays, + monthcarry=monthcarry, + allow=allow, + tzdata=tzdata, + strats=strats, + cheat=cheat, + *args, + **kwargs, + ) + + def addtz(self, tz): + """Define o timezone global usando utilitário.""" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[211:234] +==backtrader.strategies:[236:256] + if order.status in [order.Submitted, order.Accepted]: + # Buy/Sell order submitted/accepted to/by broker - Nothing to do + return + + # Check if an order has been completed + # Attention: broker could reject order if not enough cash + if order.status in [order.Completed]: + if order.isbuy(): + self.log("BUY EXECUTED, %.2f" % order.executed.price) + elif order.issell(): + self.log("SELL EXECUTED, %.2f" % order.executed.price) + + self.bar_executed = len(self) + + elif order.status in [order.Canceled, order.Margin, order.Rejected]: + self.log("Order Canceled/Margin/Rejected") + + # Write down: no pending order + self.order = None + + def next(self): + """ """ + data = self.datas[0] (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.min_key:[16:89] +==backtrader.xtquant.xtbson.bson37.min_key:[18:115] +class MinKey(object): + """MongoDB internal MinKey type.""" + + __slots__ = () + + _type_marker = 255 + + def __getstate__(self) -> Any: + """ + + + :rtype: Any + + """ + return {} + + def __setstate__(self, state: Any) -> None: + """ + + :param state: + :type state: Any + :rtype: None + + """ + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return isinstance(other, MinKey) + + def __hash__(self) -> int: + """ + + + :rtype: int + + """ + return hash(self._type_marker) + + def __ne__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not self == other + + def __le__(self, dummy: Any) -> bool: + """ + + :param dummy: + :type dummy: Any + :rtype: bool + + """ + return True + + def __lt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not isinstance(other, MinKey) + + def __ge__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return isinstance(other, MinKey) + + def __gt__(self, dummy: Any) -> bool: + """ + + :param dummy: + :type dummy: Any + :rtype: bool + + """ + return False + + def __repr__(self): + """ """ + return "MinKey()" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.max_key:[16:89] +==backtrader.xtquant.xtbson.bson37.max_key:[18:115] +class MaxKey(object): + """MongoDB internal MaxKey type.""" + + __slots__ = () + + _type_marker = 127 + + def __getstate__(self) -> Any: + """ + + + :rtype: Any + + """ + return {} + + def __setstate__(self, state: Any) -> None: + """ + + :param state: + :type state: Any + :rtype: None + + """ + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return isinstance(other, MaxKey) + + def __hash__(self) -> int: + """ + + + :rtype: int + + """ + return hash(self._type_marker) + + def __ne__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not self == other + + def __le__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return isinstance(other, MaxKey) + + def __lt__(self, dummy: Any) -> bool: + """ + + :param dummy: + :type dummy: Any + :rtype: bool + + """ + return False + + def __ge__(self, dummy: Any) -> bool: + """ + + :param dummy: + :type dummy: Any + :rtype: bool + + """ + return True + + def __gt__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + return not isinstance(other, MaxKey) + + def __repr__(self): + """ """ + return "MaxKey()" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.dbref:[21:63] +==backtrader.xtquant.xtbson.bson37.dbref:[22:77] +class DBRef(object): + """A reference to a document stored in MongoDB.""" + + __slots__ = "__collection", "__id", "__database", "__kwargs" + __getstate__ = _getstate_slots + __setstate__ = _setstate_slots + # DBRef isn't actually a BSON "type" so this number was arbitrarily chosen. + _type_marker = 100 + + def __init__(self, collection, id, database=None, _extra={}, **kwargs): + """Initialize a new :class:`DBRef`. + + Raises :class:`TypeError` if `collection` or `database` is not + an instance of :class:`basestring` (:class:`str` in python 3). + `database` is optional and allows references to documents to work + across databases. Any additional keyword arguments will create + additional fields in the resultant embedded document. + + :Parameters: + - `collection`: name of the collection the document is stored in + - `id`: the value of the document's ``"_id"`` field + - `database` (optional): name of the database to reference + - `**kwargs` (optional): additional keyword arguments will + create additional, custom fields + + .. seealso:: The MongoDB documentation on `dbrefs `_. + + :param collection: + :param id: + :param database: (Default value = None) + :param _extra: (Default value = {}) + :param **kwargs: + + """ + if not isinstance(collection, str): + raise TypeError("collection must be an instance of str") + if database is not None and not isinstance(database, str): + raise TypeError("database must be an instance of str") + + self.__collection = collection + self.__id = id + self.__database = database (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.metatable.get_arrow:[372:388] +==backtrader.xtquant.metatable.get_bson:[358:374] + time_format = None + if period in ("1m", "5m", "15m", "30m", "60m", "1h"): + time_format = "%Y-%m-%d %H:%M:%S" + elif period in ("1d", "1w", "1mon", "1q", "1hy", "1y"): + time_format = "%Y-%m-%d" + elif period == "": + time_format = "%Y-%m-%d %H:%M:%S.%f" + + if not time_format: + raise Exception("Unsupported period") + + int_period = __TABULAR_PERIODS__[period] + + if not isinstance(count, int) or count == 0: + count = -1 + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.metatable.get_arrow:[269:285] +==backtrader.xtquant.metatable.get_bson:[221:237] + time_format = None + if period in ("1m", "5m", "15m", "30m", "60m", "1h"): + time_format = "%Y-%m-%d %H:%M:%S" + elif period in ("1d", "1w", "1mon", "1q", "1hy", "1y"): + time_format = "%Y-%m-%d" + elif period == "": + time_format = "%Y-%m-%d %H:%M:%S.%f" + + if not time_format: + raise Exception("Unsupported period") + + int_period = __TABULAR_PERIODS__[period] + + if not isinstance(count, int) or count == 0: + count = -1 + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_zlema:[43:57] +==backtrader.tests.test_ind_zlind:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_wmaenvelope:[47:61] +==backtrader.tests.test_ind_wmaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_williamsr:[45:59] +==backtrader.tests.test_ind_wma:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_vortex:[46:60] +==backtrader.tests.test_ind_williamsad:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_ultosc:[43:57] +==backtrader.tests.test_ind_upmove:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_trix:[43:57] +==backtrader.tests.test_ind_tsi:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_temaenvelope:[47:61] +==backtrader.tests.test_ind_temaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_stochasticfull:[47:61] +==backtrader.tests.test_ind_tema:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_smmaosc:[43:57] +==backtrader.tests.test_ind_stochastic:[46:60] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_smma:[45:59] +==backtrader.tests.test_ind_smmaenvelope:[47:61] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_smaenvelope:[47:61] +==backtrader.tests.test_ind_smaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_rsi_safe:[45:59] +==backtrader.tests.test_ind_sma:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_roc:[45:59] +==backtrader.tests.test_ind_rsi:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_priceosc:[43:57] +==backtrader.tests.test_ind_rmi:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_ppo:[47:61] +==backtrader.tests.test_ind_pposhort:[47:61] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_pctrank:[45:59] +==backtrader.tests.test_ind_pgo:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_momentumoscillator:[45:59] +==backtrader.tests.test_ind_pctchange:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_macdhisto:[47:61] +==backtrader.tests.test_ind_momentum:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_kst:[46:60] +==backtrader.tests.test_ind_lrsi:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_kamaenvelope:[47:61] +==backtrader.tests.test_ind_kamaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_ichimoku:[49:63] +==backtrader.tests.test_ind_kama:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_heikinashi:[49:63] +==backtrader.tests.test_ind_hma:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_emaenvelope:[47:61] +==backtrader.tests.test_ind_emaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_dv2:[45:59] +==backtrader.tests.test_ind_ema:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_downmove:[45:59] +==backtrader.tests.test_ind_dpo:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_dm:[48:62] +==backtrader.tests.test_ind_dma:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_demaenvelope:[47:61] +==backtrader.tests.test_ind_demaosc:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_cci:[45:59] +==backtrader.tests.test_ind_dema:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_awesomeoscillator:[43:57] +==backtrader.tests.test_ind_bbands:[47:61] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_aroonupdown:[46:60] +==backtrader.tests.test_ind_atr:[45:59] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_accdecosc:[43:57] +==backtrader.tests.test_ind_aroonoscillator:[43:57] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[33:47] +==backtrader.samples.tradingcalendar.tcal:[33:47] +class NYSE_2016(bt.TradingCalendar): + """ """ + + params = dict( + holidays=[ + datetime.date(2016, 1, 1), + datetime.date(2016, 1, 18), + datetime.date(2016, 2, 15), + datetime.date(2016, 3, 25), + datetime.date(2016, 5, 30), + datetime.date(2016, 7, 4), + datetime.date(2016, 9, 5), + datetime.date(2016, 11, 24), + datetime.date(2016, 12, 26), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[80:98] +==backtrader.samples.slippage.slippage:[76:94] + args = parse_args(args) + + cerebro = bt.Cerebro() + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given + data = bt.feeds.BacktraderCSVData(dataname=args.data, **dkwargs) + cerebro.adddata(data) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[164:192] +==backtrader.samples.psar.psar-intraday:[92:120] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[105:122] +==backtrader.samples.pyfoliotest.pyfoliotest:[97:114] + args = parse_args(args) + + cerebro = bt.Cerebro() + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + data0 = bt.feeds.YahooFinanceCSVData(dataname=args.data0, **dkwargs) + cerebro.adddata(data0, name="Data0") + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[55:80] +==backtrader.samples.stop-trading.stop-loss-approaches:[210:234] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[724:738] +==backtrader.samples.vctest.vctest:[545:559] + ) + + parser.add_argument( + "--stake", + default=10, + type=int, + required=False, + action="store", + help="Stake to use in buy operations", + ) + + parser.add_argument( + "--valid", + default=None, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[385:398] +==backtrader.samples.vctest.vctest:[294:308] + else: + valid = datetime.timedelta(seconds=args.valid) + + # Add the strategy + cerebro.addstrategy( + TestStrategy, + smaperiod=args.smaperiod, + trade=args.trade, + exectype=bt.Order.ExecType(args.exectype), + stake=args.stake, + stopafter=args.stopafter, + valid=valid, + cancel=args.cancel, + donotsell=args.donotsell, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[110:135] +==backtrader.samples.order-history.order-history:[150:174] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[678:692] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[202:216] + ), + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[58:74] +==backtrader.samples.multitrades.multitrades:[113:129] + if order.status in [bt.Order.Submitted, bt.Order.Accepted]: + return # Await further notifications + + if order.status == order.Completed: + if order.isbuy(): + buytxt = "BUY COMPLETE, %.2f" % order.executed.price + self.log(buytxt, order.executed.dt) + else: + selltxt = "SELL COMPLETE, %.2f" % order.executed.price + self.log(selltxt, order.executed.dt) + + elif order.status in [order.Expired, order.Canceled, order.Margin]: + self.log("%s ," % order.Status[order.status]) + pass # Simply log + + # Allow new orders (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[463:475] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[375:387] + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 风险无风险利率 + annualize=True, # 年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[377:393] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[430:446] + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") + print(f"价差计算窗口: {best_result['params']['spread_window']}") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[193:209] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[266:282] + verbose=False, + ) + + # 设置初始资金 + cerebro.broker.setcash(initial_cash) + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[402:416] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[465:478] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Use daily data + riskfreerate=0, # Default risk-free rate + annualize=True, # Do not annualize + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # Annualization factor, 252 trading days + ) + # The period here can be daily, weekly, monthly, etc. + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + cerebro.addobserver(bt.observers.Trades) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[221:234] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[212:225] + current_value = self.broker.getvalue() + daily_return = ( + (current_value / self.prev_portfolio_value) - 1.0 + if self.prev_portfolio_value > 0 + else 0 + ) + self.prev_portfolio_value = current_value + + self.record_dates.append(self.datetime.date()) + self.record_data.append( + { + "date": self.datetime.date(), + "close": self.data2.close[0], (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[773:785] +==backtrader.backtrader.brokers.oandabroker:[478:490] + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, + parent=parent, + transmit=transmit, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[712:724] +==backtrader.backtrader.brokers.oandabroker:[533:545] + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, + parent=parent, + transmit=transmit, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.__init__:[30:44] +==backtrader.backtrader.feeds.__init__:[27:54] +try: + pass +except ImportError: + pass # The user may not have ibpy installed + +try: + pass +except ImportError: + pass # The user may not have something installed + +try: + pass +except ImportError: + pass # The user may not have something installed + +from .btcsv import BacktraderCSVData +from .vchartcsv import VChartCSVData +from .vchartfile import VChartFile +from .sierrachart import SierraChartCSVData +from .mt4csv import MT4CSVData +from .yahoo import YahooFinanceCSVData, YahooFinanceData +from .vcdata import VCData +from .ibdata import IBData +from .oanda import OandaData +from .pandafeed import PandasData +from .csvgeneric import GenericCSVData + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1581:1671] +==backtrader.xtquant.xtbson.bson37.__init__:[2194:2308] + if not isinstance(bson, bytes): + raise TypeError("BSON data must be an instance of a subclass of bytes") + + try: + _bson_to_dict(bson, DEFAULT_CODEC_OPTIONS) + return True + except Exception: + return False + + +class BSON(bytes): + """BSON (Binary JSON) data. + + .. warning:: Using this class to encode and decode BSON adds a performance + cost. For better performance use the module level functions + :func:`encode` and :func:`decode` instead. + + + """ + + @classmethod + def encode( + cls: Type["BSON"], + document: _DocumentIn, + check_keys: bool = False, + codec_options: CodecOptions = DEFAULT_CODEC_OPTIONS, + ) -> "BSON": + """Encode a document to a new :class:`BSON` instance. + + A document can be any mapping type (like :class:`dict`). + + Raises :class:`TypeError` if `document` is not a mapping type, + or contains keys that are not instances of + :class:`basestring` (:class:`str` in python 3). Raises + :class:`~bson.errors.InvalidDocument` if `document` cannot be + converted to :class:`BSON`. + + :Parameters: + - `document`: mapping type representing a document + - `check_keys` (optional): check if keys start with '$' or + contain '.', raising :class:`~bson.errors.InvalidDocument` in + either case + - `codec_options` (optional): An instance of + :class:`~bson.codec_options.CodecOptions`. + + .. versionchanged:: 3.0 + Replaced `uuid_subtype` option with `codec_options`. + + :param document: + :type document: _DocumentIn + :param check_keys: (Default value = False) + :type check_keys: bool + :param codec_options: (Default value = DEFAULT_CODEC_OPTIONS) + :type codec_options: CodecOptions + :rtype: "BSON" + + """ + return cls(encode(document, check_keys, codec_options)) + + # type: ignore[override,assignment] + def decode( + self, + codec_options: "CodecOptions[_DocumentType]" = DEFAULT_CODEC_OPTIONS, + ) -> _DocumentType: + """Decode this BSON data. + + By default, returns a BSON document represented as a Python + :class:`dict`. To use a different :class:`MutableMapping` class, + configure a :class:`~bson.codec_options.CodecOptions`:: + + + :Parameters: + - `codec_options` (optional): An instance of + :class:`~bson.codec_options.CodecOptions`. + + .. versionchanged:: 3.0 + Removed `compile_re` option: PyMongo now always represents BSON + regular expressions as :class:`~bson.regex.Regex` objects. Use + :meth:`~bson.regex.Regex.try_compile` to attempt to convert from a + BSON regular expression to a Python regular expression object. + + Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with + `codec_options`. + + :param codec_options: (Default value = DEFAULT_CODEC_OPTIONS) + :type codec_options: "CodecOptions[_DocumentType]" + :rtype: _DocumentType + + >>> import collections # From Python standard library. + >>> import bson + >>> from .codec_options import CodecOptions + >>> data = bson.BSON.encode({'a': 1}) + >>> decoded_doc = bson.BSON(data).decode() + + >>> options = CodecOptions(document_class=collections.OrderedDict) + >>> decoded_doc = bson.BSON(data).decode(codec_options=options) + >>> type(decoded_doc) + + """ + return decode(self, codec_options) + + +def has_c() -> bool: + """Is the C extension installed? + + + :rtype: bool + + """ + return _USE_C + + +def _after_fork(): + """Releases the ObjectID lock child.""" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[862:928] +==backtrader.xtquant.xtbson.bson37.__init__:[1288:1385] + subtype = value.subtype + if subtype == 2: + value = _PACK_INT(len(value)) + value + return b"\x05" + name + _PACK_LENGTH_SUBTYPE(len(value), subtype) + value + + +def _encode_uuid(name, value, dummy, opts): + """Encode uuid.UUID. + + :param name: + :param value: + :param dummy: + :param opts: + + """ + uuid_representation = opts.uuid_representation + binval = Binary.from_uuid(value, uuid_representation=uuid_representation) + return _encode_binary(name, binval, dummy, opts) + + +def _encode_objectid(name, value, dummy0, dummy1): + """Encode bson.objectid.ObjectId. + + :param name: + :param value: + :param dummy0: + :param dummy1: + + """ + return b"\x07" + name + value.binary + + +def _encode_bool(name, value, dummy0, dummy1): + """Encode a python boolean (True/False). + + :param name: + :param value: + :param dummy0: + :param dummy1: + + """ + return b"\x08" + name + (value and b"\x01" or b"\x00") + + +def _encode_datetime(name, value, dummy0, dummy1): + """Encode datetime.datetime. + + :param name: + :param value: + :param dummy0: + :param dummy1: + + """ + millis = _datetime_to_millis(value) + return b"\x09" + name + _PACK_LONG(millis) + + +def _encode_none(name, dummy0, dummy1, dummy2): + """Encode python None. + + :param name: + :param dummy0: + :param dummy1: + :param dummy2: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.regex:[47:106] +==backtrader.xtquant.xtbson.bson37.regex:[53:117] + __slots__ = ("pattern", "flags") + + __getstate__ = _getstate_slots + __setstate__ = _setstate_slots + + _type_marker = 11 + + @classmethod + def from_native(cls: Type["Regex"], regex: "Pattern[_T]") -> "Regex[_T]": + """Convert a Python regular expression into a ``Regex`` instance. + + Note that in Python 3, a regular expression compiled from a + :class:`str` has the ``re.UNICODE`` flag set. If it is undesirable + to store this flag in a BSON regular expression, unset it first:: + + + :Parameters: + - `regex`: A regular expression object from ``re.compile()``. + + .. warning:: + Python regular expressions use a different syntax and different + set of flags than MongoDB, which uses `PCRE`_. A regular + expression retrieved from the server may not compile in + Python, or may match a different set of strings in Python than + when used in a MongoDB query. + + .. _PCRE: http://www.pcre.org/ + + :param regex: + :type regex: "Pattern[_T]" + :rtype: "Regex[_T]" + + >>> pattern = re.compile('.*') + >>> regex = Regex.from_native(pattern) + >>> regex.flags ^= re.UNICODE + >>> db.collection.insert_one({'pattern': regex}) + """ + if not isinstance(regex, RE_TYPE): + raise TypeError( + "regex must be a compiled regular expression, not %s" % type(regex) + ) + + return Regex(regex.pattern, regex.flags) + + def __init__(self, pattern: _T, flags: Union[str, int] = 0) -> None: + """BSON regular expression data. + + This class is useful to store and retrieve regular expressions that are + incompatible with Python's regular expression dialect. + + :Parameters: + - `pattern`: string + - `flags`: (optional) an integer bitmask, or a string of flag + characters like "im" for IGNORECASE and MULTILINE + + :param pattern: + :type pattern: _T + :param flags: (Default value = 0) + :type flags: Union[str, int] + :rtype: None + + """ + if not isinstance(pattern, (str, bytes)): + raise TypeError("pattern must be a string, not %s" % type(pattern)) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[372:388] +==backtrader.xtquant.xtbson.bson37.codec_options:[478:499] + ), + ) + + def _arguments_repr(self) -> str: + """Representation of the arguments used to create this object. + + + :rtype: str + + """ + document_class_repr = ( + "dict" if self.document_class is dict else repr(self.document_class) + ) + + uuid_rep_repr = UUID_REPRESENTATION_NAMES.get( + self.uuid_representation, self.uuid_representation + ) + + return ( + "document_class=%s, tz_aware=%r, uuid_representation=%s, " + "unicode_decode_error_handler=%r, tzinfo=%r, " (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[118:131] +==backtrader.tests.test_bbroker_try_exec_limit:[100:116] + if self.p.printdata: + self.log("-------------------------", nodate=True) + self.log( + "Starting portfolio value: %.2f" % self.broker.getvalue(), + nodate=True, + ) + + self.tstart = time_clock() + + self.buycreate = list() + self.sellcreate = list() + self.buyexec = list() + self.sellexec = list() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[136:163] +==backtrader.samples.tradingcalendar.tcal:[134:161] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Trading Calendar Sample", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.talib.tablibsartest:[48:64] +==backtrader.samples.talib.talibtest:[165:181] + args = parse_args(args) + + cerebro = bt.Cerebro() + + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + data0 = bt.feeds.YahooFinanceCSVData(dataname=args.data0, **dkwargs) + cerebro.adddata(data0) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[148:161] +==backtrader.samples.sizertest.sizertest:[165:178] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[549:565] +==backtrader.samples.vctest.vctest:[455:471] + choices=bt.TimeFrame.Names, + required=False, + action="store", + help="TimeFrame for Resample/Replay", + ) + + parser.add_argument( + "--compression", + default=1, + type=int, + required=False, + action="store", + help="Compression for Resample/Replay", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[348:360] +==backtrader.samples.vctest.vctest:[294:307] + else: + valid = datetime.timedelta(seconds=args.valid) + + # Add the strategy + cerebro.addstrategy( + TestStrategy, + smaperiod=args.smaperiod, + trade=args.trade, + exectype=bt.Order.ExecType(args.exectype), + stake=args.stake, + stopafter=args.stopafter, + valid=valid, + cancel=args.cancel, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[379:391] +==backtrader.samples.talib.talibtest:[247:260] + ) + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[279:292] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[367:380] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[121:133] +==backtrader.samples.talib.tablibsartest:[113:126] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[497:510] +==backtrader.samples.vctest.vctest:[362:375] + ) + + parser.add_argument( + "--no-timeoffset", + required=False, + action="store_true", + help=( + "Do not Use TWS/System time offset for non " + "timestamped prices and to align resampling" + ), + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[634:671] +==backtrader.samples.oandatest.oandatest:[549:586] + choices=bt.TimeFrame.Names, + required=False, + action="store", + help="TimeFrame for Resample/Replay", + ) + + parser.add_argument( + "--compression", + default=1, + type=int, + required=False, + action="store", + help="Compression for Resample/Replay", + ) + + parser.add_argument( + "--timeframe1", + default=None, + choices=bt.TimeFrame.Names, + required=False, + action="store", + help="TimeFrame for Resample/Replay - Data1", + ) + + parser.add_argument( + "--compression1", + default=None, + type=int, + required=False, + action="store", + help="Compression for Resample/Replay - Data1", + ) + + parser.add_argument( + "--no-takelate", + required=False, + action="store_true", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[105:118] +==backtrader.samples.mixing-timeframes.mixing-timeframes:[86:99] + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for pivot point and cross plotting", + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/2005-2006-day-001.txt", + help="Data to be read in", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[289:302] +==backtrader.samples.oandatest.oandatest:[679:692] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[182:195] +==backtrader.samples.multi-copy.multi-copy:[248:261] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[196:221] +==backtrader.samples.psar.psar-intraday:[95:120] + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[173:193] +==backtrader.samples.cheat-on-open.cheat-on-open:[110:132] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-filler.data-filler:[166:181] +==backtrader.samples.yahoo-test.yahoo-test:[106:121] + ) + + parser.add_argument( + "--writer", "-w", action="store_true", help="Add a writer to cerebro" + ) + + parser.add_argument( + "--wrcsv", + "-wc", + action="store_true", + help="Enable CSV Output in the writer", + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[67:89] +==backtrader.samples.yahoo-test.yahoo-test:[62:84] + cerebro.addindicator(btind.SMA, period=args.period) + + # Add a writer with CSV + if args.writer: + cerebro.addwriter(bt.WriterFile, csv=args.wrcsv) + + # Run over everything + cerebro.run() + + # Plot if requested + if args.plot: + cerebro.plot(style="bar", numfigs=args.numfigs, volume=False) + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Calendar Days Filter Sample", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[141:154] +==backtrader.samples.vwr.vwr:[146:159] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--writercsv", + "-wcsv", + action="store_true", + help="Tell the writer to produce a csv stream", + ) + + parser.add_argument( + "--tframe", + "--timeframe", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[416:429] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[203:216] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const=True, + help=( + "Plot the read data applying any kwargs passed\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[197:220] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[127:150] + print("==================================================") + print("Starting Value - %.2f" % self.broker.startingcash) + print("Ending Value - %.2f" % self.broker.getvalue()) + print("==================================================") + + +def runstrategy(): + """ """ + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data0 = btfeeds.YahooFinanceCSVData( + dataname=args.data0, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[132:147] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[307:326] + output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" + + try: + # 加载数据时不保留原有索引结构 + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + # 查找日期列(兼容不同命名) + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + # 设置日期索引 + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + + # 创建数据feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[58:80] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[122:141] +print(df_spread.head()) + +fromdate = datetime.datetime(2018, 1, 1) +todate = datetime.datetime(2025, 1, 1) + +# Create custom data class to support beta column + + +class SpreadData(bt.feeds.PandasData): + """ """ + + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread column as close + ("beta", "beta"), # Beta column + ("nocase", True), # Column names are case-insensitive + ) + + +# Filter dataframes by date before passing to Backtrader (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[100:116] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[87:104] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + # ---------- 主循环 ---------- + def next(self): + # 1) 确保有足够历史用于计算均值和标准差 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[331:346] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[323:338] + spread_window, + ) + ) + + # 执行网格搜索 + results = [] + total_combinations = len(param_combinations) + + print(f"开始网格搜索,共{total_combinations}种参数组合...") + + for i, ( + data0, + data1, + data2, + rsi_period, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[104:120] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[84:100] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + def next(self): + # 确保有足够的历史数据 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[379:394] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[430:445] + ) + except Exception as e: + print(f" 参数组合出错: {e}") + + # 找出最佳参数组合 + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + + print("\n========= 最佳参数组合 =========") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[336:351] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[295:310] + spread_window, + ) + ) + + # 执行网格搜索 + results = [] + total_combinations = len(param_combinations) + + print(f"开始网格搜索,共{total_combinations}种参数组合...") + + for i, ( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[85:102] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[124:141] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + + # ---------- 主循环 ---------- + def next(self): + # 1) 确保有足够历史用于 σ 估计 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[189:207] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[115:131] + f" {self.target_holding_days}" + ) + + # Reset holding counter + self.holding_counter = 0 + self.in_position = True + self.total_trades += 1 + self.trade_start_date = self.datetime.date() + + def _close_positions(self): + self.close(data=self.data0) + self.close(data=self.data1) + self.in_position = False + + # Update statistics + self.total_holding_days += self.holding_counter + self.holding_days_list.append(self.holding_counter) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.btcsv:[90:101] +==backtrader.backtrader.feeds.ibdata:[108:119] + params = ( + ("secType", "STK"), # usual industry value + ("exchange", "SMART"), # usual industry value + ("primaryExchange", None), # native exchange of the contract + ("right", None), # Option or Warrant Call('C') or Put('P') + ("strike", None), # Future, Option or Warrant strike price + ("multiplier", None), # Future, Option or Warrant multiplier + ( + "expiry", + None, + ), # Future, Option or Warrant lastTradeDateOrContractMonth date (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.tz_util:[20:72] +==backtrader.xtquant.xtbson.bson37.tz_util:[21:87] +class FixedOffset(tzinfo): + """Fixed offset timezone, in minutes east from UTC. + + Implementation based from the Python `standard library documentation + `_. + Defining __getinitargs__ enables pickling / copying. + + + """ + + def __init__(self, offset: Union[float, timedelta], name: str) -> None: + """ + + :param offset: + :type offset: Union[float, timedelta] + :param name: + :type name: str + :rtype: None + + """ + if isinstance(offset, timedelta): + self.__offset = offset + else: + self.__offset = timedelta(minutes=offset) + self.__name = name + + def __getinitargs__(self) -> Tuple[timedelta, str]: + """ + + + :rtype: Tuple[timedelta,str] + + """ + return self.__offset, self.__name + + def utcoffset(self, dt: Optional[datetime]) -> timedelta: + """ + + :param dt: + :type dt: Optional[datetime] + :rtype: timedelta + + """ + return self.__offset + + def tzname(self, dt: Optional[datetime]) -> str: + """ + + :param dt: + :type dt: Optional[datetime] + :rtype: str + + """ + return self.__name + + def dst(self, dt: Optional[datetime]) -> timedelta: + """ + + :param dt: + :type dt: Optional[datetime] + :rtype: timedelta + + """ + return ZERO + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.qmttools.contextinfo:[703:713] +==backtrader.xtquant.qmttools.functions:[547:557] + opType, + orderType, + accountid, + orderCode, + prType, + modelprice, + volume, + strategyName, + quickTrade, + userOrderId, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[45:71] +==backtrader.tests.test_analyzer-timereturn:[45:71] + ("printdata", True), + ("printops", True), + ("stocklike", True), + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def notify_trade(self, trade): + """ + + :param trade: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[135:148] +==backtrader.tests.test_bbroker_try_exec_limit:[116:129] + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") + else: + pass + + def next(self): + """ """ + if self.p.printdata: + self.log( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[83:98] +==backtrader.samples.vwr.vwr:[52:67] + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + # Get the dates from the args + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # Create the 1st data + data = bt.feeds.BacktraderCSVData(dataname=args.data, **dkwargs) + cerebro.adddata(data) # Add the data to cerebro + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfoliotest.pyfoliotest:[48:61] +==backtrader.samples.volumefilling.volumefilling:[62:73] + txtfields = list() + txtfields.append("Len") + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfolio2.pyfoliotest:[175:186] +==backtrader.samples.pyfoliotest.pyfoliotest:[129:142] + returns, positions, transactions, gross_lev = pyfoliozer.get_pf_items() + if args.printout: + print("-- RETURNS") + print(returns) + print("-- POSITIONS") + print(positions) + print("-- TRANSACTIONS") + print(transactions) + print("-- GROSS LEVERAGE") + print(gross_lev) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order_target.order_target:[162:184] +==backtrader.samples.signals-strategy.signals-strategy:[106:127] + ) + + cerebro.run() + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[105:119] +==backtrader.samples.pyfolio2.pyfoliotest:[106:120] + args = parse_args(args) + + cerebro = bt.Cerebro() + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[65:76] +==backtrader.samples.pyfolio2.pyfoliotest:[75:87] + txtfields = list() + txtfields.append("%04d" % len(self)) + txtfields.append(self.data.datetime.datetime(0).isoformat()) + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[50:63] +==backtrader.samples.pyfolio2.pyfoliotest:[59:72] + txtfields = list() + txtfields.append("Len") + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[640:652] +==backtrader.samples.vctest.vctest:[518:530] + ) + + parser.add_argument( + "--exectype", + default=bt.Order.ExecTypes[0], + choices=bt.Order.ExecTypes, + required=False, + action="store", + help="Execution to Use when opening position", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[166:181] +==backtrader.samples.signals-strategy.signals-strategy:[80:95] + args = parse_args(args) + + cerebro = bt.Cerebro() + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[249:261] +==backtrader.samples.pyfoliotest.pyfoliotest:[207:219] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[352:364] +==backtrader.samples.signals-strategy.signals-strategy:[158:170] + ) + + parser.add_argument( + "--smaperiod", + required=False, + action="store", + type=int, + default=30, + help="Period for the moving average", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[280:292] +==backtrader.samples.pyfolio2.pyfoliotest:[260:272] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[266:278] +==backtrader.samples.multi-copy.multi-copy:[235:247] + ) + + parser.add_argument( + "--fromdate", + required=False, + default="2005-01-01", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[230:251] +==backtrader.samples.multi-copy.multi-copy:[208:230] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for Tharp example with MACD", + ) + + # pgroup = parser.add_mutually_exclusive_group(required=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[34:46] +==backtrader.samples.vctest.vctest:[34:46] +class BtTestStrategy(bt.Strategy): + """ """ + + params = dict( + smaperiod=5, + trade=False, + stake=10, + exectype=bt.Order.Market, + stopafter=0, + valid=None, + cancel=0, + donotsell=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[470:482] +==backtrader.samples.oandatest.oandatest:[442:454] + ) + + parser.add_argument( + "--qcheck", + default=0.5, + type=float, + required=False, + action="store", + help="Timeout for periodic notification/resampling/replaying check", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[432:444] +==backtrader.samples.oandatest.oandatest:[395:407] + ) + + parser.add_argument( + "--stopafter", + default=0, + type=int, + required=False, + action="store", + help="Stop after x lines of LIVE data", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[419:431] +==backtrader.samples.oandatest.oandatest:[386:398] + ) + + parser.add_argument( + "--exactbars", + default=1, + type=int, + required=False, + action="store", + help="exactbars level, use 0/-1/-2 to enable plotting", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[239:251] +==backtrader.samples.resample-tickdata.resample-tickdata:[105:117] + help="Timeframe to resample to", + ) + + parser.add_argument( + "--compression", + default=1, + required=False, + type=int, + help="Compress n bars into 1", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[183:195] +==backtrader.samples.observer-benchmark.observer-benchmark:[205:217] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, + default=50000, + help="Cash to start with", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[173:192] +==backtrader.samples.partial-plot.partial-plot:[59:77] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[46:64] +==backtrader.samples.oco.oco:[48:66] + ) + + def notify_order(self, order): + """ + + :param order: + + """ + print( + "{}: Order ref: {} / Type {} / Status {}".format( + self.data.datetime.date(0), + order.ref, + "Buy" * order.isbuy() or "Sell", + order.getstatusname(), + ) + ) + + if order.status == order.Completed: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[94:116] +==backtrader.samples.vwr.vwr:[99:121] + cerebro.addwriter(bt.WriterFile, csv=args.writercsv, rounding=4) + + cerebro.run() # And run it + + # Plot if requested + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[239:251] +==backtrader.samples.multitrades.multitrades:[219:231] + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( + "--onlylong", "-ol", action="store_true", help="Do only long operations" + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[67:80] +==backtrader.contrib.utils.iqfeed-to-influxdb:[175:188] + if not os.path.exists(filename): + log.error("Ticker List file does not exist: %s", filename) + + tickers = [] + with io.open(filename, "r") as fd: + for ticker in fd: + tickers.append(ticker.rstrip()) + return tickers + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[248:258] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[377:387] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[373:387] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[394:408] + spread_window, + ) + ) + + # 执行网格搜索 + results = [] + total_combinations = len(param_combinations) + + print(f"开始网格搜索,共{total_combinations}种参数组合...") + + for i, ( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[257:277] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[335:355] + "spread_window": spread_window, + }, + } + + +def grid_search(): + """执行网格搜索找到最优参数""" + # 读取数据 + output_file = "/Users/f/Desktop/ricequant/1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key="/J").reset_index() + df1 = pd.read_hdf(output_file, key="/JM").reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + fromdate = datetime.datetime(2018, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 定义参数网格(参数数量较少) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[295:309] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[323:337] + spread_window, + ) + ) + + # 执行网格搜索 + results = [] + total_combinations = len(param_combinations) + + print(f"开始网格搜索,共{total_combinations}种参数组合...") + + for i, ( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[398:410] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[359:371] + print(f"夏普比率: {best_result['sharpe']:.4f}") + print(f"最大回撤: {best_result['drawdown']:.2f}%") + print(f"年化收益: {best_result['returns']:.2f}%") + print(f"总收益率: {best_result['roi']:.2f}%") + print(f"总交易次数: {best_result['total_trades']}") + print(f"胜率: {best_result['win_rate']:.2f}%") + + # 显示所有结果,按夏普比率排序 + print("\n========= 所有参数组合结果(按夏普比率排序)=========") + for i, result in enumerate(sorted_results[:10]): # 只显示前10个最好的结果 + print( + f"{i + 1}. spread_window={result['params']['spread_window']}, " (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[265:285] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[232:252] + "spread_window": spread_window, + }, + } + + +def grid_search(): + """执行网格搜索找到最优参数""" + # 读取数据 + output_file = "/Users/f/Desktop/ricequant/1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key="/J").reset_index() + df1 = pd.read_hdf(output_file, key="/JM").reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + fromdate = datetime.datetime(2018, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 定义参数网格 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[336:350] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[331:345] + spread_window, + ) + ) + + # 执行网格搜索 + results = [] + total_combinations = len(param_combinations) + + print(f"开始网格搜索,共{total_combinations}种参数组合...") + + for i, ( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[43:60] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[42:57] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 创建分位数指标(自定义) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[100:117] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[96:111] + p0 = df0.set_index("date")[f] + p1 = df1.set_index("date")[f] + aligned = p0.to_frame(name=f"price0_{f}").join( + p1.to_frame(name=f"price1_{f}"), how="inner" + ) + spread_f = aligned[f"price0_{f}"] - beta_shift * aligned[f"price1_{f}"] + out_cols[f"{f}"] = spread_f + + # 5) 整理输出 + out = pd.DataFrame(out_cols).dropna().reset_index(drop=True) + out["date"] = pd.to_datetime(out["date"]) + return out + + +# 读取数据 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[303:313] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[402:413] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Use daily data + riskfreerate=0, # Default risk-free rate + annualize=True, # Do not annualize + ) + cerebro.addanalyzer( + bt.analyzers.Returns, + tann=bt.TimeFrame.Days, # Annualization factor, 252 trading days + ) + # The period here can be daily, weekly, monthly, etc. (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[173:187] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[102:112] + if short: # Short spread + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # Long spread + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + dynamic_days = int(self.p.days_factor * signal_strength) + self.target_holding_days = max( + self.p.base_holding_days, self.p.base_holding_days + dynamic_days + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[153:170] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[89:102] + self.rolling_mu = bt.ind.SMA( + self.data2.close, period=self.p.win + ) # rolling mean + + # Holding days counter + self.holding_counter = 0 + self.target_holding_days = 0 # target holding days, dynamically calculated + self.in_position = False + + # Statistics variables + self.total_trades = 0 + self.total_holding_days = 0 + self.holding_days_list = [] # record holding days for each trade + self.trade_start_date = None + + # ---------- Trading helpers (original logic retained) ---------- + def _open_position(self, short, signal_strength): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.blaze:[57:71] +==backtrader.backtrader.feeds.pandafeed:[147:161] + ) + + datafields = [ + "datetime", + "open", + "high", + "low", + "close", + "volume", + "openinterest", + ] + + def __init__(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.oandabroker:[439:486] +==backtrader.backtrader.brokers.vcbroker:[349:386] + return order + + def buy( + self, + owner, + data, + size, + price=None, + plimit=None, + exectype=None, + valid=None, + tradeid=0, + oco=None, + trailamount=None, + trailpercent=None, + parent=None, + transmit=True, + **kwargs, + ): + """ + + :param owner: + :param data: + :param size: + :param price: (Default value = None) + :param plimit: (Default value = None) + :param exectype: (Default value = None) + :param valid: (Default value = None) + :param tradeid: (Default value = 0) + :param oco: (Default value = None) + :param trailamount: (Default value = None) + :param trailpercent: (Default value = None) + :param parent: (Default value = None) + :param transmit: (Default value = True) + :param **kwargs: + + """ + + order = BuyOrder( + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[333:355] +==backtrader.backtrader.brokers.ibbroker:[392:404] + try: + self.pending.remove(order) + except ValueError: + # If the list didn't have the element we didn't cancel anything + return False + + order.cancel() + self.notify(order) + self._ococheck(order) + if not bracket: + self._bracketize(order, cancel=True) + return True (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[139:158] +==backtrader.strategies:[149:158] + fix_result_order_id = self.xt_trader.order_stock( + self.acc, + stock_code, + xtconstant.STOCK_BUY, + quantity, + xtconstant.FIX_PRICE, + price, + ) + print(fix_result_order_id) + + def sell(self, stock_code, price, quantity): + """ + + :param stock_code: + :param price: + :param quantity: + + """ + # 买之前得检查仓位 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1375:1384] +==backtrader.xtquant.xtbson.bson37.__init__:[1888:1897] + try: + while position < end: + obj_size = _UNPACK_INT_FROM(data, position)[0] + if data_len - position < obj_size: + raise InvalidBSON("invalid object size") + obj_end = position + obj_size - 1 + if data[obj_end] != 0: + raise InvalidBSON("bad eoo") + if use_raw: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.raw_bson:[118:142] +==backtrader.xtquant.xtbson.bson37.raw_bson:[155:194] + raise TypeError( + "RawBSONDocument cannot use CodecOptions with document class %s" + % (codec_options.document_class,) + ) + self.__codec_options = codec_options + # Validate the bson object size. + _get_object_size(bson_bytes, 0, len(bson_bytes)) + + @property + def raw(self) -> bytes: + """The raw BSON bytes composing this document. + + + :rtype: bytes + + """ + return self.__raw + + def items(self) -> ItemsView[str, Any]: + """Lazily decode and iterate elements in this document. + + + :rtype: ItemsView[str,Any] + + """ + return self.__inflated.items() + + @property + def __inflated(self) -> Mapping[str, Any]: + """ + + + :rtype: Mapping[str,Any] + + """ + if self.__inflated_doc is None: + # We already validated the object's size when this document was + # created, so no need to do that again. + # Use SON to preserve ordering of elements. (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[396:409] +==backtrader.xtquant.xtbson.bson37.codec_options:[508:526] + ) + ) + + def _options_dict(self): + """Dictionary of the arguments used to create this object.""" + # TODO: PYTHON-2442 use _asdict() instead + return { + "document_class": self.document_class, + "tz_aware": self.tz_aware, + "uuid_representation": self.uuid_representation, + "unicode_decode_error_handler": self.unicode_decode_error_handler, + "tzinfo": self.tzinfo, + "type_registry": self.type_registry, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_resample_optimize:[5:39] +==backtrader.tests.test_strategy_optimized:[130:153] +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), + ("printdata", True), + ("printops", True), + ) + + def log(self, txt, dt=None): + """ + + :param txt: + :param dt: (Default value = None) + + """ + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + + def __init__(self): + """ """ + # Flag to allow new orders in the system or not (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_awesomeoscillator:[43:52] +==backtrader.tests.test_ind_sumn:[46:55] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_atr:[45:54] +==backtrader.tests.test_ind_minperiod:[44:53] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_aroonupdown:[46:55] +==backtrader.tests.test_ind_lowest:[46:55] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_aroonoscillator:[43:52] +==backtrader.tests.test_ind_highest:[46:55] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[44:53] +==backtrader.tests.test_ind_accdecosc:[43:52] + datas = [testcommon.getdata(i) for i in range(chkdatas)] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stop-trading.stop-loss-approaches:[218:234] +==backtrader.samples.timers.scheduled:[137:154] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[108:127] +==backtrader.samples.vwr.vwr:[101:121] + cerebro.run() + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-history.order-history:[158:174] +==backtrader.samples.timers.scheduled-min:[148:165] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[158:172] +==backtrader.samples.order-close.close-minute:[126:140] + return data + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample for Close Orders with daily data", + ) + + parser.add_argument( + "--infile", + "-i", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[206:226] +==backtrader.samples.order_target.order_target:[164:184] + cerebro.run() + + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[134:147] +==backtrader.samples.talib.talibtest:[261:274] + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[72:92] +==backtrader.samples.rollover.rollover:[151:171] + cerebro.run(stdstats=False) + + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.kselrsi.ksignal:[161:172] +==backtrader.turtle.sma:[115:124] + ) + parser.add_argument( + "--strat", + required=False, + action="store", + default="", + help="Arguments for the strategy", + ) + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[525:536] +==backtrader.samples.vctest.vctest:[372:383] + ) + + parser.add_argument( + "--data0", + default=None, + required=True, + action="store", + help="data 0 into the system", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[133:143] +==backtrader.samples.vctest.vctest:[126:136] + txt.append("%s" % self.data.datetime.datetime(0).strftime(dtfmt)) + txt.append("{}".format(self.data.open[0])) + txt.append("{}".format(self.data.high[0])) + txt.append("{}".format(self.data.low[0])) + txt.append("{}".format(self.data.close[0])) + txt.append("{}".format(self.data.volume[0])) + txt.append("{}".format(self.data.openinterest[0])) + txt.append("{}".format(self.sma[0])) + print(", ".join(txt)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[34:45] +==backtrader.samples.oandatest.oandatest:[38:49] +class BtTestStrategy(bt.Strategy): + """ """ + + params = dict( + smaperiod=5, + trade=False, + stake=10, + exectype=bt.Order.Market, + stopafter=0, + valid=None, + cancel=0, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-resample.data-resample:[100:111] +==backtrader.samples.resample-tickdata.resample-tickdata:[105:116] + help="Timeframe to resample to", + ) + + parser.add_argument( + "--compression", + default=1, + required=False, + type=int, + help="Compress n bars into 1", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[303:316] +==backtrader.samples.talib.tablibsartest:[127:140] + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[102:115] +==backtrader.samples.lineplotter.lineplotter:[59:71] + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given + data = bt.feeds.BacktraderCSVData(dataname=args.data, **dkwargs) + cerebro.adddata(data) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[56:72] +==backtrader.samples.multi-example.mult-values:[182:198] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.YahooFinanceCSVData(dataname=args.data0, **kwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[122:133] +==backtrader.samples.data-filler.data-filler:[119:130] + ) + + parser.add_argument( + "--fvol", + required=False, + default=0.0, + type=float, + help="Use as fill volume for missing bar (def: 0.0)", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[194:216] +==backtrader.samples.stoptrail.trail:[108:130] + ], + ) + ) + ) + + +def runstrat(args=None): + """ + + :param args: (Default value = None) + + """ + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[173:189] +==backtrader.samples.renko.renko:[53:69] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[33:44] +==backtrader.samples.oco.oco:[33:44] +class St(bt.Strategy): + """ """ + + params = dict( + ma=bt.ind.SMA, + p1=5, + p2=15, + limit=0.005, + limdays=3, + limdays2=1000, + hold=10, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[430:443] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[217:230] + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[142:161] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[96:116] + cerebro.run() + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[134:145] +==backtrader.samples.yahoo-test.yahoo-test:[91:102] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[152:171] +==backtrader.samples.plot-same-axis.plot-same-axis:[71:90] + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( + dataname=args.data, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro + cerebro.adddata(data) + + # Add the strategy + cerebro.addstrategy( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[218:228] +==backtrader.samples.lineplotter.lineplotter:[95:105] + parser.add_argument( + "--data", + "-d", + default="../../datas/2005-2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( + "--fromdate", + "-f", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[229:240] +==backtrader.samples.calendar-days.calendar-days:[99:110] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.samples.pair-trading.pair-trading:[103:115] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[103:115] + if self.orderid: + return # if an order is active, no new orders are allowed + + if self.p.printout: + print("Self len:", len(self)) + print("Data0 len:", len(self.data0)) + print("Data1 len:", len(self.data1)) + print("Data0 len == Data1 len:", len(self.data0) == len(self.data1)) + + print("Data0 dt:", self.data0.datetime.datetime()) + print("Data1 dt:", self.data1.datetime.datetime()) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[140:149] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[126:135] + or days_in_trade >= self.p.max_hold_days + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM偏度差={current_delta:.2f}," + f" 持仓天数={days_in_trade}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[126:135] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[140:149] + or days_in_trade >= self.p.max_hold_days + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM偏度差={current_delta:.2f}," + f" 持仓天数={days_in_trade}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[145:155] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[133:143] + ) or days_in_trade >= self.p.max_hold_days: + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM夏普差={delta_sharpe:.4f}," + f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[133:143] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[145:155] + ) or days_in_trade >= self.p.max_hold_days: + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: J-JM夏普差={delta_sharpe:.4f}," + f" 持仓天数={days_in_trade}, 均值={ma_delta:.4f}" + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[172:188] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[177:193] + cerebro.broker.set_shortcash(False) + + # 加载数据 + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return + + # 添加数据 + cerebro.adddata(data0, name="J") + cerebro.adddata(data1, name="JM") + + # 添加策略 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[141:153] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[135:147] + df0 = pd.read_hdf(output_file, key=symbol1).reset_index() + df1 = pd.read_hdf(output_file, key=symbol2).reset_index() + + date_col = [col for col in df0.columns if "date" in col.lower()] + if not date_col: + raise ValueError("数据集中未找到日期列") + + df0 = df0.set_index(pd.to_datetime(df0[date_col[0]])) + df1 = df1.set_index(pd.to_datetime(df1[date_col[0]])) + df0 = df0.sort_index().loc[fromdate:todate] + df1 = df1.sort_index().loc[fromdate:todate] + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[184:196] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[90:102] + ("max_positions", 3), # 最大加仓次数 + ("add_position_threshold", 0.1), # 加仓阈值(相对于轨道的百分比) + ("verbose", True), # 是否打印详细信息 + ) + + def __init__(self): + # 计算价差的分位数指标 + self.quantile = QuantileIndicator( + self.data2.close, + period=self.p.lookback_period, + upper_quantile=self.p.upper_quantile, + lower_quantile=self.p.lower_quantile, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.Kalman:[251:262] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[373:383] + cerebro.broker.set_shortcash(False) + + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.test:[25:58] +==backtrader.arbitrage.test_feedspread_yearly:[41:75] + df1_aligned = df1.loc[common_dates] + df2_aligned = df2.loc[common_dates] + + return df1_aligned, df2_aligned + + +# 2. Calculate spread + + +def calculate_spread(df_I, df_RB, columns=["open", "high", "low", "close", "volume"]): + """Calculate spread between two DataFrames + + :param df_I: + :param df_RB: + :param columns: (Default value = ["open","high","low","close","volume"]) + + """ + # Align data + df_I_aligned, df_RB_aligned = check_and_align_data(df_I, df_RB) + + # Create spread DataFrame + df_spread = pd.DataFrame(index=df_I_aligned.index) + + # Subtract each column + for col in columns: + if col in df_I_aligned.columns and col in df_RB_aligned.columns: + df_spread[f"{col}"] = 5 * df_I_aligned[col] - df_RB_aligned[col] + + return df_spread.reset_index() + + +# Bollinger Band strategy + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[96:114] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy:[19:34] + ) + + def __init__(self): + """ """ + # Bollinger Bands indicator - using passed spread data + self.boll = bt.indicators.BollingerBands( + self.data2.close, + period=self.p.period, + devfactor=self.p.devfactor, + subplot=False, + ) + + # Trading status + self.order = None + self.entry_price = 0 + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[109:129] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[110:129] + self.order = None + self.entry_price = 0 + + def next(self): + if self.order: + return + + # 获取当前beta值 + current_beta = self.data2.beta[0] + + # 处理缺失beta情况 + if pd.isna(current_beta) or current_beta <= 0: + return + + # 动态设置交易规模 + self.size0 = 10 # 固定J的规模 + self.size1 = round(current_beta * 10) # 根据beta调整JM的规模 + + # 打印调试信息 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[398:409] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[399:410] + print(f"夏普比率: {best_result['sharpe']:.4f}") + print(f"最大回撤: {best_result['drawdown']:.2f}%") + print(f"年化收益: {best_result['returns']:.2f}%") + print(f"总收益率: {best_result['roi']:.2f}%") + print(f"总交易次数: {best_result['total_trades']}") + print(f"胜率: {best_result['win_rate']:.2f}%") + + # 显示所有结果,按夏普比率排序 + print("\n========= 所有参数组合结果(按夏普比率排序)=========") + for i, result in enumerate(sorted_results[:10]): # 只显示前10个最好的结果 + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[415:426] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[375:386] + f"sharpe={result['sharpe']:.4f}, " + f"drawdown={result['drawdown']:.2f}%, " + f"return={result['returns']:.2f}%, " + f"win_rate={result['win_rate']:.2f}%" + ) + else: + print("未找到有效的参数组合") + + +if __name__ == "__main__": + grid_search() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[271:282] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[219:230] + cerebro.broker.set_shortcash(False) + + # Add analyzers + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) + cerebro.addanalyzer(bt.analyzers.Returns) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[85:96] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[170:182] + if not hasattr(self, "size0"): + self.size0 = 10 + self.size1 = round(self.data2.beta[0] * 10) + if short: # 做空价差 + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # 做多价差 + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) + + def _close_positions(self): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.quandl:[91:110] +==backtrader.backtrader.feeds.yahoo:[100:119] + return # revers is True but also online, managed with order=asc + + # Quandl data can be in reverse order -> reverse + dq = collections.deque() + for line in self.f: + dq.appendleft(line) + + f = io.StringIO(newline=None) + f.writelines(dq) + f.seek(0) + self.f.close() + self.f = f + + def _loadline(self, linetokens): + """ + + :param linetokens: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[711:720] +==backtrader.backtrader.brokers.vcbroker:[377:386] + order = BuyOrder( + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.strategy:[782:791] +==backtrader.backtrader.utils.timer:[55:64] + when=when, + offset=offset, + repeat=repeat, + weekdays=weekdays, + weekcarry=weekcarry, + monthdays=monthdays, + monthcarry=monthcarry, + allow=allow, + tzdata=tzdata, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[159:175] +==backtrader.strategies:[173:182] + fix_result_order_id = self.xt_trader.order_stock( + self.acc, + stock_code, + xtconstant.STOCK_SELL, + quantity, + xtconstant.FIX_PRICE, + price, + ) + print(fix_result_order_id) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1556:1565] +==backtrader.xtquant.xtbson.bson37.__init__:[2167:2176] + while True: + # Read size of next object. + size_data = file_obj.read(4) + if not size_data: + break # Finished with file normaly. + elif len(size_data) != 4: + raise InvalidBSON("cut off in middle of objsize") + obj_size = _UNPACK_INT_FROM(size_data, 0)[0] - 4 + elements = size_data + file_obj.read(max(0, obj_size)) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[733:741] +==backtrader.xtquant.xtbson.bson37.__init__:[1092:1100] + try: + _utf_8_decode(string, None, True) + return string + b"\x00" + except UnicodeError: + raise InvalidStringData( + "strings in documents must be valid UTF-8: %r" % string + ) + else: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[711:719] +==backtrader.xtquant.xtbson.bson37.__init__:[1116:1124] + try: + _utf_8_decode(string, None, True) + return string + b"\x00" + except UnicodeError: + raise InvalidStringData( + "strings in documents must be valid UTF-8: %r" % string + ) + else: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_aroonoscillator:[47:57] +==backtrader.tests.test_ind_oscillator:[57:67] + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_accdecosc:[47:57] +==backtrader.tests.test_ind_envelope:[61:71] + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[49:59] +==backtrader.tests.test_data_resample:[55:65] + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[45:53] +==backtrader.tests.test_data_replay:[50:58] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_multidata_optimize:[22:31] +==backtrader.tests.test_pickle_datatrades:[26:35] + data = bt.feeds.YahooFinanceCSVData( + dataname=getdatadir("nvda-1999-2014.txt"), + fromdate=datetime.datetime(2000, 1, 1), + todate=datetime.datetime(2002, 12, 31), + reverse=False, + swapcloses=True, + ) + cerebro.adddata(data) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_bbroker_try_exec_limit:[170:180] +==backtrader.tests.test_math_function_scalar:[140:149] + datapath = os.path.join(modpath, dataspath, datafile) + data0 = bt.feeds.GenericCSVData( + dataname=datapath, + dtformat="%Y-%m-%d", + timeframe=bt.TimeFrame.Days, + compression=1, + ) + cerebro.adddata(data0) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.vwr.vwr:[147:157] +==backtrader.samples.writer-test.writer-test:[224:234] + ) + + parser.add_argument( + "--writercsv", + "-wcsv", + action="store_true", + help="Tell the writer to produce a csv stream", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[46:57] +==backtrader.samples.timers.scheduled:[43:54] + ) + + def __init__(self): + """ """ + bt.ind.SMA() + if self.p.timer: + self.add_timer( + when=self.p.when, + offset=self.p.offset, + repeat=self.p.repeat, + weekdays=self.p.weekdays, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[33:43] +==backtrader.samples.timers.scheduled:[33:43] +class St(bt.Strategy): + """ """ + + params = dict( + when=bt.timer.SESSION_START, + timer=True, + cheat=False, + offset=datetime.timedelta(), + repeat=datetime.timedelta(), + weekdays=[], (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.signals-strategy.signals-strategy:[109:127] +==backtrader.tools.rewrite-data:[138:155] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfoliotest.pyfoliotest:[102:112] +==backtrader.samples.talib.talibtest:[169:179] + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + data0 = bt.feeds.YahooFinanceCSVData(dataname=args.data0, **dkwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfoliotest.pyfoliotest:[165:175] +==backtrader.samples.sizertest.sizertest:[145:155] + ) + + parser.add_argument( + "--data0", + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar:[75:98] +==backtrader.samples.tradingcalendar.tcal:[134:157] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar-intraday:[76:89] +==backtrader.samples.timers.scheduled-min:[145:159] + ) + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[252:261] +==backtrader.samples.pyfolio2.pyfoliotest:[77:87] + txtfields.append(self.data.datetime.datetime(0).isoformat()) + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[214:223] +==backtrader.samples.pyfolio2.pyfoliotest:[61:72] + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order_target.order_target:[166:184] +==backtrader.samples.rollover.rollover:[153:171] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[145:160] +==backtrader.samples.tradingcalendar.tcal:[102:116] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[164:187] +==backtrader.samples.tradingcalendar.tcal-intra:[136:159] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[110:120] +==backtrader.samples.talib.tablibsartest:[52:62] + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + data0 = bt.feeds.YahooFinanceCSVData(dataname=args.data0, **dkwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[143:162] +==backtrader.samples.sizertest.sizertest:[126:144] + cerebro.run() + + if args.plot: + pkwargs = dict() + if args.plot is not True: # evals to True but is not True + pkwargs = eval("dict(" + args.plot + ")") # args were passed + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[169:181] +==backtrader.samples.vwr.vwr:[52:64] + cerebro.broker.set_cash(args.cash) + + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[208:226] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[328:346] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.mixing-timeframes.mixing-timeframes:[62:77] +==backtrader.samples.pivot-point.ppsample:[54:69] + ] + ) + + print(txt) + + +def runstrat(): + """ """ + args = parse_args() + + cerebro = bt.Cerebro() + data = btfeeds.BacktraderCSVData(dataname=args.data) + cerebro.adddata(data) + cerebro.resampledata(data, timeframe=bt.TimeFrame.Months) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.memory-savings.memory-savings:[164:174] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[347:357] + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/yhoo-1996-2015.txt", + help="Data to be read in", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[74:97] +==backtrader.samples.psar.psar-intraday:[92:115] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[55:70] +==backtrader.samples.multi-example.mult-values:[182:197] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[376:386] +==backtrader.samples.vctest.vctest:[279:289] + cerebro.resampledata(data1, **rekwargs) + + else: + cerebro.adddata(data0) + if data1 is not None: + cerebro.adddata(data1) + + if args.valid is None: + valid = None + else: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[701:711] +==backtrader.samples.oandatest.oandatest:[615:625] + ) + + parser.add_argument( + "--trade", + required=False, + action="store_true", + help="Do Sample Buy/Sell operations", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[575:585] +==backtrader.samples.oandatest.oandatest:[498:508] + ) + + parser.add_argument( + "--no-backfill", + required=False, + action="store_true", + help="Disable backfilling after a disconnection", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[557:567] +==backtrader.samples.oandatest.oandatest:[491:501] + ) + + parser.add_argument( + "--no-backfill_start", + required=False, + action="store_true", + help="Disable backfilling at the start", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[108:118] +==backtrader.samples.strategy-selection.strategy-selection:[106:116] + ) + + parser.add_argument( + "--data", + required=False, + default="../../datas/2005-2006-day-001.txt", + help="Data to be read in", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[66:75] +==backtrader.samples.observer-benchmark.observer-benchmark:[67:76] + txtfields.append(self.data.datetime.datetime(0).isoformat()) + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[47:56] +==backtrader.samples.observer-benchmark.observer-benchmark:[52:63] + txtfields.append("Datetime") + txtfields.append("Open") + txtfields.append("High") + txtfields.append("Low") + txtfields.append("Close") + txtfields.append("Volume") + txtfields.append("OpenInterest") + print(",".join(txtfields)) + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[123:132] +==backtrader.samples.kselrsi.ksignal:[169:178] + ) + + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", + const="{}", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[260:270] +==backtrader.samples.data-replay.data-replay:[134:144] + ) + + parser.add_argument( + "--period", + default=10, + required=False, + type=int, + help="Period to apply to indicator", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[60:82] +==backtrader.samples.slippage.slippage:[53:76] + opcounter = itertools.count(1) + + def notify_order(self, order): + """ + + :param order: + + """ + if order.status == bt.Order.Completed: + t = "" + t += "{:02d}".format(next(self.opcounter)) + t += " {}".format(order.data.datetime.datetime()) + t += " BUY " * order.isbuy() or " SELL" + t += " Size: {:+d} / Price: {:.2f}" + print(t.format(order.executed.size, order.executed.price)) + + +def runstrat(args=None): + """ + + :param args: (Default value = None) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[299:308] +==backtrader.samples.sigsmacross.sigsmacross:[158:167] + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[143:161] +==backtrader.samples.macd-settings.macd-settings:[230:248] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[129:152] +==backtrader.samples.partial-plot.partial-plot:[80:103] + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) + + # Sizer + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[56:71] +==backtrader.samples.cheat-on-open.cheat-on-open:[110:125] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[181:193] +==backtrader.samples.timers.scheduled-min:[148:162] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker + cerebro.broker = bt.brokers.BackBroker(**eval("dict(" + args.broker + ")")) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[217:228] +==backtrader.samples.stop-trading.stop-loss-approaches:[253:264] + ) + + parser.add_argument( + "--data0", + default="../../datas/2005-2006-day-001.txt", + required=False, + help="Data to read in", + ) + + # Strategy to choose + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[64:72] +==backtrader.samples.oco.oco:[56:65] + print( + "{}: Order ref: {} / Type {} / Status {}".format( + self.data.datetime.date(0), + order.ref, + "Buy" * order.isbuy() or "Sell", + order.getstatusname(), + ) + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[204:221] +==backtrader.samples.calmar.calmar-test:[91:108] + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Sample Skeleton", + ) + + parser.add_argument( + "--data0", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy:[212:222] +==backtrader.samples.yahoo-test.yahoo-test:[98:108] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[186:196] +==backtrader.samples.vwr.vwr:[190:201] + ) + + parser.add_argument( + "--stddev-sample", + required=False, + action="store_true", + help="Consider Bessels correction for stddeviation", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[693:705] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[217:229] + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + + if pargs is not None: + return parser.parse_args(pargs) + + return parser.parse_args() + + +if __name__ == "__main__": (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[93:103] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[117:127] + ) + + parser.add_argument( + "--data", + "-d", + default="../../datas/2005-2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[75:92] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[99:116] + if args.plot: + pkwargs = dict(style="bar") + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.kselrsi.ksignal:[178:187] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[213:222] + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" + ' --plot style="candle" (to plot candles)\n' + ), + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[333:342] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[211:220] + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--plot", + required=False, + default="", + nargs="?", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[173:188] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[77:91] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[229:239] +==backtrader.samples.multitrades.multitrades:[207:217] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + default="2006-12-31", + help="Starting date in YYYY-MM-DD format", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[236:246] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[210:220] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[152:170] +==backtrader.samples.commission-schemes.commission-schemes:[113:131] + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( + dataname=args.data, fromdate=fromdate, todate=todate + ) + + # Add the 1st data to cerebro + cerebro.adddata(data) + + # Add a strategy (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[237:247] +==backtrader.samples.calendar-days.calendar-days:[137:147] + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[248:258] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[142:152] + ) + + parser.add_argument( + "--writercsv", + "-wcsv", + action="store_true", + help="Tell the writer to produce a csv stream", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[272:284] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[345:357] + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 加载数据一次(这些数据可以重复使用) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return + + print("开始网格回测...") + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[45:61] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[24:40] + ) + + # 交易相关变量 + self.order = None + self.position_type = None + + def next(self): + """ """ + if self.order: + return + + # 交易逻辑 + if self.position: + # 平仓条件 + if ( + self.position_type == "long_j_short_jm" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[8:22] +==backtrader.arbitrage.test_feedspread_yearly:[75:89] +class SpreadBollingerStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 20), # Bollinger Band period + ("devfactor", 2), # Bollinger Band standard deviation multiplier + ("size_i", 5), # Iron Ore trading size + ("size_rb", 1), # Rebar trading size + ) + + def __init__(self): + """ """ + # Bollinger Band indicator + self.boll = bt.indicators.BollingerBands( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.myutil:[15:28] +==backtrader.arbitrage.test_feedspread_yearly:[23:36] + if date_column in df1.columns: + df1 = df1.set_index(date_column) + if date_column in df2.columns: + df2 = df2.set_index(date_column) + + # Find common dates + common_dates = df1.index.intersection(df2.index) + + # Check for missing dates + missing_in_df1 = df2.index.difference(df1.index) + missing_in_df2 = df1.index.difference(df2.index) + + if len(missing_in_df1) > 0: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.hold_rb:[60:68] +==backtrader.arbitrage.test.hold_rb:[110:118] +cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 +) +cerebro.addanalyzer(bt.analyzers.AnnualReturn) +cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[96:110] +==backtrader.arbitrage.classic_indicators.bollingband:[16:32] + ) + + def __init__(self): + """ """ + # 布林带指标 + self.boll = bt.indicators.BollingerBands( + self.data2.close, # 使用外部计算的价差 + period=self.p.period, + devfactor=self.p.devfactor, + subplot=False, + ) + + # 交易状态 + self.order = None + + # 记录每年的净值 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[148:165] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[303:317] + self._close_positions() + + def _open_position(self, short): + """Place order with dynamic ratio + + :param short: + + """ + # Confirm trade size is valid + if not hasattr(self, "size0") or not hasattr(self, "size1"): + self.size0 = 10 # Default value + self.size1 = ( + round(self.data2.beta[0] * 10) + if not pd.isna(self.data2.beta[0]) + else 14 + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[301:309] +==backtrader.arbitrage.Kalman:[254:262] + cerebro.addanalyzer(bt.analyzers.DrawDown) # 回撤分析器 + cerebro.addanalyzer(bt.analyzers.ROIAnalyzer, period=bt.TimeFrame.Days) + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[58:69] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[471:482] +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # 添加beta线 + + params = ( + ("datetime", "date"), # 日期列 + ("close", "close"), # 价差列作为close + ("beta", "beta"), # beta列 + ("nocase", True), # 列名不区分大小写 + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[358:367] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[395:404] + f" spread_window={spread_window}" + ) + + try: + result = run_strategy( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[271:281] +==backtrader.arbitrage.classic_indicators.bollingband:[158:172] + cerebro.broker.set_shortcash(False) + + # Add analyzers + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + cerebro.addanalyzer(bt.analyzers.DrawDown) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[60:71] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[129:141] +class SpreadData(bt.feeds.PandasData): + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread as close + ("beta", "beta"), # beta column + ("nocase", True), # Column names are case insensitive + ) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[189:201] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[160:173] + position_size = self.getposition(self.data0).size + + # 4) Open position logic (keep unchanged) + if position_size == 0: + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + + if self.g_pos > h: + # Calculate signal strength: Magnitude of cumulative sum + # exceeding threshold h (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[328:336] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[396:404] + param_combinations.append( + ( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[183:193] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[254:264] + cerebro.adddata(data0, name="data0") + cerebro.adddata(data1, name="data1") + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( + DynamicSpreadCUSUMStrategy, + win=win, + k_coeff=k_coeff, + h_coeff=h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[370:380] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[80:90] +df0_bt = df0[(df0["date"] >= fromdate) & (df0["date"] <= todate)] +df1_bt = df1[(df1["date"] >= fromdate) & (df1["date"] <= todate)] +df_spread_bt = df_spread[ + (df_spread["date"] >= fromdate) & (df_spread["date"] <= todate) +] +data0 = bt.feeds.PandasData(dataname=df0_bt, datetime="date") +data1 = bt.feeds.PandasData(dataname=df1_bt, datetime="date") +data2 = SpreadData(dataname=df_spread_bt, datetime="date") + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[117:128] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[66:80] +class SpreadData(bt.feeds.PandasData): + """ """ + + lines = ("beta",) # Add beta line + + params = ( + ("datetime", "date"), # Date column + ("close", "close"), # Spread column as close + ("beta", "beta"), # Beta column + ("nocase", True), # Column names are case-insensitive + ) + + +# Filter dataframes by date before passing to Backtrader (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[320:334] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[417:429] + cerebro.addobserver(bt.observers.CumValue) + + # 运行回测 + results = cerebro.run() + strategy = results[0] # 获取策略实例 + + # 获取分析结果 + drawdown = strategy.analyzers.drawdown.get_analysis() + sharpe = strategy.analyzers.sharperatio.get_analysis() + roi = strategy.analyzers.roianalyzer.get_analysis() + total_returns = strategy.analyzers.returns.get_analysis() # 获取总回报率 + cagr = strategy.analyzers.cagranalyzer.get_analysis() + + # 打印分析结果 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[283:293] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[381:391] + cerebro.adddata(data0, name=args.df0_key.replace("/", "")) + cerebro.adddata(data1, name=args.df1_key.replace("/", "")) + cerebro.adddata(data2, name="spread") + + # 添加策略 + cerebro.addstrategy( + DynamicSpreadCUSUMStrategy, + win=args.win, + k_coeff=args.k_coeff, + h_coeff=args.h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[119:131] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[266:279] + position_size = self.getposition(self.data0).size + + # Open position logic + if position_size == 0: + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + + if self.g_pos > h: + # Calculate signal strength: magnitude of cumulative sum + # exceeding threshold h (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[1572:1591] +==backtrader.backtrader.stores.ibstores.ib:[1401:1409] + startDateTime, + endDateTime, + numberOfTicks, + whatToShow, + useRth, + ignoreSize, + miscOptions, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[553:561] +==backtrader.backtrader.stores.ibstores.decoder:[1170:1178] + leg.conId, + leg.ratio, + leg.action, + leg.exchange, + leg.openClose, + leg.shortSaleSlot, + leg.designatedLocation, + leg.exemptCode, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[311:319] +==backtrader.backtrader.stores.ibstores.decoder:[486:494] + c.conId, + c.symbol, + c.secType, + c.lastTradeDateOrContractMonth, + c.strike, + c.right, + c.multiplier, + c.exchange, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.indicators.pivotpoint:[70:79] +==backtrader.samples.pivot-point.pivotpoint:[62:73] + lines = ( + "p", + "s1", + "s2", + "r1", + "r2", + ) + plotinfo = dict(subplot=False) + + def __init__(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.yahoo:[258:268] +==backtrader.tools.yahoodownload:[60:70] + try: + import requests + except ImportError: + msg = ( + "The new Yahoo data feed requires to have the requests " + "module installed. Please use pip install requests or " + "the method of your choice" + ) + raise Exception(msg) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.btcsv:[283:293] +==backtrader.backtrader.feeds.ibdata:[488:498] + if cds is not None: + cdetails = cds[0] + self.tradecontract = cdetails.contract + self.tradecontractdetails = cdetails + else: + # no contract can be found (or many) + self.put_notification(self.DISCONNECTED) + return + + if self._state == self._ST_START: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[773:781] +==backtrader.backtrader.brokers.vcbroker:[378:386] + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[712:720] +==backtrader.backtrader.brokers.vcbroker:[432:440] + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[301:333] +==backtrader.backtrader.brokers.ibbroker:[359:391] + self.startingcash = self.cash = self.p.cash = cash + self._value = cash + + setcash = set_cash + + def add_cash(self, cash): + """Add/Remove cash to the system (use a negative value to remove) + + :param cash: + + """ + self._cash_addition.append(cash) + + def get_fundshares(self): + """Returns the current number of shares in the fund-like mode""" + return self._fundshares + + fundshares = property(get_fundshares) + + def get_fundvalue(self): + """Returns the Fund-like share value""" + return self._fundval + + fundvalue = property(get_fundvalue) + + def cancel(self, order, bracket=False): + """ + + :param order: + :param bracket: (Default value = False) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.__init__:[35:44] +==backtrader.backtrader.feeds.__init__:[27:37] +try: + pass +except ImportError: + pass # The user may not have ibpy installed + +try: + pass +except ImportError: + pass # The user may not have something installed + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.__init__:[30:40] +==backtrader.backtrader.feeds.__init__:[32:54] +try: + pass +except ImportError: + pass # The user may not have something installed + +try: + pass +except ImportError: + pass # The user may not have something installed + +from .btcsv import BacktraderCSVData +from .vchartcsv import VChartCSVData +from .vchartfile import VChartFile +from .sierrachart import SierraChartCSVData +from .mt4csv import MT4CSVData +from .yahoo import YahooFinanceCSVData, YahooFinanceData +from .vcdata import VCData +from .ibdata import IBData +from .oanda import OandaData +from .pandafeed import PandasData +from .csvgeneric import GenericCSVData + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.sharpe:[130:142] +==backtrader.backtrader.analyzers.sortino:[118:130] + ratio = ret_free_avg / retdev + + if factor is not None and self.p.convertrate and self.p.annualize: + ratio = math.sqrt(factor) * ratio + except (ValueError, TypeError, ZeroDivisionError): + ratio = None + else: + # no returns or stddev_sample was active and 1 return + ratio = None + + self.ratio = ratio + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.returns:[68:78] +==backtrader.backtrader.analyzers.roi:[24:36] + if self.p.fund is None: + self._fundmode = self.strategy.broker.fundmode + else: + self._fundmode = self.p.fund + + if not self._fundmode: + self._value_start = self.strategy.broker.getvalue() + else: + self._value_start = self.strategy.broker.fundvalue + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.returns:[55:67] +==backtrader.backtrader.analyzers.roi:[9:21] + ("fund", None), + ) + + _TANN = { + bt.TimeFrame.Days: 252.0, + bt.TimeFrame.Weeks: 52.0, + bt.TimeFrame.Months: 12.0, + bt.TimeFrame.Years: 1.0, + } + + def start(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.vcbroker:[574:582] +==backtrader.backtrader.order:[781:789] + size, + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.oandabroker:[389:397] +==backtrader.backtrader.order:[273:281] + size, + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.cerebro:[247:255] +==backtrader.backtrader.strategy:[783:791] + offset=offset, + repeat=repeat, + weekdays=weekdays, + weekcarry=weekcarry, + monthdays=monthdays, + monthcarry=monthcarry, + allow=allow, + tzdata=tzdata, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[117:138] +==backtrader.strategies:[130:148] + self.xt_trader.start() + connect_result = self.xt_trader.connect() + if connect_result != 0: + import sys + + sys.exit("链接失败,程序即将退出 %d" % connect_result) + subscribe_result = self.xt_trader.subscribe(self.acc) + if subscribe_result != 0: + print("账号订阅失败 %d" % subscribe_result) + + def buy(self, stock_code, price, quantity): + """ + + :param stock_code: + :param price: + :param quantity: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1523:1532] +==backtrader.xtquant.xtbson.bson37.__init__:[2127:2136] + raise _CODEC_OPTIONS_TYPE_ERROR + + position = 0 + end = len(data) - 1 + while position < end: + obj_size = _UNPACK_INT_FROM(data, position)[0] + elements = data[position: position + obj_size] + position += obj_size + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.timestamp:[21:57] +==backtrader.xtquant.xtbson.bson37.timestamp:[22:61] +UPPERBOUND = 4294967296 + + +class Timestamp(object): + """MongoDB internal timestamps used in the opLog.""" + + __slots__ = ("__time", "__inc") + + __getstate__ = _getstate_slots + __setstate__ = _setstate_slots + + _type_marker = 17 + + def __init__(self, time: Union[datetime.datetime, int], inc: int) -> None: + """Create a new :class:`Timestamp`. + + This class is only for use with the MongoDB opLog. If you need + to store a regular timestamp, please use a + :class:`~datetime.datetime`. + + Raises :class:`TypeError` if `time` is not an instance of + :class: `int` or :class:`~datetime.datetime`, or `inc` is not + an instance of :class:`int`. Raises :class:`ValueError` if + `time` or `inc` is not in [0, 2**32). + + :Parameters: + - `time`: time in seconds since epoch UTC, or a naive UTC + :class:`~datetime.datetime`, or an aware + :class:`~datetime.datetime` + - `inc`: the incrementing counter + + :param time: + :type time: Union[datetime.datetime, int] + :param inc: + :type inc: int + :rtype: None + + """ + if isinstance(time, datetime.datetime): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[389:396] +==backtrader.xtquant.xtbson.bson37.codec_options:[500:507] + % ( + document_class_repr, + self.tz_aware, + uuid_rep_repr, + self.unicode_decode_error_handler, + self.tzinfo, + self.type_registry, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[341:348] +==backtrader.xtquant.xtbson.bson37.codec_options:[446:453] + ) + if not isinstance(tz_aware, bool): + raise TypeError("tz_aware must be True or False") + if uuid_representation not in ALL_UUID_REPRESENTATIONS: + raise ValueError( + "uuid_representation must be a value from .binary.UuidRepresentation" + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[33:115] +==backtrader.xtquant.xtbson.bson37.codec_options:[48:146] + return property(abc.abstractmethod(func)) + + +_RAW_BSON_DOCUMENT_MARKER = 101 + + +def _raw_document_class(document_class): + """Determine if a document_class is a RawBSONDocument class. + + :param document_class: + + """ + marker = getattr(document_class, "_type_marker", None) + return marker == _RAW_BSON_DOCUMENT_MARKER + + +class TypeEncoder(abc.ABC): + """Base class for defining type codec classes which describe how a + custom type can be transformed to one of the types BSON understands. + + Codec classes must implement the ``python_type`` attribute, and the + ``transform_python`` method to support encoding. + + See :ref:`custom-type-type-codec` documentation for an example. + + + """ + + @_abstractproperty + def python_type(self): + """The Python type to be converted into something serializable.""" + + @abc.abstractmethod + def transform_python(self, value): + """Convert the given Python object into something serializable. + + :param value: + + """ + + +class TypeDecoder(abc.ABC): + """Base class for defining type codec classes which describe how a + BSON type can be transformed to a custom type. + + Codec classes must implement the ``bson_type`` attribute, and the + ``transform_bson`` method to support decoding. + + See :ref:`custom-type-type-codec` documentation for an example. + + + """ + + @_abstractproperty + def bson_type(self): + """The BSON type to be converted into our own type.""" + + @abc.abstractmethod + def transform_bson(self, value): + """Convert the given BSON value into our own type. + + :param value: + + """ + + +class TypeCodec(TypeEncoder, TypeDecoder): + """Base class for defining type codec classes which describe how a + custom type can be transformed to/from one of the types :mod:`bson` + can already encode/decode. + + Codec classes must implement the ``python_type`` attribute, and the + ``transform_python`` method to support encoding, as well as the + ``bson_type`` attribute, and the ``transform_bson`` method to support + decoding. + + See :ref:`custom-type-type-codec` documentation for an example. + + + """ + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtdata:[1953:1963] +==backtrader.xtquant.xtview:[299:329] + "starttime": start_time, + "endtime": end_time, + "incrementally": incrementally, + }, + ) + return + + +def modify_schedule_task( + schedule_name, + begin_time="", + finish_time="", + interval=60, + run=False, + only_work_date=False, + always_run=False, +): + """ + + :param schedule_name: + :param begin_time: (Default value = "") + :param finish_time: (Default value = "") + :param interval: (Default value = 60) + :param run: (Default value = False) + :param only_work_date: (Default value = False) + :param always_run: (Default value = False) + + """ + cl = get_client() + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_ind_envelope:[30:38] +==backtrader.tests.test_ind_kamaenvelope:[30:38] +chkdatas = 1 +chkvals = [ + ["4063.463000", "3644.444667", "3554.693333"], + ["4165.049575", "3735.555783", "3643.560667"], + ["3961.876425", "3553.333550", "3465.826000"], +] + +chkmin = 30 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[50:59] +==backtrader.tests.test_data_pandas:[115:124] + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, + chkargs=chkargs, + ) + + +if __name__ == "__main__": + test_run(main=True) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-timereturn:[48:71] +==backtrader.tests.test_math_function_scalar:[43:62] + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def __init__(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[203:211] +==backtrader.tests.test_analyzer-timereturn:[189:197] + ) + + for cerebro in cerebros: + strat = cerebro.runstrats[0][0] # no optimization, only 1 + analyzer = strat.analyzers[0] # only 1 + analysis = analyzer.get_analysis() + if main: + print(analysis) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[29:44] +==backtrader.tests.test_analyzer-timereturn:[29:45] +try: + time_clock = time.process_time +except BaseException: + time_clock = time.clock + +import backtrader as bt +import backtrader.indicators as btind +import testcommon +from backtrader.utils.py3 import PY2 + + +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[48:71] +==backtrader.tests.test_bbroker_try_exec_limit:[42:65] + ) + + def log(self, txt, dt=None, nodate=False): + """ + + :param txt: + :param dt: (Default value = None) + :param nodate: (Default value = False) + + """ + if not nodate: + dt = dt or self.data.datetime[0] + dt = bt.num2date(dt) + print("%s, %s" % (dt.isoformat(), txt)) + else: + print("---------- %s" % (txt)) + + def notify_trade(self, trade): + """ + + :param trade: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.sigsmacross.sigsmacross:[132:140] +==backtrader.samples.sizertest.sizertest:[182:190] + ) + + parser.add_argument( + "--stake", + required=False, + action="store", + type=int, + default=1, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfolio2.pyfoliotest:[111:120] +==backtrader.samples.talib.tablibsartest:[52:61] + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[67:77] +==backtrader.samples.timers.scheduled-min:[148:159] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[110:119] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[292:301] + dkwargs = dict() + if args.fromdate: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-copy.multi-copy:[248:256] +==backtrader.samples.sigsmacross.sigsmacross:[122:130] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.memory-savings.memory-savings:[193:204] +==backtrader.samples.mixing-timeframes.mixing-timeframes:[103:114] + ) + + parser.add_argument( + "--plot", required=False, action="store_true", help="Plot the result" + ) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[370:378] +==backtrader.samples.sratio.sratio:[99:107] + ) + + parser.add_argument( + "--riskfreerate", + required=False, + action="store", + type=float, + default=0.01, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[279:287] +==backtrader.samples.order_target.order_target:[205:213] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[121:129] +==backtrader.samples.sigsmacross.sigsmacross:[149:157] + ) + + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[59:68] +==backtrader.samples.multi-copy.multi-copy:[171:181] + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[799:818] +==backtrader.samples.vctest.vctest:[562:581] + ) + + parser.add_argument( + "--cancel", + default=0, + type=int, + required=False, + action="store", + help=( + "Cancel a buy order after n bars in operation," + " to be combined with orders like Limit" + ), + ) + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[799:813] +==backtrader.samples.oandatest.oandatest:[667:682] + ) + + parser.add_argument( + "--cancel", + default=0, + type=int, + required=False, + action="store", + help=( + "Cancel a buy order after n bars in operation," + " to be combined with orders like Limit" + ), + ) + + # Plot options (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[67:75] +==backtrader.samples.volumefilling.volumefilling:[80:89] + txtfields.append("%.2f" % self.data0.open[0]) + txtfields.append("%.2f" % self.data0.high[0]) + txtfields.append("%.2f" % self.data0.low[0]) + txtfields.append("%.2f" % self.data0.close[0]) + txtfields.append("%.2f" % self.data0.volume[0]) + txtfields.append("%.2f" % self.data0.openinterest[0]) + print(",".join(txtfields)) + + # Single order (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[84:92] +==backtrader.tests.test_data_pandas:[78:88] + dataframe = pandas.read_csv( + datapath, + skiprows=skiprows, + header=header, + parse_dates=True, + index_col=0, + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data-pandas-optix:[34:44] +==backtrader.tests.test_data_pandas:[53:72] +class PandasDataOptix(btfeeds.PandasData): + """ """ + + lines = ( + "optix_close", + "optix_pess", + "optix_opt", + ) + params = (("optix_close", -1), ("optix_pess", -1), ("optix_opt", -1)) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[126:137] +==backtrader.samples.data-resample.data-resample:[44:55] + datapath = args.dataname or "../../datas/2006-day-001.txt" + data = btfeeds.BacktraderCSVData(dataname=datapath) + + tframes = dict( + daily=bt.TimeFrame.Days, + weekly=bt.TimeFrame.Weeks, + monthly=bt.TimeFrame.Months, + ) + + # Handy dictionary for the argument timeframe conversion + # Resample the data (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-filler.data-filler:[100:108] +==backtrader.samples.relative-volume.relative-volume:[84:92] + parser.add_argument( + "--data", + "-d", + default="../../datas/2006-01-02-volume-min-001.txt", + help="data to add to the system", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[37:49] +==backtrader.samples.slippage.slippage:[38:50] + params = ( + ("p1", 10), + ("p2", 30), + ) + + def __init__(self): + """ """ + sma1 = bt.indicators.SMA(period=self.p.p1) + sma2 = bt.indicators.SMA(period=self.p.p2) + self.lines.signal = bt.indicators.CrossOver(sma1, sma2) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[280:288] +==backtrader.samples.pyfolio2.pyfoliotest:[247:255] + ) + + parser.add_argument( + "--stake", + required=False, + action="store", + default=10, + type=int, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[102:112] +==backtrader.samples.macd-settings.macd-settings:[170:180] + dkwargs = dict() + if args.fromdate is not None: + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + dkwargs["fromdate"] = fromdate + + if args.todate is not None: + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + dkwargs["todate"] = todate + + # if dataset is None, args.data has been given (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[289:298] +==backtrader.samples.kselrsi.ksignal:[169:177] + ) + + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[182:190] +==backtrader.samples.kselrsi.ksignal:[135:143] + help="Ending date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[118:129] +==backtrader.samples.tradingcalendar.tcal-intra:[116:126] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calendar-days.calendar-days:[137:146] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[211:220] + ) + + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[181:192] +==backtrader.samples.psar.psar-intraday:[79:89] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) + cerebro.adddata(data0) + + # Broker (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[196:216] +==backtrader.samples.cheat-on-open.cheat-on-open:[132:152] + cerebro.addsizer(bt.sizers.FixedSize, **eval("dict(" + args.sizer + ")")) + + # Strategy + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multitrades.multitrades:[219:227] +==backtrader.samples.yahoo-test.yahoo-test:[101:109] + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[123:131] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[203:212] + ) + + # Plot options + parser.add_argument( + "--plot", + "-p", + nargs="?", + required=False, + metavar="kwargs", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[218:226] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[119:127] + parser.add_argument( + "--data", + "-d", + default="../../datas/2005-2006-day-001.txt", + help="data to add to the system", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[105:112] +==backtrader.contrib.utils.iqfeed-to-influxdb:[213:220] + required=False, + action="store", + default=None, + type=int, + help="InfluxDB port number.", + ) + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[344:353] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[415:424] + plt.figure(figsize=(12, 8)) + + # 使用Seaborn的热力图 + ax = sns.heatmap( + results, + annot=True, + fmt=".2f", + cmap="YlGnBu", + xticklabels=entry_multipliers, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[71:80] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[58:67] + if len(self) > 1: # 确保有前一个价格 + ret_j = (self.data0.close[0] / self.data0.close[-1]) - 1 + ret_jm = (self.data1.close[0] / self.data1.close[-1]) - 1 + self.returns_j.append(ret_j) + self.returns_jm.append(ret_jm) + else: + return # 第一个bar没有前一天价格,跳过 + + # 当收益率数据不足时,跳过 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[283:291] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[290:298] + label="JM Price", + color="red", + ) + plt.title("Price of J and JM Contracts") + plt.legend() + plt.grid(True) + + plt.tight_layout() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[71:80] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[57:66] + if len(self) > 1: # 确保有前一个价格 + ret_j = (self.data0.close[0] / self.data0.close[-1]) - 1 + ret_jm = (self.data1.close[0] / self.data1.close[-1]) - 1 + self.returns_j.append(ret_j) + self.returns_jm.append(ret_jm) + else: + return # 第一个bar没有前一天价格,跳过 + + # 当收益率数据不足时,跳过 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[336:343] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[239:246] + datetime=None, # 使用索引 + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[327:334] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[248:255] + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) # pylint: disable=unexpected-keyword-arg (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[304:314] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[172:186] + cerebro.broker.set_slippage_perc(perc=0.0005) + cerebro.broker.set_shortcash(False) + + # 加载数据 + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[158:165] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[141:148] + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[149:156] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[150:157] + datetime=None, + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[172:188] +==backtrader.arbitrage.test.hold_rb:[123:135] +cerebro.addanalyzer( + bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days +) # 这里的period可以是daily, weekly, monthly等 +# 运行回测 +results = cerebro.run() +# + +# 获取分析结果 +sharpe = results[0].analyzers.sharperatio.get_analysis() +drawdown = results[0].analyzers.drawdown.get_analysis() +# annual_returns = results[0].analyzers.annualreturn.get_analysis() +# total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 +cagr = results[0].analyzers.cagranalyzer.get_analysis() +# trade = results[0].analyzers.tradeanalyzer.get_analysis() + +# 打印分析结果 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[196:207] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[201:215] + print("初始资金: %.2f" % cerebro.broker.getvalue()) + results = cerebro.run() + print("最终资金: %.2f" % cerebro.broker.getvalue()) + + # 打印分析结果 + strat = results[0] + print("夏普比率:", strat.analyzers.sharpe_ratio.get_analysis()["sharperatio"]) + print("最大回撤:", strat.analyzers.drawdown.get_analysis()["max"]["drawdown"]) + print("年化收益率:", strat.analyzers.returns.get_analysis()["rnorm100"]) + + # 使用backtrader原生绘图 + # cerebro.plot() + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[75:82] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[62:69] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: 价差={self.price_diff[0]:.2f}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[62:69] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[49:56] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( + f"平仓: 价差={self.price_diff[0]:.2f}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[48:61] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[35:48] + self.order = None + self.position_type = None + + def next(self): + """ """ + if self.order: + return + + # 交易逻辑 + if self.position: + # 平仓条件 + if ( + self.position_type == "long_j_short_jm" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[114:129] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[236:251] + if self.order: + return + + # 获取当前beta值 + current_beta = self.data2.beta[0] + + # 处理缺失beta情况 + if pd.isna(current_beta) or current_beta <= 0: + return + + # 动态设置交易规模 + self.size0 = 10 # 固定J的规模 + self.size1 = round(current_beta * 10) # 根据beta调整JM的规模 + + # 打印调试信息 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[398:407] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[438:447] + ) + print(f"夏普比率: {best_result['sharpe']:.4f}") + print(f"最大回撤: {best_result['drawdown']:.2f}%") + print(f"年化收益: {best_result['returns']:.2f}%") + print(f"总收益率: {best_result['roi']:.2f}%") + print(f"总交易次数: {best_result['total_trades']}") + print(f"胜率: {best_result['win_rate']:.2f}%") + + # 显示所有结果,按夏普比率排序 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[356:364] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[349:357] + ) + + try: + result = run_strategy( + data0, + data1, + data2, + rsi_period, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[309:316] +==backtrader.arbitrage.hold_rb:[68:79] +cerebro.addanalyzer( + bt.analyzers.Returns, + # timeframe=bt.TimeFrame.Days, # 按日数据计算 + tann=bt.TimeFrame.Days, # 年化因子,252 个交易日 +) # 自定义名称 + +# 添加CAGR分析器 +cerebro.addanalyzer( + bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days +) # 这里的period可以是daily, weekly, monthly等 +# 运行回测 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[189:200] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[113:124] + position_size = self.getposition(self.data0).size + + # 3) 交易逻辑 + if position_size == 0: # 当前无持仓 + # 计算动态配比 + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[198:207] +==backtrader.arbitrage.test.hold_rb:[108:116] + cerebro.broker.set_shortcash(False) + + # 添加分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[358:366] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[348:356] + f" spread_window={spread_window}" + ) + + try: + result = run_strategy( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[119:130] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[130:141] + position_size = self.getposition(self.data0).size + + # 4) 开仓逻辑——当 g 超过 h + if position_size == 0: + # 计算动态配比(与原来一致) + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[359:367] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[319:327] + ) + + try: + result = run_strategy( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[271:280] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[315:326] + cerebro.broker.set_shortcash(False) + + # 添加夏普比率分析器 + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) + + # 运行回测 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[160:170] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[106:117] + position_size = self.getposition(self.data0).size + + # 交易逻辑 + if position_size == 0: # 当前无持仓 + # 计算动态配比 + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[384:393] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[466:475] + if results: + # 按夏普比率排序 + sorted_results = sorted( + results, + key=lambda x: (x["sharpe"] if x["sharpe"] is not None else -float("inf")), + reverse=True, + ) + best_result = sorted_results[0] + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[417:428] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[478:489] + cerebro.addobserver(bt.observers.CumValue) + + # Run backtest + results = cerebro.run() + strategy = results[0] # Get strategy instance + + # Get analysis results + drawdown = strategy.analyzers.drawdown.get_analysis() + sharpe = strategy.analyzers.sharperatio.get_analysis() + roi = strategy.analyzers.roianalyzer.get_analysis() + total_returns = strategy.analyzers.returns.get_analysis() # Get total return rate (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[266:276] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[133:145] + position_size = self.getposition(self.data0).size + + # 交易逻辑 + if position_size == 0: # 当前无持仓 + # 计算动态配比 + beta_now = self.data2.beta[0] + if pd.isna(beta_now) or beta_now <= 0: + return + self.size0 = 10 + self.size1 = round(beta_now * 10) + + # 入场条件: RSI超买/超卖 + 价格突破布林带 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.filters.calendardays:[97:112] +==backtrader.backtrader.filters.session:[174:188] + for pricetype in [data.Open, data.High, data.Low, data.Close]: + bar[pricetype] = price + + # Fill volume and open interest + bar[data.Volume] = self.p.fill_vol + bar[data.OpenInterest] = self.p.fill_oi + + # Fill extra lines the data feed may have defined beyond DateTime + for i in range(data.DateTime + 1, data.size()): + bar[i] = data.lines[i][0] + + # Add this constructed bar to the stack of the stream + data._add2stack(bar) + + # Save to stack the bar that signaled the gap (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.decoder:[783:797] +==backtrader.backtrader.stores.ibstores.wrapper:[2030:2037] + exchange, + underlyingConId, + tradingClass, + multiplier, + expirations, + strikes, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[1442:1460] +==backtrader.backtrader.stores.ibstores.ib:[2002:2009] + conId, + providerCodes, + startDateTime, + endDateTime, + totalResults, + historicalNewsOptions, + ) + + def reqHeadTimeStamp(self, reqId, contract, whatToShow, useRTH, formatDate): + """ + + :param reqId: + :param contract: + :param whatToShow: + :param useRTH: + :param formatDate: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[311:318] +==backtrader.backtrader.stores.ibstores.decoder:[274:281] + c.conId, + c.symbol, + c.secType, + c.lastTradeDateOrContractMonth, + c.strike, + c.right, + c.multiplier, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.indicators.pivotpoint:[70:77] +==backtrader.samples.pivot-point.pivotpoint:[34:44] + lines = ( + "p", + "s1", + "s2", + "r1", + "r2", + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.indicators.contrib.vortex:[41:53] +==backtrader.backtrader.indicators.vortex:[37:49] + lines = ( + "vi_plus", + "vi_minus", + ) + + params = (("period", 14),) + + plotlines = dict(vi_plus=dict(_name="+VI"), vi_minus=dict(_name="-VI")) + + def __init__(self): + """ """ + h0l1 = abs(self.data.high(0) - self.data.low(-1)) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.yahoo:[315:327] +==backtrader.tools.yahoodownload:[141:153] + self.error = "Wrong content type: %s" % ctype + continue # HTML returned? wrong url? + + # buffer everything from the socket into a local buffer + try: + # r.encoding = 'UTF-8' + f = io.StringIO(resp.text, newline=None) + except Exception: + continue # try again if possible + + break + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.vchart:[124:134] +==backtrader.backtrader.feeds.vchartfile:[149:157] + self.lines.open[0] = o + self.lines.high[0] = h + self.lines.low[0] = l + self.lines.close[0] = c + self.lines.volume[0] = v + self.lines.openinterest[0] = oi + + return True # a bar has been successfully loaded (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.btcsv:[270:282] +==backtrader.backtrader.feeds.ibdata:[475:487] + else: + # no contract can be found (or many) + self.put_notification(self.DISCONNECTED) + return + + if self.pretradecontract is None: + # no different trading asset - default to standard asset + self.tradecontract = self.contract + self.tradecontractdetails = self.contractdetails + else: + # different target asset (typical of some CDS products) + # use other set of details (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.ibdata:[674:688] +==backtrader.backtrader.feeds.oanda:[261:275] + if ret: + return True + + # could not load bar ... go and get new one + continue + + # Fall through to processing reconnect - try to backfill + self._storedmsg[None] = msg # keep the msg + + # else do a backfill + if self._laststatus != self.DELAYED: + self.put_notification(self.DELAYED) + + dtend = None (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.blaze:[51:59] +==backtrader.backtrader.feeds.csvgeneric:[43:53] + ("open", 1), + ("high", 2), + ("low", 3), + ("close", 4), + ("volume", 5), + ("openinterest", 6), + ) + + def start(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1334:1341] +==backtrader.backtrader.brokers.ibbroker:[1239:1246] + if isinstance(dt, string_types): + dtfmt = "%Y-%m-%d" + if "T" in dt: + dtfmt += "T%H:%M:%S" + if "." in dt: + dtfmt += ".%f" + dt = datetime.datetime.strptime(dt, dtfmt) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1286:1293] +==backtrader.backtrader.brokers.ibbroker:[1287:1294] + if isinstance(dt, string_types): + dtfmt = "%Y-%m-%d" + if "T" in dt: + dtfmt += "T%H:%M:%S" + if "." in dt: + dtfmt += ".%f" + dt = datetime.datetime.strptime(dt, dtfmt) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.returns:[56:67] +==backtrader.backtrader.analyzers.vwr:[65:77] + ) + + _TANN = { + bt.TimeFrame.Days: 252.0, + bt.TimeFrame.Weeks: 52.0, + bt.TimeFrame.Months: 12.0, + bt.TimeFrame.Years: 1.0, + } + + def __init__(self): + """ """ + # Child log return analyzer (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.caganalyzer:[13:25] +==backtrader.backtrader.analyzers.roi:[10:21] + ) + + _TANN = { + bt.TimeFrame.Days: 252.0, + bt.TimeFrame.Weeks: 52.0, + bt.TimeFrame.Months: 12.0, + bt.TimeFrame.Years: 1.0, + } + + def __init__(self): + """ """ + # 初始化数据容器 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.ibbroker:[1528:1535] +==backtrader.backtrader.order:[888:895] + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, + margin, + pnl, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.ibbroker:[898:905] +==backtrader.backtrader.order:[782:789] + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[945:952] +==backtrader.backtrader.order:[274:281] + price, + closed, + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.lineiterator:[324:331] +==backtrader.backtrader.strategy:[391:399] + minperstatus = self._getminperstatus() + if minperstatus < 0: + self.next() + elif minperstatus == 0: + self.nextstart() # only called for the 1st value + else: + self.prenext() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[253:269] +==backtrader.strategies:[267:276] + self.log("BUY CREATE, %.2f" % self.dataclose[0]) + self.order = self.buy() + + else: + if len(self) >= (self.bar_executed + 5): + self.log("SELL CREATE, %.2f" % self.dataclose[0]) + self.order = self.sell() + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.live_backtrader:[236:253] +==backtrader.strategies:[257:266] + self.log("Close, %.2f" % self.dataclose[0]) + + # Check if an order is pending ... if yes, we cannot send a 2nd one + if self.order: + return + + # Check if we are in the market + if not self.position: + # Not yet ... we MIGHT BUY if ... + if self.dataclose[0] < self.dataclose[-1]: + # current close less than previous close + + if self.dataclose[-1] < self.dataclose[-2]: + # previous close less than the previous close + + # self.mbroker.buy(stock_code= stock_code , price=1000,quantity=200) + # BUY, BUY, BUY!!! (with default parameters) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1243:1249] +==backtrader.xtquant.xtbson.bson37.datetime_ms:[230:237] + diff = ((millis % 1000) + 1000) % 1000 + seconds = (millis - diff) // 1000 + micros = diff * 1000 + if opts.tz_aware: + dt = EPOCH_AWARE + datetime.timedelta(seconds=seconds, microseconds=micros) + if opts.tzinfo: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1393:1404] +==backtrader.xtquant.xtbson.bson37.__init__:[1901:1912] + position += obj_size + return docs + except InvalidBSON: + raise + except Exception: + # Change exception type to InvalidBSON but preserve traceback. + _, exc_value, exc_tb = sys.exc_info() + raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) + + +if _USE_C: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[1395:1404] +==backtrader.xtquant.xtbson.bson37.__init__:[1041:1050] + except InvalidBSON: + raise + except Exception: + # Change exception type to InvalidBSON but preserve traceback. + _, exc_value, exc_tb = sys.exc_info() + raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) + + +if _USE_C: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[664:673] +==backtrader.xtquant.xtbson.bson37.__init__:[1903:1912] + except InvalidBSON: + raise + except Exception: + # Change exception type to InvalidBSON but preserve traceback. + _, exc_value, exc_tb = sys.exc_info() + raise InvalidBSON(str(exc_value)).with_traceback(exc_tb) + + +if _USE_C: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.__init__:[600:625] +==backtrader.xtquant.xtbson.bson37.__init__:[935:950] + try: + value, position = _ELEMENT_GETTER[element_type]( + data, view, position, obj_end, opts, element_name + ) + except KeyError: + _raise_unknown_type(element_type, element_name) + + if opts.type_registry._decoder_map: + custom_decoder = opts.type_registry._decoder_map.get(type(value)) + if custom_decoder is not None: + value = custom_decoder(value) + + return element_name, value, position + + +def _raw_to_dict(data, position, obj_end, opts, result): + """ + + :param data: + :param position: + :param obj_end: + :param opts: + :param result: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.son:[262:268] +==backtrader.xtquant.xtbson.bson37.son:[212:218] + memo[val_id] = out + for k, v in self.items(): + if not isinstance(v, RE_TYPE): + v = copy.deepcopy(v, memo) + out[k] = v + return out (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.raw_bson:[151:173] +==backtrader.xtquant.xtbson.bson37.raw_bson:[220:254] + return self.__inflated[item] + + def __iter__(self) -> Iterator[str]: + """ + + + :rtype: Iterator[str] + + """ + return iter(self.__inflated) + + def __len__(self) -> int: + """ + + + :rtype: int + + """ + return len(self.__inflated) + + def __eq__(self, other: Any) -> bool: + """ + + :param other: + :type other: Any + :rtype: bool + + """ + if isinstance(other, RawBSONDocument): + return self.__raw == other.raw + return NotImplemented + + def __repr__(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[452:458] +==backtrader.xtquant.xtbson.bson37.codec_options:[575:581] + }: + if k == "uuidrepresentation": + kwargs["uuid_representation"] = options[k] + else: + kwargs[k] = options[k] + return CodecOptions(**kwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.qmttools.contextinfo:[419:425] +==backtrader.xtquant.qmttools.functions:[955:961] + stock_code, + period, + start_time, + end_time, + count, + dividend_type, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtdata:[183:195] +==backtrader.xtquant.xtview:[73:101] + global __client + + if not __client or not __client.is_connected(): + global __client_last_spec + + ip, port = __client_last_spec + __client = connect(ip, port, False) + + return __client + + +def hello(): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[135:141] +==backtrader.tests.test_strategy_unoptimized:[182:189] + tused = time_clock() - self.tstart + if self.p.printdata: + self.log("Time used: %s" % str(tused)) + self.log("Final portfolio value: %.2f" % self.broker.getvalue()) + self.log("Final cash value: %.2f" % self.broker.getcash()) + self.log("-------------------------") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_resampler:[238:245] +==backtrader.tests.test_tradingcalendar:[128:135] + use_tcal=True, + open_hour=8, + open_minute=0, + close_hour=20, + close_minute=30, + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_resampler:[174:180] +==backtrader.tests.test_tradingcalendar:[107:114] + use_tcal=True, + open_hour=8, + open_minute=0, + close_hour=20, + close_minute=0, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_multidata_optimize:[33:40] +==backtrader.tests.test_pickle_datatrades:[28:35] + fromdate=datetime.datetime(2000, 1, 1), + todate=datetime.datetime(2002, 12, 31), + reverse=False, + swapcloses=True, + ) + cerebro.adddata(data) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_multidata_optimize:[6:18] +==backtrader.tests.test_pickle_datatrades:[8:20] +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), + ("printdata", True), + ("printops", True), + ) + + +def test_multidata_optimize(): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_bbroker_try_exec_limit:[156:165] +==backtrader.tests.test_math_function_scalar:[128:137] + cerebro = bt.Cerebro() + + if main: + strat_kwargs = dict(printdata=True, printops=True) + else: + strat_kwargs = dict(printdata=False, printops=False) + + cerebro.addstrategy(SlipTestStrategy, **strat_kwargs) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[210:217] +==backtrader.samples.tradingcalendar.tcal:[204:211] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[202:209] +==backtrader.samples.tradingcalendar.tcal:[196:203] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[194:201] +==backtrader.samples.tradingcalendar.tcal:[188:195] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled:[222:229] +==backtrader.samples.tradingcalendar.tcal-intra:[186:193] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[233:240] +==backtrader.samples.timers.scheduled:[214:221] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[225:232] +==backtrader.samples.timers.scheduled:[206:213] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[217:224] +==backtrader.samples.timers.scheduled:[198:205] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[61:67] +==backtrader.samples.timers.scheduled:[54:60] + ) + if self.p.cheat: + self.add_timer( + when=self.p.when, + offset=self.p.offset, + repeat=self.p.repeat, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stoptrail.trail:[213:220] +==backtrader.samples.timers.scheduled-min:[209:216] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stop-trading.stop-loss-approaches:[308:315] +==backtrader.samples.stoptrail.trail:[205:212] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stop-trading.stop-loss-approaches:[300:307] +==backtrader.samples.stoptrail.trail:[197:204] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.stop-trading.stop-loss-approaches:[292:299] +==backtrader.samples.stoptrail.trail:[189:196] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.renko.renko:[178:185] +==backtrader.samples.stop-trading.stop-loss-approaches:[284:291] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.relative-volume.relative-volume:[126:137] +==backtrader.samples.writer-test.writer-test:[253:264] + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfoliotest.pyfoliotest:[207:214] +==backtrader.samples.sigsmacross.sigsmacross:[123:130] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar:[149:156] +==backtrader.samples.renko.renko:[152:159] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar:[141:148] +==backtrader.samples.renko.renko:[160:167] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar:[133:140] +==backtrader.samples.renko.renko:[136:143] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar:[125:132] +==backtrader.samples.renko.renko:[144:151] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar-intraday:[79:87] +==backtrader.samples.renko.renko:[61:69] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed + data0 = bt.feeds.BacktraderCSVData(dataname=args.data0, **kwargs) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[154:161] +==backtrader.samples.psar.psar-intraday:[158:165] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[146:153] +==backtrader.samples.psar.psar-intraday:[166:173] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[138:145] +==backtrader.samples.psar.psar-intraday:[142:149] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.partial-plot.partial-plot:[130:137] +==backtrader.samples.psar.psar-intraday:[150:157] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order_target.order_target:[206:213] +==backtrader.samples.pyfolio2.pyfoliotest:[260:267] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-execution.order-execution:[275:282] +==backtrader.samples.slippage.slippage:[149:156] + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-minute:[163:170] +==backtrader.samples.vwr.vwr:[138:145] + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-minute:[162:169] +==backtrader.samples.signals-strategy.signals-strategy:[139:146] + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.order-close.close-daily:[196:203] +==backtrader.tools.rewrite-data:[177:184] + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[238:245] +==backtrader.samples.order-history.order-history:[249:256] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[230:237] +==backtrader.samples.order-history.order-history:[257:264] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[222:229] +==backtrader.samples.order-history.order-history:[233:240] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oco.oco:[214:221] +==backtrader.samples.order-history.order-history:[241:248] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[214:221] +==backtrader.samples.sizertest.sizertest:[191:198] + ) + + parser.add_argument( + "--period", + required=False, + action="store", + type=int, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy:[249:260] +==backtrader.samples.multitrades.multitrades:[250:261] + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[213:220] +==backtrader.samples.multitrades.multitrades:[219:226] + parser.add_argument( + "--period", + default=15, + type=int, + help="Period to apply to the Simple Moving Average", + ) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.mixing-timeframes.mixing-timeframes:[53:59] +==backtrader.samples.pivot-point.ppsample:[46:52] + txt = ",".join( + [ + "%04d" % len(self), + "%04d" % len(self.data0), + "%04d" % len(self.data1), + self.data.datetime.date(0).isoformat(), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[148:155] +==backtrader.samples.multi-example.mult-values:[291:298] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[140:147] +==backtrader.samples.multi-example.mult-values:[299:306] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[132:139] +==backtrader.samples.multi-example.mult-values:[275:282] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[124:131] +==backtrader.samples.multi-example.mult-values:[283:290] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[77:92] +==backtrader.samples.talib.talibtest:[186:202] + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lineplotter.lineplotter:[105:112] +==backtrader.samples.order-close.close-daily:[195:202] + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", + "-t", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.kselrsi.ksignal:[145:152] +==backtrader.samples.observer-benchmark.observer-benchmark:[223:230] + ) + + parser.add_argument( + "--stake", + required=False, + action="store", + type=int, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.kselrsi.ksignal:[136:143] +==backtrader.samples.observer-benchmark.observer-benchmark:[205:212] + ) + + parser.add_argument( + "--cash", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[405:418] +==backtrader.samples.vctest.vctest:[310:323] + ) + + # Live data ... avoid long data accumulation by switching to "exactbars" + cerebro.run(exactbars=args.exactbars) + + if args.plot and args.exactbars < 1: # plot if possible + cerebro.plot() + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[353:359] +==backtrader.samples.vctest.vctest:[261:267] + rekwargs = dict( + timeframe=timeframe, + compression=args.compression, + bar2edge=not args.no_bar2edge, + adjbartime=not args.no_adjbartime, + rightedge=not args.no_rightedge, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[134:140] +==backtrader.samples.rollover.rollover:[63:69] + txt.append("{}".format(self.data.open[0])) + txt.append("{}".format(self.data.high[0])) + txt.append("{}".format(self.data.low[0])) + txt.append("{}".format(self.data.close[0])) + txt.append("{}".format(self.data.volume[0])) + txt.append("{}".format(self.data.openinterest[0])) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[260:266] +==backtrader.samples.rollover.rollover:[45:51] + "Open", + "High", + "Low", + "Close", + "Volume", + "OpenInterest", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[242:252] +==backtrader.samples.oandatest.oandatest:[218:228] + elif self.order is not None and self.p.cancel: + if self.datastatus > self.p.cancel: + self.cancel(self.order) + + if self.datastatus: + self.datastatus += 1 + + def start(self): + """ """ + if self.data0.contractdetails is not None: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-pandas.data_ploars_optix:[44:51] +==backtrader.tests.test_data_pandas:[56:72] + lines = ( + "optix_close", + "optix_pess", + "optix_opt", + ) + params = (("optix_close", -1), ("optix_pess", -1), ("optix_opt", -1)) + + +def getdata(index, noheaders=True): + """ + + :param index: + :param noheaders: (Default value = True) + + """ + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[75:84] +==backtrader.samples.oandatest.oandatest:[127:133] + txt = list() + txt.append("Data0") + txt.append("%04d" % len(self.data0)) + dtfmt = "%Y-%m-%dT%H:%M:%S.%f" + txt.append("{:f}".format(self.data.datetime[0])) + txt.append("%s" % self.data.datetime.datetime(0).strftime(dtfmt)) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[88:95] +==backtrader.samples.ibtest.ibtest:[141:148] + print(", ".join(txt)) + + if len(self.datas) > 1 and len(self.data1): + txt = list() + txt.append("Data1") + txt.append("%04d" % len(self.data1)) + dtfmt = "%Y-%m-%dT%H:%M:%S.%f" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[188:200] +==backtrader.samples.data-replay.data-replay:[102:114] + cerebro.plot(style="bar") + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser(description="Pandas test script") + + parser.add_argument( + "--dataname", default="", required=False, help="File Data to Load" + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-multitimeframe.data-multitimeframe:[127:137] +==backtrader.samples.data-replay.data-replay:[76:86] + data = btfeeds.BacktraderCSVData(dataname=datapath) + + tframes = dict( + daily=bt.TimeFrame.Days, + weekly=bt.TimeFrame.Weeks, + monthly=bt.TimeFrame.Months, + ) + + # Handy dictionary for the argument timeframe conversion + # Resample the data (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-filler.data-filler:[177:188] +==backtrader.samples.multidata-strategy.multidata-strategy-unaligned:[247:258] + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[145:161] +==backtrader.samples.talib.tablibsartest:[68:84] + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.credit-interest.credit-interest:[173:180] +==backtrader.samples.order-close.close-daily:[194:201] + required=False, + default=None, + help="Starting date in YYYY-MM-DD format", + ) + + parser.add_argument( + "--todate", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[154:161] +==backtrader.samples.cheat-on-open.cheat-on-open:[195:202] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[146:153] +==backtrader.samples.cheat-on-open.cheat-on-open:[203:210] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[138:145] +==backtrader.samples.cheat-on-open.cheat-on-open:[179:186] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[130:137] +==backtrader.samples.cheat-on-open.cheat-on-open:[187:194] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[197:216] +==backtrader.samples.stop-trading.stop-loss-approaches:[201:220] +) + + +def runstrat(args=None): + """ + + :param args: (Default value = None) + + """ + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[222:230] +==backtrader.samples.tradingcalendar.tcal-intra:[165:173] + required=False, + help="Data to read in", + ) + + # Defaults for dates + parser.add_argument( + "--fromdate", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[72:84] +==backtrader.samples.oco.oco:[66:78] + self.holdstart = len(self) + + if not order.alive() and order.ref in self.orefs: + self.orefs.remove(order.ref) + + def __init__(self): + """ """ + ma1, ma2 = self.p.ma(period=self.p.p1), self.p.ma(period=self.p.p2) + self.cross = bt.ind.CrossOver(ma1, ma2) + + self.orefs = list() + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[199:216] +==backtrader.samples.multi-example.mult-values:[217:234] + cerebro.addstrategy(St, **eval("dict(" + args.strat + ")")) + + # Execute + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.oandatest.oandatest:[370:385] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[101:116] + if args.plot is not True: # evals to True but is not True + npkwargs = eval("dict(" + args.plot + ")") # args were passed + pkwargs.update(npkwargs) + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.macd-settings.macd-settings:[370:377] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[165:172] + ) + + parser.add_argument( + "--riskfreerate", + required=False, + action="store", + type=float, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[343:352] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[221:230] + metavar="kwargs", + help="kwargs in key=value format", + ) + + return parser.parse_args(pargs) + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[317:324] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[203:210] + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--strat", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[301:308] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[187:194] + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( + "--broker", + required=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[259:266] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[209:216] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[267:274] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[201:208] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[243:250] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[193:200] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[251:258] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[185:192] + required=False, + default="", + metavar="kwargs", + help="kwargs in key=value format", + ) + + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[158:170] +==backtrader.samples.optimization.optimization:[82:94] + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( + dataname=args.data, fromdate=fromdate, todate=todate + ) + + # Add the Data Feed to Cerebro + cerebro.adddata(data) + + # clock the start of the process (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[292:303] +==backtrader.samples.commission-schemes.commission-schemes:[245:256] + ) + + parser.add_argument("--plot", "-p", action="store_true", help="Plot the read data") + + parser.add_argument("--numfigs", "-n", default=1, help="Plot using numfigs figures") + + return parser.parse_args() + + +if __name__ == "__main__": + runstrategy() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[186:194] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[63:71] + tframes = dict( + days=bt.TimeFrame.Days, + weeks=bt.TimeFrame.Weeks, + months=bt.TimeFrame.Months, + years=bt.TimeFrame.Years, + ) + + # Add the Analyzers (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.contrib.utils.influxdb-import:[98:104] +==backtrader.contrib.utils.iqfeed-to-influxdb:[206:212] + required=False, + action="store", + default=None, + help="InfluxDB hostname.", + ) + parser.add_argument( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[318:326] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[392:398] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[308:318] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[380:391] + entry_std_multiplier=entry_multiplier, + printlog=False, + ) # 关闭日志,减少输出 + + # 设置资金和佣金 + cerebro.broker.setcash(100000) + cerebro.broker.setcommission(commission=0.0003) + cerebro.broker.set_shortcash(False) + + # 添加夏普比率分析器 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[171:177] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[156:162] + self.order = self.sell(data=self.data0, size=10) + self.order = self.buy(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "short_j_long_jm" + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[159:165] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[168:174] + self.order = self.buy(data=self.data0, size=10) + self.order = self.sell(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "long_j_short_jm" + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[171:177] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[156:162] + self.order = self.sell(data=self.data0, size=10) + self.order = self.buy(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "short_j_long_jm" + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[159:165] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[168:174] + self.order = self.buy(data=self.data0, size=10) + self.order = self.sell(data=self.data1, size=14) + self.entry_day = len(self) + self.position_type = "long_j_short_jm" + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.rsi_strategy:[180:189] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[345:355] + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 加载数据一次(这些数据可以重复使用) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[150:156] +==backtrader.turtle.sma:[141:147] + open="open", + high="high", + low="low", + close="close", + volume="volume", + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[62:68] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[141:147] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[49:55] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[127:133] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[160:167] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[384:390] +cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 +) +# cerebro.addanalyzer(bt.analyzers.AnnualReturn) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[75:81] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[141:147] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[62:68] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[127:133] + ): + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[175:184] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[272:282] + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 加载数据一次(这些数据可以重复使用) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[100:106] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[79:85] + self.order = self.buy(data=self.data0, size=10) + self.order = self.sell(data=self.data1, size=14) + self.position_type = "long_j_short_jm" + if self.p.printlog: + print( + f"开仓: 做多J,做空JM, 价差={self.price_diff[0]:.2f}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[89:95] +==backtrader.arbitrage.classic_indicators.rsi_strategy:[68:74] + self.order = self.sell(data=self.data0, size=10) + self.order = self.buy(data=self.data1, size=14) + self.position_type = "short_j_long_jm" + if self.p.printlog: + print( + f"开仓: 做空J,做多JM, 价差={self.price_diff[0]:.2f}," (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[172:181] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[305:314] + cerebro.broker.set_shortcash(False) + + # 加载数据 + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[303:309] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[377:383] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.Kalman:[274:282] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[410:417] + drawdown = results[0].analyzers.drawdown.get_analysis() + sharpe = results[0].analyzers.sharperatio.get_analysis() + roi = results[0].analyzers.roianalyzer.get_analysis() + total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 + cagr = results[0].analyzers.cagranalyzer.get_analysis() + # # 打印分析结果 + print("=============回测结果================") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[32:44] +==backtrader.arbitrage.test_feedspread_yearly:[100:114] + self.year_values = {} + + def next(self): + """ """ + # Skip if there is an outstanding order + if self.order: + return + + # Get current spread + spread = self.data2.close[0] + upper = self.boll.lines.top[0] + lower = self.boll.lines.bot[0] + + # Trading logic (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[172:184] +==backtrader.arbitrage.hold_rb:[75:84] +cerebro.addanalyzer( + bt.analyzers.CAGRAnalyzer, period=bt.TimeFrame.Days +) # 这里的period可以是daily, weekly, monthly等 +# 运行回测 +results = cerebro.run() +# + +# 获取分析结果 +sharpe = results[0].analyzers.sharperatio.get_analysis() +drawdown = results[0].analyzers.drawdown.get_analysis() +# annual_returns = results[0].analyzers.annualreturn.get_analysis() +# total_returns = results[0].analyzers.returns.get_analysis() # 获取总回报率 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[191:197] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[465:471] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 风险无风险利率 + annualize=True, # 年化 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[214:220] +==backtrader.arbitrage.Kalman:[256:262] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, + riskfreerate=0, + annualize=True, + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[190:196] +==backtrader.arbitrage.hold_rb:[60:66] +cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 +) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[359:367] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[439:447] + print(f"夏普比率: {best_result['sharpe']:.4f}") + print(f"最大回撤: {best_result['drawdown']:.2f}%") + print(f"年化收益: {best_result['returns']:.2f}%") + print(f"总收益率: {best_result['roi']:.2f}%") + print(f"总交易次数: {best_result['total_trades']}") + print(f"胜率: {best_result['win_rate']:.2f}%") + + # 绘制热力图 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[319:326] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[349:356] + ) + + try: + result = run_strategy( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[222:228] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[248:254] +cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Calculate based on daily data + riskfreerate=0, # Default annualized 1% risk-free rate + annualize=True, # Do not annualize +) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[274:285] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[322:333] + df0 = pd.read_hdf(output_file, key="/J").reset_index() + df1 = pd.read_hdf(output_file, key="/JM").reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + fromdate = datetime.datetime(2018, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 定义参数网格 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[321:327] +==backtrader.arbitrage.JM_J_strategy_RSI_MACD_GridSearch:[313:319] + param_combinations.append( + ( + data0, + data1, + data2, + rsi_period, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[352:362] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[519:529] + backtest_data.to_csv(filename, index=False) + print(f"回测数据已保存至: {filename}") + + # 绘制结果 + if args.plot: + cerebro.plot(volume=False, spread=True) + + +if __name__ == "__main__": + main() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[311:317] +==backtrader.arbitrage.classic_indicators.bollingband:[127:133] + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, + ) + data1 = bt.feeds.PandasData( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[328:334] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[365:371] + param_combinations.append( + ( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[399:407] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[398:406] + print(f"夏普比率: {best_result['sharpe']:.4f}") + print(f"最大回撤: {best_result['drawdown']:.2f}%") + print(f"年化收益: {best_result['returns']:.2f}%") + print(f"总收益率: {best_result['roi']:.2f}%") + print(f"总交易次数: {best_result['total_trades']}") + print(f"胜率: {best_result['win_rate']:.2f}%") + + # 显示所有结果,按夏普比率排序 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[359:366] +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[356:363] + ) + + try: + result = run_strategy( + data0, + data1, + data2, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[201:207] +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[303:309] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # 按日数据计算 + riskfreerate=0, # 默认年化1%的风险无风险利率 + annualize=True, # 不进行年化 + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[396:402] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[286:292] + param_combinations.append( + ( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[177:186] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[143:154] + sigma = np.std(hist, ddof=1) + + if np.isnan(sigma) or sigma == 0: + return + + kappa = self.p.k_coeff * sigma + h = self.p.h_coeff * sigma + + s_t = self.spread_series[0] + + ########### Key modification: Use corrected spread ########### (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[408:414] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[499:505] + for i, result in enumerate(sorted_results[:10]): # 只显示前10个最好的结果 + print( + f"{i + 1}. spread_window={result['params']['spread_window']}, " + f"win={result['params']['win']}, " + f"k_coeff={result['params']['k_coeff']:.2f}, " + f"h_coeff={result['params']['h_coeff']:.2f}, " (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[330:336] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[417:423] + data0, + data1, + data2, + win, + k_coeff, + h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[347:353] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[398:404] + data0, + data1, + data2, + win, + k_coeff, + h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[210:220] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[282:292] + cerebro.addanalyzer(bt.analyzers.TradeAnalyzer) + + # Run backtest + results = cerebro.run() + + # Get analysis results + strat = results[0] + sharpe = strat.analyzers.sharperatio.get_analysis().get("sharperatio", 0) + drawdown = strat.analyzers.drawdown.get_analysis().get("max", {}).get("drawdown", 0) + returns = strat.analyzers.returns.get_analysis().get("rnorm100", 0) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[88:96] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[102:108] + if short: # Short spread + self.sell(data=self.data0, size=self.size0) + self.buy(data=self.data1, size=self.size1) + else: # Long spread + self.buy(data=self.data0, size=self.size0) + self.sell(data=self.data1, size=self.size1) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[352:362] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[406:416] + output_file = "/Users/f/Desktop/ricequant/1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key=args.df0_key).reset_index() + df1 = pd.read_hdf(output_file, key=args.df1_key).reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + # 计算滚动价差 + df_spread = calculate_rolling_spread(df0, df1, window=args.window) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[109:124] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[135:149] + ) + + def __init__(self): + # Save two cumulative sums + self.g_pos, self.g_neg = 0.0, 0.0 # CUSUM state + # Convenient access to recent win spread series + self.spread_series = self.data2.close + + # Save daily return data + self.record_dates = [] + self.record_data = [] + self.prev_portfolio_value = self.broker.getvalue() + + # Add minimum cash tracking (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[107:116] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[249:260] + sigma = np.std(hist, ddof=1) + + if np.isnan(sigma) or sigma == 0: + return + + kappa = self.p.k_coeff * sigma + h = self.p.h_coeff * sigma + + s_t = self.spread_series[0] + + # Use corrected spread (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[402:408] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[274:280] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Use daily data + riskfreerate=0, # Default risk-free rate + annualize=True, # Do not annualize + ) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.filters.datafiller:[64:74] +==backtrader.backtrader.filters.datafilter:[51:61] + if len(self.p.dataname) == self.p.dataname.buflen(): + # if data is not preloaded .... do it + self.p.dataname.start() + self.p.dataname.preload() + self.p.dataname.home() + + # Copy timeframe from data after start (some sources do autodetection) + self.p.timeframe = self._timeframe = self.p.dataname._timeframe + self.p.compression = self._compression = self.p.dataname._compression + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.filters.daysteps:[93:103] +==backtrader.samples.pinkfish-challenge.pinkfish-challenge:[103:112] + if self.pendingbar is not None: + data.backwards() # remove delivered open bar + data._add2stack(self.pendingbar) # add remaining + self.pendingbar = None # No further action + return True # something delivered + + return False # nothing delivered here + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[1574:1591] +==backtrader.backtrader.stores.ibstores.ib:[2689:2695] + numberOfTicks, + whatToShow, + useRth, + ignoreSize, + miscOptions, + ) + + def reqTickByTickData(self, reqId, contract, tickType, numberOfTicks, ignoreSize): + """ + + :param reqId: + :param contract: + :param tickType: + :param numberOfTicks: + :param ignoreSize: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[1362:1375] +==backtrader.backtrader.stores.ibstores.ib:[2916:2922] + reqId, + underlyingSymbol, + futFopExchange, + underlyingSecType, + underlyingConId, + ) + + def reqSoftDollarTiers(self, reqId): + """ + + :param reqId: + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.client:[311:317] +==backtrader.backtrader.stores.ibstores.decoder:[588:594] + c.conId, + c.symbol, + c.secType, + c.lastTradeDateOrContractMonth, + c.strike, + c.right, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.oandastore:[219:246] +==backtrader.backtrader.stores.vcstore:[214:241] +class MetaSingleton(MetaParams): + """Metaclass to make a metaclassed class a singleton""" + + def __init__(cls, name, bases, dct): + """ + + :param name: + :param bases: + :param dct: + + """ + super(MetaSingleton, cls).__init__(name, bases, dct) + cls._singleton = None + + def __call__(cls, *args, **kwargs): + """ + + :param *args: + :param **kwargs: + + """ + if cls._singleton is None: + cls._singleton = super(MetaSingleton, cls).__call__(*args, **kwargs) + + return cls._singleton + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.observers.logreturns:[40:49] +==backtrader.backtrader.observers.timereturn:[41:51] + params = ( + ("timeframe", None), + ("compression", None), + ("fund", None), + ) + + def _plotlabel(self): + """ """ + return [ + # Use the final tf/comp values calculated by the return analyzer (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.vcdata:[589:621] +==backtrader.backtrader.stores.vcstore:[202:214] + if p1 != 1: # Apparently "Connection Event" + return + + if p2 == self.lastconn: + return # do not notify twice + + self.lastconn = p2 # keep new notification code + + # p2 should be 0 (disconn), 1 (conn) + self.store._vcrt_connection(self.store._RT_BASEMSG - p2) + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.quandl:[128:134] +==backtrader.backtrader.feeds.yahoo:[171:178] + if self.p.round: + decimals = self.p.decimals + o = round(o, decimals) + h = round(h, decimals) + l = round(l, decimals) + c = round(c, decimals) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.vcbroker:[561:572] +==backtrader.tests.test_order:[109:118] + closedvalue = comminfo.getoperationcost(closed, pprice_orig) + closedcomm = comminfo.getcommission(closed, price) + + openedvalue = comminfo.getoperationcost(opened, price) + openedcomm = comminfo.getcommission(opened, price) + + pnl = comminfo.profitandloss(-closed, pprice_orig, price) + margin = comminfo.getvaluesize(size, price) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.logreturnsrolling:[62:79] +==backtrader.backtrader.analyzers.timereturn:[55:73] + if self.p.data is None: + # keep the initial portfolio value if not tracing a data + if not self._fundmode: + self._lastvalue = self.strategy.broker.getvalue() + else: + self._lastvalue = self.strategy.broker.fundvalue + + def notify_fund(self, cash, value, fundvalue, shares): + """ + + :param cash: + :param value: + :param fundvalue: + :param shares: + + """ + if not self._fundmode: + # Record current value (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.store:[33:60] +==backtrader.backtrader.stores.ibstore:[103:137] +class MetaSingleton(MetaParams): + """Metaclass to make a metaclassed class a singleton""" + + def __init__(cls, name, bases, dct): + """ + + :param name: + :param bases: + :param dct: + + """ + super(MetaSingleton, cls).__init__(name, bases, dct) + cls._singleton = None + + def __call__(cls, *args, **kwargs): + """ + + :param *args: + :param **kwargs: + + """ + if cls._singleton is None: + cls._singleton = super(MetaSingleton, cls).__call__(*args, **kwargs) + + return cls._singleton + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.errors:[16:33] +==backtrader.xtquant.xtbson.bson37.errors:[16:33] +class BSONError(Exception): + """Base class for all BSON exceptions.""" + + +class InvalidBSON(BSONError): + """ """ + + +class InvalidStringData(BSONError): + """ """ + + +class InvalidDocument(BSONError): + """ """ + + +class InvalidId(BSONError): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.codec_options:[367:372] +==backtrader.xtquant.xtbson.bson37.codec_options:[472:477] + tz_aware, + uuid_representation, + unicode_decode_error_handler, + tzinfo, + type_registry, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtbson.bson36.binary:[19:58] +==backtrader.xtquant.xtbson.bson37.binary:[20:58] +BINARY_SUBTYPE = 0 +"""BSON binary subtype for binary data. + +This is the default subtype for binary data. +""" + +FUNCTION_SUBTYPE = 1 +"""BSON binary subtype for functions. +""" + +OLD_BINARY_SUBTYPE = 2 +"""Old BSON binary subtype for binary data. + +This is the old default subtype, the current +default is :data:`BINARY_SUBTYPE`. +""" + +OLD_UUID_SUBTYPE = 3 +"""Old BSON binary subtype for a UUID. + +:class:`uuid.UUID` instances will automatically be encoded +by :mod:`bson` using this subtype when using +:data:`UuidRepresentation.PYTHON_LEGACY`, +:data:`UuidRepresentation.JAVA_LEGACY`, or +:data:`UuidRepresentation.CSHARP_LEGACY`. + +.. versionadded:: 2.1 +""" + +UUID_SUBTYPE = 4 +"""BSON binary subtype for a UUID. + +This is the standard BSON binary subtype for UUIDs. +:class:`uuid.UUID` instances will automatically be encoded +by :mod:`bson` using this subtype when using +:data:`UuidRepresentation.STANDARD`. +""" + + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.qmttools.functions:[996:1001] +==backtrader.xtquant.xtdata:[3607:3612] + "period": period, + "starttime": start_time, + "endtime": end_time, + "count": count, + "dividendtype": dividend_type, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtdata:[133:140] +==backtrader.xtquant.xtview:[44:51] + if not __client or not __client.is_connected(): + raise Exception("无法连接xtquant服务,请检查QMT-投研版或QMT-极简版是否开启") + + if remember_if_success: + global __client_last_spec + __client_last_spec = (ip, port) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.xtquant.xtdata:[96:102] +==backtrader.xtquant.xtview:[20:29] + if __client: + if __client.is_connected(): + return __client + + __client.shutdown() + __client = None (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_pandas:[109:114] +==backtrader.tests.test_data_resample:[50:55] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, + runonce=runonce, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_replay:[53:58] +==backtrader.tests.test_ind_oscillator:[57:62] + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_replay:[49:54] +==backtrader.tests.test_data_resample:[49:54] + datas = [data] + testcommon.runtest( + datas, + testcommon.TestStrategy, + main=main, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_data_multiframe:[48:53] +==backtrader.tests.test_ind_envelope:[61:66] + main=main, + plot=main, + chkind=chkind, + chkmin=chkmin, + chkvals=chkvals, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-sqn:[194:199] +==backtrader.tests.test_analyzer-timereturn:[181:186] + cerebros = testcommon.runtest( + datas, + BtTestStrategy, + printdata=main, + stocklike=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_pickle_datatrades:[8:15] +==backtrader.tests.test_strategy_unoptimized:[97:104] +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), + ("printdata", True), + ("printops", True), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_analyzer-timereturn:[40:47] +==backtrader.tests.test_multidata_optimize:[6:13] +class BtTestStrategy(bt.Strategy): + """ """ + + params = ( + ("period", 15), + ("printdata", True), + ("printops", True), (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.tests.test_bbroker_try_exec_limit:[121:129] +==backtrader.tests.test_math_function_scalar:[87:95] + self.log("-------------------------") + else: + pass + + def next(self): + """ """ + if self.p.printdata: + self.log( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.tradingcalendar.tcal-intra:[116:123] +==backtrader.samples.tradingcalendar.tcal:[110:116] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.timers.scheduled-min:[63:68] +==backtrader.samples.timers.scheduled:[49:54] + self.add_timer( + when=self.p.when, + offset=self.p.offset, + repeat=self.p.repeat, + weekdays=self.p.weekdays, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.pyfolio2.pyfoliotest:[189:194] +==backtrader.samples.pyfoliotest.pyfoliotest:[142:147] + pf.create_full_tear_sheet( + returns, + positions=positions, + transactions=transactions, + gross_lev=gross_lev, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.psar.psar-intraday:[68:76] +==backtrader.samples.timers.scheduled-min:[136:143] + args = parse_args(args) + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict( + timeframe=bt.TimeFrame.Minutes, + compression=5, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observers.observers-default-drawdown:[87:95] +==backtrader.samples.observers.observers-orderobserver:[134:142] + cerebro.addstrategy(MyStrategy) + cerebro.run() + + cerebro.plot() + + +if __name__ == "__main__": + runstrat() (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observers.observers-default-drawdown:[67:73] +==backtrader.samples.observers.observers-orderobserver:[113:119] + if self.position: + if self.buysell < 0: + self.log("SELL CREATE, %.2f" % self.data.close[0]) + self.sell() + + elif self.buysell > 0: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.observer-benchmark.observer-benchmark:[147:162] +==backtrader.samples.pyfolio2.pyfoliotest:[199:214] + if args.plot is not True: # evals to True but is not True + pkwargs = eval("dict(" + args.plot + ")") # args were passed + + cerebro.plot(**pkwargs) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.multi-example.mult-values:[190:197] +==backtrader.samples.timers.scheduled:[137:144] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.lrsi.lrsi-test:[83:97] +==backtrader.samples.stop-trading.stop-loss-approaches:[238:252] + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[242:251] +==backtrader.samples.vctest.vctest:[177:186] + elif self.order is not None and self.p.cancel: + if self.datastatus > self.p.cancel: + self.cancel(self.order) + + if self.datastatus: + self.datastatus += 1 + + def start(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.ibtest.ibtest:[344:349] +==backtrader.samples.oandatest.oandatest:[307:312] + data1 = None + if args.data1 is not None: + if args.data1 != args.data0: + datakwargs["timeframe"] = datatf1 + datakwargs["compression"] = datacomp1 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.data-filler.data-filler:[85:98] +==backtrader.samples.relative-volume.relative-volume:[69:82] + if args.writer: + cerebro.addwriter(bt.WriterFile, csv=args.wrcsv) + + # And run it + cerebro.run(stdstats=False) + + # Plot if requested + if args.plot: + cerebro.plot(numfigs=args.numfigs, volume=True) + + +def parse_args(): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.cheat-on-open.cheat-on-open:[138:152] +==backtrader.samples.order-history.order-history:[185:199] + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.calmar.calmar-test:[64:71] +==backtrader.samples.timers.scheduled-min:[148:155] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + + # Data feed (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[99:106] +==backtrader.samples.oco.oco:[97:104] + valid1 = datetime.timedelta(self.p.limdays) + valid2 = valid3 = datetime.timedelta(self.p.limdays2) + + if self.p.switchp1p2: + p1, p2 = p2, p1 + valid1, valid2 = valid2, valid1 + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bracket.bracket:[202:216] +==backtrader.samples.btfd.btfd:[240:254] + cerebro.run(**eval("dict(" + args.cerebro + ")")) + + if args.plot: # Plot if requested to + cerebro.plot(**eval("dict(" + args.plot + ")")) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.bidask-to-ohlc.bidask-to-ohlc:[81:90] +==backtrader.samples.volumefilling.volumefilling:[137:146] + cerebro.run() + if args.plot: + cerebro.plot(style="bar") + + +def parse_args(): + """ """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[85:91] +==backtrader.samples.psar.psar-intraday:[79:86] + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): + if a: + strpfmt = dtfmt + tmfmt * ("T" in a) + kwargs[d] = datetime.datetime.strptime(a, strpfmt) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.daysteps.daysteps:[94:107] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[124:139] + cerebro.run(**(eval("dict(" + args.cerebro + ")"))) + if args.plot: + cerebro.plot(**(eval("dict(" + args.plot + ")"))) + + +def parse_args(pargs=None): + """ + + :param pargs: (Default value = None) + + """ + parser = argparse.ArgumentParser( + formatter_class=argparse.ArgumentDefaultsHelpFormatter, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.btfd.btfd:[206:216] +==backtrader.samples.gold-vs-sp500.gold-vs-sp500:[77:87] + args = parse_args(args) + + cerebro = bt.Cerebro() + + # Data feed kwargs + kwargs = dict() + + # Parse from/to-date + dtfmt, tmfmt = "%Y-%m-%d", "T%H:%M:%S" + for a, d in ((getattr(args, x), x) for x in ["fromdate", "todate"]): (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[152:163] +==backtrader.samples.relative-volume.relative-volume:[38:49] + args = parse_args() + + # Create a cerebro + cerebro = bt.Cerebro() + + # Get the dates from the args + fromdate = datetime.datetime.strptime(args.fromdate, "%Y-%m-%d") + todate = datetime.datetime.strptime(args.todate, "%Y-%m-%d") + + # Create the 1st data + data = btfeeds.BacktraderCSVData( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.samples.analyzer-annualreturn.analyzer-annualreturn:[54:59] +==backtrader.samples.multitrades.multitrades:[47:52] + params = dict( + period=15, + stake=1, + printout=False, + onlylong=False, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[36:45] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness_grid:[41:51] + self.returns_j = [] + self.returns_jm = [] + + # 初始化交易相关变量 + self.order = None + self.position_type = None + self.entry_day = 0 + + # 存储历史价格数据 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[269:276] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[276:283] + plt.legend() + plt.grid(True) + + # 绘制价格 + plt.subplot(3, 1, 3) + plt.plot( + dates, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[241:248] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[235:242] + plt.legend() + plt.grid(True) + + # 绘制偏度差值 + plt.subplot(3, 1, 2) + plt.plot( + dates, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[36:45] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_skewness:[40:50] + self.returns_j = [] + self.returns_jm = [] + + # 初始化交易相关变量 + self.order = None + self.position_type = None + self.entry_day = 0 + + def next(self): + """ """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[308:314] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[272:280] + fromdate = datetime.datetime(2017, 1, 1) + todate = datetime.datetime(2025, 1, 1) + + # 加载数据一次(这些数据可以重复使用) + data0, data1 = load_data("/J", "/JM", fromdate, todate) + + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[63:68] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[146:151] + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[50:55] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe_grid:[134:139] + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[312:320] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[364:370] + if data0 is None or data1 is None: + print("无法加载数据,请检查文件路径和数据格式") + return None + + cerebro.adddata(data0, name="J") + cerebro.adddata(data1, name="JM") + + # 添加策略 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[273:278] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy:[208:213] + sns.heatmap( + heatmap_data, + annot=True, + fmt=".2f", + cmap="RdYlGn", (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[188:196] +==backtrader.arbitrage.test.hold_rb:[138:145] +print("=============回测结果================") +print(f"\n夏普比率: {sharpe['sharperatio']:.2f}") +print(f"最大回撤: {drawdown['max']['drawdown']:.2f} %") +# print(f"总回报率: {total_returns['rnorm100']:.2f}%") # 打印总回报率 +print(f"年化收益: {cagr['cagr']:.2f} %") +print(f"sharpe: {cagr['sharpe']:.2f} ") + +# # 绘制结果 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[76:81] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[146:151] + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.atr_strategy:[63:68] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy_sharpe:[134:139] + self.close(data=self.data0) + self.close(data=self.data1) + self.position_type = None + if self.p.printlog: + print( (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.Kalman:[222:227] +==backtrader.arbitrage.classic_indicators.bollingband:[140:145] + dataname=df_spread, + datetime="date", + nocase=True, + fromdate=fromdate, + todate=todate, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.classic_indicators.bollingband:[148:157] +==backtrader.arbitrage.test_feedspread_yearly:[263:272] +cerebro = bt.Cerebro() +cerebro.adddata(data0, name="I") +cerebro.adddata(data1, name="RB") +cerebro.adddata(data2, name="spread") + +# 添加策略 +cerebro.addstrategy(SpreadBollingerStrategy) +########################################################################## +# 设置初始资金 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.test:[18:25] +==backtrader.arbitrage.test_feedspread_yearly:[23:32] + if date_column in df1.columns: + df1 = df1.set_index(date_column) + if date_column in df2.columns: + df2 = df2.set_index(date_column) + + # Find common dates + common_dates = df1.index.intersection(df2.index) + + # Check for missing dates (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[136:143] +==backtrader.arbitrage.different_arbitrage_indicators.JM_J_strategy:[41:48] + spread = self.data2.close[0] + mid = self.boll.lines.mid[0] + pos = self.getposition(self.data0).size + + # Open/close position logic + if pos == 0: + if spread > self.boll.lines.top[0]: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[321:329] +==backtrader.arbitrage.JM_J_strategy_adjust_pair_ratio:[47:56] +output_file = "D:\\FutureData\\ricequant\\1d_2017to2024_noadjust.h5" +df0 = pd.read_hdf(output_file, key="/J").reset_index() +df1 = pd.read_hdf(output_file, key="/JM").reset_index() + +# Ensure date column format is correct +df0["date"] = pd.to_datetime(df0["date"]) +df1["date"] = pd.to_datetime(df1["date"]) + +# Calculate rolling spread (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[367:372] +==backtrader.arbitrage.JM_J_strategy_ZScore_GridSearch:[450:455] + print("\n========= 所有参数组合结果(按夏普比率排序)=========") + for i, result in enumerate(sorted_results[:10]): # 只显示前10个最好的结果 + print( + f"{i + 1}. spread_window={result['params']['spread_window']}, " + f"win={result['params']['win']}, " (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_RSI_Bollinger_GridSearch:[273:281] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[111:120] + output_file = "/Users/f/Desktop/ricequant/1d_2017to2024_noadjust.h5" + df0 = pd.read_hdf(output_file, key="/J").reset_index() + df1 = pd.read_hdf(output_file, key="/JM").reset_index() + + # 确保日期列格式正确 + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[334:339] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile:[492:499] + print("=============回测结果================") + print(f"\nSharpe Ratio: {sharpe.get('sharperatio', 0):.2f}") + print(f"Drawdown: {drawdown.get('max', {}).get('drawdown', 0):.2f} %") + print(f"Annualized/Normalized return: {total_returns.get('rnorm100', 0):.2f}%") + print(f"Total compound return: {roi.get('roi100', 0):.2f}%") + + # 交易统计信息 (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[229:234] +==backtrader.arbitrage.classic_indicators.JM_J_strategy_Quantile_GridSearch:[325:330] + return { + "sharpe": sharpe, + "drawdown": drawdown, + "returns": returns, + "roi": roi, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[435:440] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[322:327] + result = run_strategy( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[416:421] +==backtrader.arbitrage.JM_J_strategy_RSI_GridSearch:[305:310] + for i, ( + data0, + data1, + data2, + win, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[362:369] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[435:442] + result = run_strategy( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[346:353] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[416:423] + for i, ( + data0, + data1, + data2, + win, + k_coeff, + h_coeff, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.CUSUM_GridSearch_CLI:[221:229] +==backtrader.arbitrage.JM_J_strategy_CUSUM_GridSearch:[292:301] + trades = strat.analyzers.tradeanalyzer.get_analysis() + + # Get trade statistics + total_trades = trades.get("total", {}).get("total", 0) + win_trades = trades.get("won", {}).get("total", 0) + loss_trades = trades.get("lost", {}).get("total", 0) + win_rate = win_trades / total_trades * 100 if total_trades > 0 else 0 + + # Get strategy custom statistics (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM:[402:407] +==backtrader.arbitrage.classic_indicators.hurst_bollinger_strategy:[329:334] + cerebro.addanalyzer( + bt.analyzers.SharpeRatio, + timeframe=bt.TimeFrame.Days, # Use daily data + riskfreerate=0, # Default risk-free rate + annualize=True, # Do not annualize (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.arbitrage.JM_J_strategy_CUSUM copy:[248:257] +==backtrader.arbitrage.JM_J_strategy_CUSUM:[353:362] + df0 = pd.read_hdf(output_file, key=args.df0_key).reset_index() + df1 = pd.read_hdf(output_file, key=args.df1_key).reset_index() + + # Ensure date column format is correct + df0["date"] = pd.to_datetime(df0["date"]) + df1["date"] = pd.to_datetime(df1["date"]) + + # Calculate rolling spread + df_spread = calculate_rolling_spread(df0, df1, window=args.window) (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.sizers.fixedsize:[70:97] +==backtrader.samples.sizertest.sizertest:[77:102] +class FixedReverser(bt.Sizer): + """ """ + + params = (("stake", 1),) + + def _getsizing(self, comminfo, cash, data, isbuy): + """ + + :param comminfo: + :param cash: + :param data: + :param isbuy: + + """ + position = self.strategy.getposition(data) + size = self.p.stake * (1 + (position.size != 0)) + return size + + +def runstrat(args=None): + """ + + :param args: (Default value = None) + + """ (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.btrun.btrun:[1023:1028] +==backtrader.samples.sharpe-timereturn.sharpe-timereturn:[213:218] + help=( + "Plot the read data applying any kwargs passed\n" + "\n" + "For example:\n" + "\n" (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.stores.ibstores.decoder:[286:291] +==backtrader.backtrader.stores.ibstores.wrapper:[580:585] + marketPrice, + marketValue, + averageCost, + unrealizedPNL, + realizedPNL, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.blaze:[86:97] +==backtrader.backtrader.feeds.pandafeed:[90:103] + colidx = getattr(self.params, datafield) + + if colidx < 0: + # column not present -- skip + continue + + # get the line to be set + line = getattr(self.lines, datafield) + line[0] = row[colidx] + + # datetime - assumed blaze always serves a native datetime.datetime (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.vchartfile:[149:154] +==backtrader.backtrader.feeds.yahoo:[180:185] + self.lines.open[0] = o + self.lines.high[0] = h + self.lines.low[0] = l + self.lines.close[0] = c + self.lines.volume[0] = v (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.vchart:[93:103] +==backtrader.backtrader.feeds.vchartfile:[106:115] + if self.f is not None: + self.f.close() + self.f = None + + def _load(self): + """ """ + if self.f is None: + return False # cannot load more + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.quandl:[110:117] +==backtrader.backtrader.feeds.yahoo:[134:141] + i = itertools.count(0) + + dttxt = linetokens[next(i)] # YYYY-MM-DD + dt = date(int(dttxt[0:4]), int(dttxt[5:7]), int(dttxt[8:10])) + dtnum = date2num(datetime.combine(dt, self.p.sessionend)) + + self.lines.datetime[0] = dtnum (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.quandl:[136:142] +==backtrader.backtrader.feeds.vchart:[124:129] + self.lines.open[0] = o + self.lines.high[0] = h + self.lines.low[0] = l + self.lines.close[0] = c + self.lines.volume[0] = v + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.feeds.ibdata:[216:222] +==backtrader.backtrader.utils.dateintern:[69:75] + if tzs == "CST": # reported by TWS, not compatible with pytz. patch it + tzs = "CST6CDT" + + try: + tz = pytz.timezone(tzs) + except pytz.UnknownTimeZoneError: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[772:781] +==backtrader.backtrader.brokers.vcbroker:[431:440] + order = SellOrder( + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[772:785] +==backtrader.backtrader.brokers.oandabroker:[532:545] + order = SellOrder( + owner=owner, + data=data, + size=size, + price=price, + pricelimit=plimit, + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, + parent=parent, + transmit=transmit, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1206:1212] +==backtrader.backtrader.brokers.ibbroker:[1128:1134] + if not doslip: + return price + + slip_perc = self.p.slip_perc + slip_fixed = self.p.slip_fixed + if slip_perc: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[1175:1181] +==backtrader.backtrader.brokers.ibbroker:[1159:1165] + if not doslip: + return price + + slip_perc = self.p.slip_perc + slip_fixed = self.p.slip_fixed + if slip_perc: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[355:363] +==backtrader.backtrader.brokers.ibbroker:[425:432] + if datas is None: + if mkt: + return self._valuemkt if not lever else self._valuemktlever + + return self._value if not lever else self._valuelever + + return self._get_value(datas=datas, lever=lever) + (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.calmar:[66:72] +==backtrader.backtrader.analyzers.returns:[68:74] + if self.p.fund is None: + self._fundmode = self.strategy.broker.fundmode + else: + self._fundmode = self.p.fund + + if not self._fundmode: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.analyzers.roi:[24:31] +==backtrader.backtrader.analyzers.vwr:[87:93] + if self.p.fund is None: + self._fundmode = self.strategy.broker.fundmode + else: + self._fundmode = self.p.fund + + if not self._fundmode: (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[778:783] +==backtrader.backtrader.strategy:[1410:1415] + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.bbroker:[717:722] +==backtrader.backtrader.strategy:[1295:1300] + exectype=exectype, + valid=valid, + tradeid=tradeid, + trailamount=trailamount, + trailpercent=trailpercent, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.brokers.ibbroker:[1528:1533] +==backtrader.backtrader.order:[276:281] + closedvalue, + closedcomm, + opened, + openedvalue, + openedcomm, (duplicate-code) +try.py:1:0: R0801: Similar lines in 2 files +==backtrader.backtrader.lineseries:[236:241] +==backtrader.backtrader.metabase:[227:232] + setattr( + newcls, + "__reduce__", + lambda x: ( + cls._derive_inst, (duplicate-code) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.dataseries -> backtrader.backtrader.lineseries -> backtrader.backtrader.lineiterator) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader -> backtrader.backtrader.feeds -> backtrader.backtrader.feeds.vchartcsv) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.feeds -> backtrader.backtrader.feeds.sierrachart) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader -> backtrader.backtrader.analyzer) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.lineiterator -> backtrader.backtrader.lineseries) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.linebuffer -> backtrader.backtrader.lineiterator) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader -> backtrader.backtrader.cerebro -> backtrader.backtrader.plot.plot) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.dataseries -> backtrader.backtrader.lineseries -> backtrader.backtrader.linebuffer -> backtrader.backtrader.lineiterator) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader -> backtrader.backtrader.feeds -> backtrader.backtrader.feeds.csvgeneric) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.feeds -> backtrader.backtrader.feeds.mt4csv) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.indicators -> backtrader.backtrader.indicators.dv2) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.backtrader.stores.ibstores.objects -> backtrader.backtrader.stores.ibstores.util) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.metatable -> backtrader.xtquant.metatable.get_arrow -> backtrader.xtquant.metatable.meta_config -> backtrader.xtquant.xtdata) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.metatable -> backtrader.xtquant.metatable.get_arrow -> backtrader.xtquant.metatable.get_bson -> backtrader.xtquant.xtdata) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson36 -> backtrader.xtquant.xtbson.bson36.codec_options) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson36 -> backtrader.xtquant.xtbson.bson36.raw_bson) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson36 -> backtrader.xtquant.xtbson.bson36.raw_bson -> backtrader.xtquant.xtbson.bson36.codec_options) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson37 -> backtrader.xtquant.xtbson.bson37.codec_options) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson37 -> backtrader.xtquant.xtbson.bson37.raw_bson) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson37 -> backtrader.xtquant.xtbson.bson37.raw_bson -> backtrader.xtquant.xtbson.bson37.codec_options) (cyclic-import) +try.py:1:0: R0401: Cyclic import (backtrader.xtquant.xtbson.bson37 -> backtrader.xtquant.xtbson.bson37.datetime_ms -> backtrader.xtquant.xtbson.bson37.codec_options) (cyclic-import) + +------------------------------------------------------------------ +Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00) + diff --git a/pyproject.toml b/pyproject.toml index 044895499..59200237a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "backtrader" -version = "0.1.0" +version = "2.0.0" description = "" authors = ["bois1616 "] readme = "README.md" [tool.poetry.dependencies] -python = "^3.12" +python = ">=3.12,<3.14" statsmodels = "^0.14.3" matplotlib = "^3.9.2" requests = "^2.32.3" @@ -20,15 +20,11 @@ icecream = "^2.1.3" loguru = "^0.7.2" pandas = "^2.2.3" numpy = "^2.1.3" +pytest = "^8.2.0" +black = "^24.4.2" +isort = "^5.13.2" +mypy = "^1.10.0" - - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - - -# optional-dependencies [tool.poetry.extras] dev = [ "pytest", @@ -36,3 +32,7 @@ dev = [ "isort", "mypy", ] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/qmtbt/README.md b/qmtbt/README.md new file mode 100644 index 000000000..a8d90de28 --- /dev/null +++ b/qmtbt/README.md @@ -0,0 +1,38 @@ +# qmtbt + +Directory containing qmtbt related files. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### __init__.py + +Python module + +### qmtbroker.py + + + +### qmtfeed.py + + + +### qmtstore.py + +Metaclass to make a metaclassed class a singleton + +### test.py + + + + +## Directory Summary + +This directory contains 5 files and 0 subdirectories. + +### File Types + +* .py: 5 files diff --git a/reference/README.md b/reference/README.md new file mode 100644 index 000000000..bb203269e --- /dev/null +++ b/reference/README.md @@ -0,0 +1,22 @@ +# reference + +Directory containing reference related files. Primarily contains Documentation code and includes documentation. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### notes20250503.txt + +Documentation file + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .txt: 1 files diff --git a/samples/README.md b/samples/README.md new file mode 100644 index 000000000..d77d2eaf1 --- /dev/null +++ b/samples/README.md @@ -0,0 +1,84 @@ +# samples + +Contains sample code and examples. Contains various files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [analyzer-annualreturn](analyzer-annualreturn/README.md) - Directory containing analyzer-annualreturn related files +* [bidask-to-ohlc](bidask-to-ohlc/README.md) - Directory containing bidask-to-ohlc related files +* [bracket](bracket/README.md) - Directory containing bracket related files +* [btfd](btfd/README.md) - Directory containing btfd related files +* [calendar-days](calendar-days/README.md) - Directory containing calendar-days related files +* [calmar](calmar/README.md) - Directory containing calmar related files +* [cheat-on-open](cheat-on-open/README.md) - Directory containing cheat-on-open related files +* [commission-schemes](commission-schemes/README.md) - Directory containing commission-schemes related files +* [credit-interest](credit-interest/README.md) - Directory containing credit-interest related files +* [data-bid-ask](data-bid-ask/README.md) - Contains data files +* [data-filler](data-filler/README.md) - Contains data files +* [data-multitimeframe](data-multitimeframe/README.md) - Contains data files +* [data-pandas](data-pandas/README.md) - Contains data files +* [data-replay](data-replay/README.md) - Contains data files +* [data-resample](data-resample/README.md) - Contains data files +* [daysteps](daysteps/README.md) - Directory containing daysteps related files +* [future-spot](future-spot/README.md) - Directory containing future-spot related files +* [gold-vs-sp500](gold-vs-sp500/README.md) - Directory containing gold-vs-sp500 related files +* [ib-cash-bid-ask](ib-cash-bid-ask/README.md) - Directory containing ib-cash-bid-ask related files +* [ibtest](ibtest/README.md) - Contains test files and test utilities +* [kselrsi](kselrsi/README.md) - Directory containing kselrsi related files +* [lineplotter](lineplotter/README.md) - Contains plotting functionality +* [lrsi](lrsi/README.md) - Directory containing lrsi related files +* [macd-settings](macd-settings/README.md) - Contains continuous deployment configurations +* [memory-savings](memory-savings/README.md) - Directory containing memory-savings related files +* [mixing-timeframes](mixing-timeframes/README.md) - Directory containing mixing-timeframes related files +* [multi-copy](multi-copy/README.md) - Directory containing multi-copy related files +* [multi-example](multi-example/README.md) - Contains example code and usage demonstrations +* [multidata-strategy](multidata-strategy/README.md) - Contains data files +* [multitrades](multitrades/README.md) - Directory containing multitrades related files +* [oandatest](oandatest/README.md) - Contains test files and test utilities +* [observer-benchmark](observer-benchmark/README.md) - Directory containing observer-benchmark related files +* [observers](observers/README.md) - Contains observer implementations +* [oco](oco/README.md) - Directory containing oco related files +* [optimization](optimization/README.md) - Directory containing optimization related files +* [order-close](order-close/README.md) - Directory containing order-close related files +* [order-execution](order-execution/README.md) - Directory containing order-execution related files +* [order-history](order-history/README.md) - Directory containing order-history related files +* [order_target](order_target/README.md) - Directory containing order_target related files +* [partial-plot](partial-plot/README.md) - Contains plotting functionality +* [pinkfish-challenge](pinkfish-challenge/README.md) - Directory containing pinkfish-challenge related files +* [pivot-point](pivot-point/README.md) - Directory containing pivot-point related files +* [plot-same-axis](plot-same-axis/README.md) - Contains plotting functionality +* [psar](psar/README.md) - Directory containing psar related files +* [pyfolio2](pyfolio2/README.md) - Directory containing pyfolio2 related files +* [pyfoliotest](pyfoliotest/README.md) - Contains test files and test utilities +* [relative-volume](relative-volume/README.md) - Directory containing relative-volume related files +* [renko](renko/README.md) - Directory containing renko related files +* [resample-tickdata](resample-tickdata/README.md) - Contains data files +* [rollover](rollover/README.md) - Directory containing rollover related files +* [sharpe-timereturn](sharpe-timereturn/README.md) - Directory containing sharpe-timereturn related files +* [signals-strategy](signals-strategy/README.md) - Directory containing signals-strategy related files +* [sigsmacross](sigsmacross/README.md) - Directory containing sigsmacross related files +* [sizertest](sizertest/README.md) - Contains test files and test utilities +* [slippage](slippage/README.md) - Directory containing slippage related files +* [sratio](sratio/README.md) - Directory containing sratio related files +* [srl_strategies](srl_strategies/README.md) - Contains trading strategy implementations +* [stop-trading](stop-trading/README.md) - Directory containing stop-trading related files +* [stoptrail](stoptrail/README.md) - Directory containing stoptrail related files +* [strategy-selection](strategy-selection/README.md) - Directory containing strategy-selection related files +* [talib](talib/README.md) - Contains library code +* [timers](timers/README.md) - Directory containing timers related files +* [tradingcalendar](tradingcalendar/README.md) - Directory containing tradingcalendar related files +* [vctest](vctest/README.md) - Contains test files and test utilities +* [volumefilling](volumefilling/README.md) - Directory containing volumefilling related files +* [vwr](vwr/README.md) - Directory containing vwr related files +* [weekdays-filler](weekdays-filler/README.md) - Directory containing weekdays-filler related files +* [writer-test](writer-test/README.md) - Contains test files and test utilities +* [yahoo-test](yahoo-test/README.md) - Contains test files and test utilities + +## Directory Summary + +This directory contains 0 files and 69 subdirectories. + diff --git a/samples/analyzer-annualreturn/README.md b/samples/analyzer-annualreturn/README.md new file mode 100644 index 000000000..f157529a4 --- /dev/null +++ b/samples/analyzer-annualreturn/README.md @@ -0,0 +1,22 @@ +# analyzer-annualreturn + +Directory containing analyzer-annualreturn related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### analyzer-annualreturn.py + +This strategy buys/sells upong the close price crossing + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/bidask-to-ohlc/README.md b/samples/bidask-to-ohlc/README.md new file mode 100644 index 000000000..b32378416 --- /dev/null +++ b/samples/bidask-to-ohlc/README.md @@ -0,0 +1,22 @@ +# bidask-to-ohlc + +Directory containing bidask-to-ohlc related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### bidask-to-ohlc.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/bracket/README.md b/samples/bracket/README.md new file mode 100644 index 000000000..0e37ce5f0 --- /dev/null +++ b/samples/bracket/README.md @@ -0,0 +1,22 @@ +# bracket + +Directory containing bracket related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### bracket.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/btfd/README.md b/samples/btfd/README.md new file mode 100644 index 000000000..b54d9f1bc --- /dev/null +++ b/samples/btfd/README.md @@ -0,0 +1,22 @@ +# btfd + +Directory containing btfd related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### btfd.py + +Extension of regular Value observer to add leveraged view + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/calendar-days/README.md b/samples/calendar-days/README.md new file mode 100644 index 000000000..140b1c06d --- /dev/null +++ b/samples/calendar-days/README.md @@ -0,0 +1,22 @@ +# calendar-days + +Directory containing calendar-days related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### calendar-days.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/calmar/README.md b/samples/calmar/README.md new file mode 100644 index 000000000..72754990e --- /dev/null +++ b/samples/calmar/README.md @@ -0,0 +1,22 @@ +# calmar + +Directory containing calmar related files. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### calmar-test.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/cheat-on-open/README.md b/samples/cheat-on-open/README.md new file mode 100644 index 000000000..dec68b3af --- /dev/null +++ b/samples/cheat-on-open/README.md @@ -0,0 +1,22 @@ +# cheat-on-open + +Directory containing cheat-on-open related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### cheat-on-open.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/commission-schemes/README.md b/samples/commission-schemes/README.md new file mode 100644 index 000000000..58e73b0c3 --- /dev/null +++ b/samples/commission-schemes/README.md @@ -0,0 +1,22 @@ +# commission-schemes + +Directory containing commission-schemes related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### commission-schemes.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/credit-interest/README.md b/samples/credit-interest/README.md new file mode 100644 index 000000000..8a4c3f9a2 --- /dev/null +++ b/samples/credit-interest/README.md @@ -0,0 +1,22 @@ +# credit-interest + +Directory containing credit-interest related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### credit-interest.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/data-bid-ask/README.md b/samples/data-bid-ask/README.md new file mode 100644 index 000000000..a54d3be18 --- /dev/null +++ b/samples/data-bid-ask/README.md @@ -0,0 +1,22 @@ +# data-bid-ask + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### bidask.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/data-filler/README.md b/samples/data-filler/README.md new file mode 100644 index 000000000..c07bea7eb --- /dev/null +++ b/samples/data-filler/README.md @@ -0,0 +1,26 @@ +# data-filler + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### data-filler.py + + + +### relativevolume.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/data-multitimeframe/README.md b/samples/data-multitimeframe/README.md new file mode 100644 index 000000000..cc7c26341 --- /dev/null +++ b/samples/data-multitimeframe/README.md @@ -0,0 +1,22 @@ +# data-multitimeframe + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### data-multitimeframe.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/data-pandas/README.md b/samples/data-pandas/README.md new file mode 100644 index 000000000..09739e426 --- /dev/null +++ b/samples/data-pandas/README.md @@ -0,0 +1,30 @@ +# data-pandas + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### data-pandas-optix.py + + + +### data-pandas.py + + + +### data_ploars_optix.py + + + + +## Directory Summary + +This directory contains 3 files and 0 subdirectories. + +### File Types + +* .py: 3 files diff --git a/samples/data-replay/README.md b/samples/data-replay/README.md new file mode 100644 index 000000000..5f4b4e608 --- /dev/null +++ b/samples/data-replay/README.md @@ -0,0 +1,22 @@ +# data-replay + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### data-replay.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/data-resample/README.md b/samples/data-resample/README.md new file mode 100644 index 000000000..3f0a941af --- /dev/null +++ b/samples/data-resample/README.md @@ -0,0 +1,22 @@ +# data-resample + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### data-resample.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/daysteps/README.md b/samples/daysteps/README.md new file mode 100644 index 000000000..f272b36c5 --- /dev/null +++ b/samples/daysteps/README.md @@ -0,0 +1,22 @@ +# daysteps + +Directory containing daysteps related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### daysteps.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/future-spot/README.md b/samples/future-spot/README.md new file mode 100644 index 000000000..c4c091c3c --- /dev/null +++ b/samples/future-spot/README.md @@ -0,0 +1,22 @@ +# future-spot + +Directory containing future-spot related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### future-spot.py + +:param data: + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/gold-vs-sp500/README.md b/samples/gold-vs-sp500/README.md new file mode 100644 index 000000000..d7f3693dd --- /dev/null +++ b/samples/gold-vs-sp500/README.md @@ -0,0 +1,22 @@ +# gold-vs-sp500 + +Directory containing gold-vs-sp500 related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### gold-vs-sp500.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/ib-cash-bid-ask/README.md b/samples/ib-cash-bid-ask/README.md new file mode 100644 index 000000000..f865fe6a8 --- /dev/null +++ b/samples/ib-cash-bid-ask/README.md @@ -0,0 +1,22 @@ +# ib-cash-bid-ask + +Directory containing ib-cash-bid-ask related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### ib-cash-bid-ask.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/ibtest/README.md b/samples/ibtest/README.md new file mode 100644 index 000000000..196644f25 --- /dev/null +++ b/samples/ibtest/README.md @@ -0,0 +1,22 @@ +# ibtest + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### ibtest.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/kselrsi/README.md b/samples/kselrsi/README.md new file mode 100644 index 000000000..018d18eb8 --- /dev/null +++ b/samples/kselrsi/README.md @@ -0,0 +1,22 @@ +# kselrsi + +Directory containing kselrsi related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### ksignal.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/lineplotter/README.md b/samples/lineplotter/README.md new file mode 100644 index 000000000..962fba7c5 --- /dev/null +++ b/samples/lineplotter/README.md @@ -0,0 +1,22 @@ +# lineplotter + +Contains plotting functionality. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### lineplotter.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/lrsi/README.md b/samples/lrsi/README.md new file mode 100644 index 000000000..c83fa4788 --- /dev/null +++ b/samples/lrsi/README.md @@ -0,0 +1,22 @@ +# lrsi + +Directory containing lrsi related files. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### lrsi-test.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/macd-settings/README.md b/samples/macd-settings/README.md new file mode 100644 index 000000000..e5533af04 --- /dev/null +++ b/samples/macd-settings/README.md @@ -0,0 +1,22 @@ +# macd-settings + +Contains continuous deployment configurations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### macd-settings.py + +This sizer simply returns a fixed size for any operation + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/memory-savings/README.md b/samples/memory-savings/README.md new file mode 100644 index 000000000..258823550 --- /dev/null +++ b/samples/memory-savings/README.md @@ -0,0 +1,22 @@ +# memory-savings + +Directory containing memory-savings related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### memory-savings.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/mixing-timeframes/README.md b/samples/mixing-timeframes/README.md new file mode 100644 index 000000000..6255c3903 --- /dev/null +++ b/samples/mixing-timeframes/README.md @@ -0,0 +1,22 @@ +# mixing-timeframes + +Directory containing mixing-timeframes related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### mixing-timeframes.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/multi-copy/README.md b/samples/multi-copy/README.md new file mode 100644 index 000000000..445ed9ccf --- /dev/null +++ b/samples/multi-copy/README.md @@ -0,0 +1,22 @@ +# multi-copy + +Directory containing multi-copy related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### multi-copy.py + +This strategy is capable of: + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/multi-example/README.md b/samples/multi-example/README.md new file mode 100644 index 000000000..c2c0993da --- /dev/null +++ b/samples/multi-example/README.md @@ -0,0 +1,22 @@ +# multi-example + +Contains example code and usage demonstrations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### mult-values.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/multidata-strategy/README.md b/samples/multidata-strategy/README.md new file mode 100644 index 000000000..8ae6ebf8d --- /dev/null +++ b/samples/multidata-strategy/README.md @@ -0,0 +1,26 @@ +# multidata-strategy + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### multidata-strategy-unaligned.py + +This strategy operates on 2 datas. The expectation is that the 2 datas are + +### multidata-strategy.py + +This strategy operates on 2 datas. The expectation is that the 2 datas are + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/multitrades/README.md b/samples/multitrades/README.md new file mode 100644 index 000000000..17cdde400 --- /dev/null +++ b/samples/multitrades/README.md @@ -0,0 +1,26 @@ +# multitrades + +Directory containing multitrades related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### mtradeobserver.py + + + +### multitrades.py + +This strategy buys/sells upong the close price crossing + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/oandatest/README.md b/samples/oandatest/README.md new file mode 100644 index 000000000..35af26813 --- /dev/null +++ b/samples/oandatest/README.md @@ -0,0 +1,22 @@ +# oandatest + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### oandatest.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/observer-benchmark/README.md b/samples/observer-benchmark/README.md new file mode 100644 index 000000000..0dcc2e31a --- /dev/null +++ b/samples/observer-benchmark/README.md @@ -0,0 +1,22 @@ +# observer-benchmark + +Directory containing observer-benchmark related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### observer-benchmark.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/observers/README.md b/samples/observers/README.md new file mode 100644 index 000000000..affb060eb --- /dev/null +++ b/samples/observers/README.md @@ -0,0 +1,34 @@ +# observers + +Contains observer implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### observers-default-drawdown.py + + + +### observers-default.py + +Python module + +### observers-orderobserver.py + + + +### orderobserver.py + + + + +## Directory Summary + +This directory contains 4 files and 0 subdirectories. + +### File Types + +* .py: 4 files diff --git a/samples/oco/README.md b/samples/oco/README.md new file mode 100644 index 000000000..462e36127 --- /dev/null +++ b/samples/oco/README.md @@ -0,0 +1,22 @@ +# oco + +Directory containing oco related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### oco.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/optimization/README.md b/samples/optimization/README.md new file mode 100644 index 000000000..e7d81262c --- /dev/null +++ b/samples/optimization/README.md @@ -0,0 +1,22 @@ +# optimization + +Directory containing optimization related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### optimization.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/order-close/README.md b/samples/order-close/README.md new file mode 100644 index 000000000..ec42bf7c1 --- /dev/null +++ b/samples/order-close/README.md @@ -0,0 +1,26 @@ +# order-close + +Directory containing order-close related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### close-daily.py + + + +### close-minute.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/order-execution/README.md b/samples/order-execution/README.md new file mode 100644 index 000000000..709403ecb --- /dev/null +++ b/samples/order-execution/README.md @@ -0,0 +1,22 @@ +# order-execution + +Directory containing order-execution related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### order-execution.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/order-history/README.md b/samples/order-history/README.md new file mode 100644 index 000000000..8cd1f48cb --- /dev/null +++ b/samples/order-history/README.md @@ -0,0 +1,22 @@ +# order-history + +Directory containing order-history related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### order-history.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/order_target/README.md b/samples/order_target/README.md new file mode 100644 index 000000000..a7013d3a8 --- /dev/null +++ b/samples/order_target/README.md @@ -0,0 +1,22 @@ +# order_target + +Directory containing order_target related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### order_target.py + +This strategy is loosely based on some of the examples from the Van + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/partial-plot/README.md b/samples/partial-plot/README.md new file mode 100644 index 000000000..9c87c7900 --- /dev/null +++ b/samples/partial-plot/README.md @@ -0,0 +1,22 @@ +# partial-plot + +Contains plotting functionality. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### partial-plot.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/pinkfish-challenge/README.md b/samples/pinkfish-challenge/README.md new file mode 100644 index 000000000..42aeb4649 --- /dev/null +++ b/samples/pinkfish-challenge/README.md @@ -0,0 +1,22 @@ +# pinkfish-challenge + +Directory containing pinkfish-challenge related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### pinkfish-challenge.py + +Replays a bar in 2 steps: + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/pivot-point/README.md b/samples/pivot-point/README.md new file mode 100644 index 000000000..28250f51c --- /dev/null +++ b/samples/pivot-point/README.md @@ -0,0 +1,26 @@ +# pivot-point + +Directory containing pivot-point related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### pivotpoint.py + + + +### ppsample.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/plot-same-axis/README.md b/samples/plot-same-axis/README.md new file mode 100644 index 000000000..4e8b1cd3e --- /dev/null +++ b/samples/plot-same-axis/README.md @@ -0,0 +1,22 @@ +# plot-same-axis + +Contains plotting functionality. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### plot-same-axis.py + +The strategy does nothing but create indicators for plotting purposes + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/psar/README.md b/samples/psar/README.md new file mode 100644 index 000000000..e2e12aff1 --- /dev/null +++ b/samples/psar/README.md @@ -0,0 +1,26 @@ +# psar + +Directory containing psar related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### psar-intraday.py + + + +### psar.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/pyfolio2/README.md b/samples/pyfolio2/README.md new file mode 100644 index 000000000..6f5736606 --- /dev/null +++ b/samples/pyfolio2/README.md @@ -0,0 +1,27 @@ +# pyfolio2 + +Directory containing pyfolio2 related files. Primarily contains .ipynb files code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### backtrader-pyfolio.ipynb + +Binary or data file + +### pyfoliotest.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .ipynb: 1 files +* .py: 1 files diff --git a/samples/pyfoliotest/README.md b/samples/pyfoliotest/README.md new file mode 100644 index 000000000..59c775c04 --- /dev/null +++ b/samples/pyfoliotest/README.md @@ -0,0 +1,27 @@ +# pyfoliotest + +Contains test files and test utilities. Primarily contains .ipynb files code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### backtrader-pyfolio.ipynb + +Binary or data file + +### pyfoliotest.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .ipynb: 1 files +* .py: 1 files diff --git a/samples/relative-volume/README.md b/samples/relative-volume/README.md new file mode 100644 index 000000000..d58729e2b --- /dev/null +++ b/samples/relative-volume/README.md @@ -0,0 +1,26 @@ +# relative-volume + +Directory containing relative-volume related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### relative-volume.py + + + +### relvolbybar.py + +RelativeVolumeByBar: Backtrader indicator for relative volume by bar session time. + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/renko/README.md b/samples/renko/README.md new file mode 100644 index 000000000..875940027 --- /dev/null +++ b/samples/renko/README.md @@ -0,0 +1,22 @@ +# renko + +Directory containing renko related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### renko.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/resample-tickdata/README.md b/samples/resample-tickdata/README.md new file mode 100644 index 000000000..675259c9e --- /dev/null +++ b/samples/resample-tickdata/README.md @@ -0,0 +1,22 @@ +# resample-tickdata + +Contains data files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### resample-tickdata.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/rollover/README.md b/samples/rollover/README.md new file mode 100644 index 000000000..b29bb3c9f --- /dev/null +++ b/samples/rollover/README.md @@ -0,0 +1,22 @@ +# rollover + +Directory containing rollover related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### rollover.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/sharpe-timereturn/README.md b/samples/sharpe-timereturn/README.md new file mode 100644 index 000000000..97c178e1d --- /dev/null +++ b/samples/sharpe-timereturn/README.md @@ -0,0 +1,22 @@ +# sharpe-timereturn + +Directory containing sharpe-timereturn related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### sharpe-timereturn.py + +:param pargs: (Default value = None) + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/signals-strategy/README.md b/samples/signals-strategy/README.md new file mode 100644 index 000000000..0c73000bd --- /dev/null +++ b/samples/signals-strategy/README.md @@ -0,0 +1,22 @@ +# signals-strategy + +Directory containing signals-strategy related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### signals-strategy.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/sigsmacross/README.md b/samples/sigsmacross/README.md new file mode 100644 index 000000000..f760a1488 --- /dev/null +++ b/samples/sigsmacross/README.md @@ -0,0 +1,26 @@ +# sigsmacross + +Directory containing sigsmacross related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### sigsmacross.py + + + +### sigsmacross2.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/sizertest/README.md b/samples/sizertest/README.md new file mode 100644 index 000000000..aaf871f81 --- /dev/null +++ b/samples/sizertest/README.md @@ -0,0 +1,22 @@ +# sizertest + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### sizertest.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/slippage/README.md b/samples/slippage/README.md new file mode 100644 index 000000000..73068693a --- /dev/null +++ b/samples/slippage/README.md @@ -0,0 +1,22 @@ +# slippage + +Directory containing slippage related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### slippage.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/sratio/README.md b/samples/sratio/README.md new file mode 100644 index 000000000..43af9fa3e --- /dev/null +++ b/samples/sratio/README.md @@ -0,0 +1,22 @@ +# sratio + +Directory containing sratio related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### sratio.py + +:param x: + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/srl_strategies/README.md b/samples/srl_strategies/README.md new file mode 100644 index 000000000..67e1c4bc2 --- /dev/null +++ b/samples/srl_strategies/README.md @@ -0,0 +1,34 @@ +# srl_strategies + +Contains trading strategy implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### __init__.py + +Python module + +### buy_and_hold_simple.py + + + +### cost_average.py + + + +### momentum.py + + + + +## Directory Summary + +This directory contains 4 files and 0 subdirectories. + +### File Types + +* .py: 4 files diff --git a/samples/stop-trading/README.md b/samples/stop-trading/README.md new file mode 100644 index 000000000..f8ecf528d --- /dev/null +++ b/samples/stop-trading/README.md @@ -0,0 +1,22 @@ +# stop-trading + +Directory containing stop-trading related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### stop-loss-approaches.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/stoptrail/README.md b/samples/stoptrail/README.md new file mode 100644 index 000000000..356719fe5 --- /dev/null +++ b/samples/stoptrail/README.md @@ -0,0 +1,22 @@ +# stoptrail + +Directory containing stoptrail related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### trail.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/strategy-selection/README.md b/samples/strategy-selection/README.md new file mode 100644 index 000000000..c81d0fa1b --- /dev/null +++ b/samples/strategy-selection/README.md @@ -0,0 +1,22 @@ +# strategy-selection + +Directory containing strategy-selection related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### strategy-selection.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/talib/README.md b/samples/talib/README.md new file mode 100644 index 000000000..8313b6106 --- /dev/null +++ b/samples/talib/README.md @@ -0,0 +1,26 @@ +# talib + +Contains library code. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### tablibsartest.py + + + +### talibtest.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/timers/README.md b/samples/timers/README.md new file mode 100644 index 000000000..2a2d7e7a7 --- /dev/null +++ b/samples/timers/README.md @@ -0,0 +1,26 @@ +# timers + +Directory containing timers related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### scheduled-min.py + + + +### scheduled.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/tradingcalendar/README.md b/samples/tradingcalendar/README.md new file mode 100644 index 000000000..bcc8ac888 --- /dev/null +++ b/samples/tradingcalendar/README.md @@ -0,0 +1,26 @@ +# tradingcalendar + +Directory containing tradingcalendar related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### tcal-intra.py + + + +### tcal.py + + + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/vctest/README.md b/samples/vctest/README.md new file mode 100644 index 000000000..a266ce5c4 --- /dev/null +++ b/samples/vctest/README.md @@ -0,0 +1,22 @@ +# vctest + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### vctest.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/volumefilling/README.md b/samples/volumefilling/README.md new file mode 100644 index 000000000..603731cd7 --- /dev/null +++ b/samples/volumefilling/README.md @@ -0,0 +1,22 @@ +# volumefilling + +Directory containing volumefilling related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### volumefilling.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/vwr/README.md b/samples/vwr/README.md new file mode 100644 index 000000000..706aaa6fb --- /dev/null +++ b/samples/vwr/README.md @@ -0,0 +1,22 @@ +# vwr + +Directory containing vwr related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### vwr.py + +:param pargs: (Default value = None) + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/weekdays-filler/README.md b/samples/weekdays-filler/README.md new file mode 100644 index 000000000..cdd09df92 --- /dev/null +++ b/samples/weekdays-filler/README.md @@ -0,0 +1,26 @@ +# weekdays-filler + +Directory containing weekdays-filler related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### weekdaysaligner.py + + + +### weekdaysfiller.py + +Bar Filler to add missing calendar days to trading days + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/samples/writer-test/README.md b/samples/writer-test/README.md new file mode 100644 index 000000000..eda449dc6 --- /dev/null +++ b/samples/writer-test/README.md @@ -0,0 +1,22 @@ +# writer-test + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### writer-test.py + +This strategy buys/sells upong the close price crossing + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/samples/yahoo-test/README.md b/samples/yahoo-test/README.md new file mode 100644 index 000000000..b51f684f7 --- /dev/null +++ b/samples/yahoo-test/README.md @@ -0,0 +1,22 @@ +# yahoo-test + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (samples)](../README.md) + +## Files + +### yahoo-test.py + + + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/sandbox/ATR_bito.py b/sandbox/ATR_bito.py index f0db82d90..d3ba3d847 100644 --- a/sandbox/ATR_bito.py +++ b/sandbox/ATR_bito.py @@ -8,7 +8,7 @@ # functions/classes if __name__ == "__main__": - # Beispiel-Daten: Erstelle ein DataFrame mit OHLC-Daten + # Example data: Create a DataFrame with OHLC data data = { "High": [1.2, 1.3, 1.4, 1.5, 1.3], "Low": [1.1, 1.2, 1.3, 1.4, 1.2], @@ -16,22 +16,22 @@ } df = pd.DataFrame(data) - # Berechnung der True Range (TR) + # Calculation of True Range (TR) df["Prev Close"] = df["Close"].shift(1) # df["High-Low"] = df["High"] - df["Low"] # High - Low df["High-Prev Close"] = abs(df["High"] - df["Prev Close"]) df["Low-Prev Close"] = abs(df["Low"] - df["Prev Close"]) - # True Range ist das Maximum der oben genannten Werte + # True Range is the maximum of the above values df["True Range"] = df[["High-Low", "High-Prev Close", "Low-Prev Close"]].max( axis=1 - ) # Maximum der drei Werte je Tag + ) # Maximum of the three values per day - # Berechnung des Average True Range (ATR) - period = 3 # Beispielzeitraum + # Calculation of Average True Range (ATR) + period = 3 # Example period df["ATR"] = df["True Range"].rolling(window=period).mean() - # Ausgabe des DataFrames + # Output of the DataFrame print( df[ [ diff --git a/sandbox/README.md b/sandbox/README.md new file mode 100644 index 000000000..e6c6d703b --- /dev/null +++ b/sandbox/README.md @@ -0,0 +1,42 @@ +# sandbox + +Contains experimental or sandbox code. Primarily contains Python code and includes example code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### ATR_bito.py + +Python module + +### ATR_example.py + +The calculate_true_range function calculates the True Range (TR) for a given + +### ATR_example_polars.py + +The calculate_true_range function calculates the True Range (TR) for a given + +### __init__.py + +Python module + +### check_tkinter.py + +Python module + +### random_strategy.py + +Python module + + +## Directory Summary + +This directory contains 6 files and 0 subdirectories. + +### File Types + +* .py: 6 files diff --git a/scripts/generate_documentation.py b/scripts/generate_documentation.py new file mode 100755 index 000000000..7034f8356 --- /dev/null +++ b/scripts/generate_documentation.py @@ -0,0 +1,608 @@ +#!/usr/bin/env python3 +""" +Documentation Generator for Backtrader Repository + +This script recursively traverses the repository directory structure and generates +README.md files for each directory, documenting the purpose and content of each file +and subdirectory. It also creates links between parent and child directories for +easy navigation. + +Usage: + python generate_documentation.py + +Author: OpenHands AI +""" + +import os +import re +import sys +from pathlib import Path +from typing import Dict, List, Set, Tuple + +# Directories to exclude from documentation +EXCLUDE_DIRS = { + '.git', '__pycache__', '.github', 'venv', 'env', '.venv', '.env', + 'node_modules', 'dist', 'build', '.idea', '.vscode', '.pytest_cache', + 'scripts' # Exclude the scripts directory itself +} + +# Files to exclude from documentation +EXCLUDE_FILES = { + '.gitignore', '.gitattributes', '.DS_Store', 'Thumbs.db', '.env', + '.editorconfig', '.prettierrc', '.eslintrc', '.babelrc', '.dockerignore', + 'package-lock.json', 'yarn.lock', 'poetry.lock', 'Pipfile.lock' +} + +# File extensions to document +INCLUDE_EXTENSIONS = { + '.py', '.js', '.java', '.c', '.cpp', '.h', '.hpp', '.sh', '.md', + '.txt', '.json', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf', + '.html', '.css', '.scss', '.less', '.sql', '.r', '.rb', '.go', '.rs', + '.ts', '.tsx', '.jsx', '.php', '.pl', '.pm', '.kt', '.kts', '.swift', + '.m', '.mm', '.f', '.f90', '.f95', '.f03', '.f08', '.lua', '.tcl', + '.groovy', '.scala', '.clj', '.cs', '.fs', '.ml', '.mli', '.hs', '.lhs', + '.erl', '.ex', '.exs', '.elm', '.dart', '.d', '.jl', '.v', '.vhd', '.vhdl' +} + +def detect_non_english(text: str) -> bool: + """ + Detect if text contains non-English content (focusing on Portuguese, German, Chinese). + + Args: + text: Text to analyze + + Returns: + True if non-English content is detected, False otherwise + """ + # Common Portuguese words and patterns + portuguese_patterns = [ + r'\bfaça\b', r'\bestá\b', r'\bfunção\b', r'\bvariáveis\b', r'\bpara o\b', + r'\bcomo um\b', r'\bnão é\b', r'\butilitários\b', r'\bnotificação\b', + r'\badicione\b', r'\bexemplo\b', r'\biniciando\b', r'\btestando\b' + ] + + # Common German words and patterns + german_patterns = [ + r'\bwenn\b', r'\bhier\b', r'\bwird\b', r'\bnoch\b', r'\bbereits\b', + r'\bganz\b', r'\bblöde\b', r'\bidee\b', r'\bformulierung\b', r'\bäquivalent\b', + r'\bmarkt\b', r'\bdaten\b', r'\bwerte\b', r'\bberechnung\b', r'\bbeispiel\b', + r'\bausgabe\b', r'\berstelle\b', r'\bkauf\b', r'\bverkauf\b', r'\bverfolge\b', + r'\bbestellung\b' + ] + + # Check for Chinese characters + chinese_pattern = r'[\u4e00-\u9fff]' + + # Check for Portuguese patterns + for pattern in portuguese_patterns: + if re.search(pattern, text, re.IGNORECASE): + return True + + # Check for German patterns + for pattern in german_patterns: + if re.search(pattern, text, re.IGNORECASE): + return True + + # Check for Chinese characters + if re.search(chinese_pattern, text): + return True + + return False + +def translate_comment(comment: str) -> str: + """ + Translate common non-English comments to English. + + Args: + comment: Comment to translate + + Returns: + Translated comment + """ + # Portuguese to English translations + pt_to_en = { + 'faça': 'do', + 'está': 'is', + 'função': 'function', + 'variáveis': 'variables', + 'para o': 'for the', + 'como um': 'as a', + 'não é': 'is not', + 'utilitários': 'utilities', + 'notificação': 'notification', + 'adicione': 'add', + 'exemplo': 'example', + 'iniciando': 'starting', + 'testando': 'testing', + 'executa': 'executes', + 'combinações': 'combinations', + 'padrão': 'default', + 'estratégias': 'strategies', + 'arbitragem': 'arbitrage' + } + + # German to English translations + de_to_en = { + 'wenn': 'if', + 'hier': 'here', + 'wird': 'becomes', + 'noch': 'still', + 'bereits': 'already', + 'ganz': 'completely', + 'blöde': 'stupid', + 'idee': 'idea', + 'formulierung': 'formulation', + 'äquivalent': 'equivalent', + 'markt': 'market', + 'daten': 'data', + 'werte': 'values', + 'berechnung': 'calculation', + 'beispiel': 'example', + 'ausgabe': 'output', + 'erstelle': 'create', + 'kauf': 'buy', + 'verkauf': 'sell', + 'verfolge': 'track', + 'bestellung': 'order' + } + + # Chinese translations would be more complex, but we'll handle basic detection + + # Apply translations + translated = comment + + # Portuguese translations + for pt, en in pt_to_en.items(): + translated = re.sub(r'\b' + pt + r'\b', en, translated, flags=re.IGNORECASE) + + # German translations + for de, en in de_to_en.items(): + translated = re.sub(r'\b' + de + r'\b', en, translated, flags=re.IGNORECASE) + + # If Chinese characters are detected, add a note + if re.search(r'[\u4e00-\u9fff]', comment): + translated += " [Contains Chinese characters that should be translated]" + + return translated + +def get_file_description(file_path: str) -> str: + """ + Analyze a file and return a description of its purpose. + + Args: + file_path: Path to the file to analyze + + Returns: + A string describing the file's purpose + """ + file_name = os.path.basename(file_path) + ext = os.path.splitext(file_name)[1].lower() + + # Skip binary files and very large files + if ext not in INCLUDE_EXTENSIONS: + return f"Binary or data file" + + try: + file_size = os.path.getsize(file_path) + if file_size > 1_000_000: # Skip files larger than 1MB + return f"Large file ({file_size / 1_000_000:.1f} MB)" + + with open(file_path, 'r', encoding='utf-8', errors='replace') as f: + content = f.read(10000) # Read first 10KB to analyze + + # Check for non-English content + has_non_english = detect_non_english(content) + + # Extract docstring or file header comment + if ext == '.py': + # Look for module docstring + docstring_match = re.search(r'"""(.*?)"""', content, re.DOTALL) + if docstring_match: + docstring = docstring_match.group(1).strip() + first_line = docstring.split('\n')[0].strip() + + # Translate if non-English + if has_non_english: + first_line = translate_comment(first_line) + + return first_line + + # Look for class definitions with docstrings + class_matches = re.finditer(r'class\s+(\w+).*?:.*?"""(.*?)"""', content, re.DOTALL) + for match in class_matches: + class_name = match.group(1) + class_doc = match.group(2).strip().split('\n')[0].strip() + + # Translate if non-English + if has_non_english: + class_doc = translate_comment(class_doc) + + return f"Defines the {class_name} class: {class_doc}" + + # Look for function definitions with docstrings + func_matches = re.finditer(r'def\s+(\w+).*?:.*?"""(.*?)"""', content, re.DOTALL) + for match in func_matches: + func_name = match.group(1) + func_doc = match.group(2).strip().split('\n')[0].strip() + + # Translate if non-English + if has_non_english: + func_doc = translate_comment(func_doc) + + return f"Defines the {func_name} function: {func_doc}" + + # Look for simple class or function definitions + class_match = re.search(r'class\s+(\w+)', content) + if class_match: + return f"Defines the {class_match.group(1)} class" + + func_match = re.search(r'def\s+(\w+)', content) + if func_match: + return f"Defines the {func_match.group(1)} function" + + # For other file types, try to infer purpose from content and name + if 'test' in file_name.lower(): + return "Test file" + elif 'config' in file_name.lower() or ext in {'.json', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf'}: + return "Configuration file" + elif ext in {'.md', '.txt'}: + return "Documentation file" + elif 'setup' in file_name.lower(): + return "Setup/installation file" + elif 'requirements' in file_name.lower(): + return "Dependencies specification file" + + # Add warning about non-English content + non_english_warning = " (Contains non-English content that should be translated)" if has_non_english else "" + + # Default description based on file type + if ext == '.py': + return f"Python module{non_english_warning}" + elif ext == '.js': + return f"JavaScript module{non_english_warning}" + elif ext == '.java': + return f"Java source file{non_english_warning}" + elif ext == '.c' or ext == '.cpp': + return f"C/C++ source file{non_english_warning}" + elif ext == '.h' or ext == '.hpp': + return f"C/C++ header file{non_english_warning}" + elif ext == '.sh': + return f"Shell script{non_english_warning}" + else: + return f"File with {ext} extension{non_english_warning}" + + except Exception as e: + return f"Could not analyze file: {str(e)}" + +def get_directory_description(directory: str) -> str: + """ + Generate a description for a directory based on its name and contents. + + Args: + directory: Path to the directory + + Returns: + A string describing the directory's purpose + """ + dir_name = os.path.basename(directory) + + # Common directory name patterns and their descriptions + dir_patterns = { + 'test': 'Contains test files and test utilities', + 'tests': 'Contains test files and test utilities', + 'doc': 'Contains documentation', + 'docs': 'Contains documentation', + 'example': 'Contains example code and usage demonstrations', + 'examples': 'Contains example code and usage demonstrations', + 'src': 'Contains source code', + 'lib': 'Contains library code', + 'utils': 'Contains utility functions and helper code', + 'util': 'Contains utility functions and helper code', + 'scripts': 'Contains scripts for various tasks', + 'config': 'Contains configuration files', + 'data': 'Contains data files', + 'resources': 'Contains resource files', + 'assets': 'Contains asset files', + 'images': 'Contains image files', + 'img': 'Contains image files', + 'css': 'Contains CSS stylesheets', + 'js': 'Contains JavaScript files', + 'templates': 'Contains template files', + 'model': 'Contains model definitions', + 'models': 'Contains model definitions', + 'view': 'Contains view components', + 'views': 'Contains view components', + 'controller': 'Contains controller logic', + 'controllers': 'Contains controller logic', + 'api': 'Contains API-related code', + 'services': 'Contains service implementations', + 'service': 'Contains service implementations', + 'middleware': 'Contains middleware components', + 'migrations': 'Contains database migration files', + 'fixtures': 'Contains test fixtures or sample data', + 'static': 'Contains static files', + 'public': 'Contains publicly accessible files', + 'private': 'Contains private or sensitive files', + 'vendor': 'Contains third-party dependencies', + 'node_modules': 'Contains Node.js dependencies', + 'bin': 'Contains executable files', + 'tools': 'Contains tools and utilities', + 'contrib': 'Contains contributed code', + 'plugins': 'Contains plugin modules', + 'extensions': 'Contains extension modules', + 'core': 'Contains core functionality', + 'common': 'Contains common code shared across the project', + 'shared': 'Contains shared resources or code', + 'helpers': 'Contains helper functions', + 'hooks': 'Contains hook implementations', + 'interfaces': 'Contains interface definitions', + 'types': 'Contains type definitions', + 'constants': 'Contains constant definitions', + 'enums': 'Contains enumeration definitions', + 'exceptions': 'Contains exception definitions', + 'errors': 'Contains error definitions', + 'logging': 'Contains logging-related code', + 'cache': 'Contains caching-related code', + 'storage': 'Contains storage-related code', + 'database': 'Contains database-related code', + 'db': 'Contains database-related code', + 'auth': 'Contains authentication-related code', + 'security': 'Contains security-related code', + 'i18n': 'Contains internationalization code', + 'locales': 'Contains localization files', + 'translations': 'Contains translation files', + 'backup': 'Contains backup files', + 'temp': 'Contains temporary files', + 'tmp': 'Contains temporary files', + 'logs': 'Contains log files', + 'log': 'Contains log files', + 'build': 'Contains build artifacts', + 'dist': 'Contains distribution files', + 'release': 'Contains release files', + 'deploy': 'Contains deployment scripts or configurations', + 'ci': 'Contains continuous integration configurations', + 'cd': 'Contains continuous deployment configurations', + 'docker': 'Contains Docker-related files', + 'kubernetes': 'Contains Kubernetes configurations', + 'k8s': 'Contains Kubernetes configurations', + 'helm': 'Contains Helm charts', + 'terraform': 'Contains Terraform configurations', + 'ansible': 'Contains Ansible playbooks', + 'vagrant': 'Contains Vagrant configurations', + 'aws': 'Contains AWS-related code or configurations', + 'azure': 'Contains Azure-related code or configurations', + 'gcp': 'Contains Google Cloud Platform-related code or configurations', + 'strategies': 'Contains trading strategy implementations', + 'indicators': 'Contains technical indicator implementations', + 'analyzers': 'Contains analysis tools and metrics', + 'feeds': 'Contains data feed implementations', + 'brokers': 'Contains broker implementations', + 'observers': 'Contains observer implementations', + 'sizers': 'Contains position sizing implementations', + 'filters': 'Contains data filtering implementations', + 'stores': 'Contains store implementations', + 'commissions': 'Contains commission models', + 'plot': 'Contains plotting functionality', + 'arbitrage': 'Contains arbitrage strategy implementations', + 'backtest': 'Contains backtesting functionality', + 'live': 'Contains live trading functionality', + 'sandbox': 'Contains experimental or sandbox code', + 'contrib': 'Contains contributed code', + 'samples': 'Contains sample code and examples', + 'tutorials': 'Contains tutorial code and examples' + } + + # Check for directory name matches + for pattern, description in dir_patterns.items(): + if dir_name.lower() == pattern.lower(): + return description + + # If no direct match, try partial matches + for pattern, description in dir_patterns.items(): + if pattern.lower() in dir_name.lower(): + return description + + # Default description + return f"Directory containing {dir_name} related files" + +def analyze_directory_context(directory: str, files: list) -> str: + """ + Analyze the context of a directory based on its files. + + Args: + directory: Path to the directory + files: List of files in the directory + + Returns: + A string describing the directory's context + """ + # Count file extensions to determine the primary purpose + extension_counts = {} + for file in files: + ext = os.path.splitext(file)[1].lower() + if ext: + extension_counts[ext] = extension_counts.get(ext, 0) + 1 + + # Sort extensions by count + sorted_extensions = sorted(extension_counts.items(), key=lambda x: x[1], reverse=True) + + # Determine primary language/technology + primary_tech = None + if sorted_extensions: + primary_ext = sorted_extensions[0][0] + if primary_ext == '.py': + primary_tech = 'Python' + elif primary_ext == '.js': + primary_tech = 'JavaScript' + elif primary_ext == '.java': + primary_tech = 'Java' + elif primary_ext == '.c' or primary_ext == '.cpp' or primary_ext == '.h' or primary_ext == '.hpp': + primary_tech = 'C/C++' + elif primary_ext == '.rb': + primary_tech = 'Ruby' + elif primary_ext == '.go': + primary_tech = 'Go' + elif primary_ext == '.rs': + primary_tech = 'Rust' + elif primary_ext == '.php': + primary_tech = 'PHP' + elif primary_ext == '.cs': + primary_tech = 'C#' + elif primary_ext == '.ts': + primary_tech = 'TypeScript' + elif primary_ext == '.html' or primary_ext == '.css': + primary_tech = 'Web' + elif primary_ext == '.md' or primary_ext == '.txt': + primary_tech = 'Documentation' + elif primary_ext == '.json' or primary_ext == '.yaml' or primary_ext == '.yml': + primary_tech = 'Configuration' + elif primary_ext == '.sh': + primary_tech = 'Shell' + else: + primary_tech = f'{primary_ext} files' + + # Check for specific file patterns + has_tests = any('test' in file.lower() for file in files) + has_examples = any('example' in file.lower() for file in files) + has_docs = any(file.lower().endswith(('.md', '.txt', '.rst', '.adoc')) for file in files) + has_config = any(file.lower().endswith(('.json', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.conf')) for file in files) + + # Build context description + context_parts = [] + + if primary_tech: + context_parts.append(f"Primarily contains {primary_tech} code") + + if has_tests: + context_parts.append("includes test files") + + if has_examples: + context_parts.append("includes example code") + + if has_docs: + context_parts.append("includes documentation") + + if has_config: + context_parts.append("includes configuration files") + + # Join parts with appropriate conjunctions + if len(context_parts) == 1: + return context_parts[0] + elif len(context_parts) == 2: + return f"{context_parts[0]} and {context_parts[1]}" + elif len(context_parts) > 2: + return f"{', '.join(context_parts[:-1])}, and {context_parts[-1]}" + else: + return "Contains various files" + +def generate_readme(directory: str, parent_dir: str = None) -> None: + """ + Generate a README.md file for the specified directory. + + Args: + directory: Path to the directory to document + parent_dir: Path to the parent directory (for creating links) + """ + dir_path = Path(directory) + dir_name = dir_path.name + + # Skip excluded directories + if dir_name in EXCLUDE_DIRS: + return + + # Get all subdirectories and files + subdirs = [] + files = [] + + for item in os.listdir(directory): + item_path = os.path.join(directory, item) + + if os.path.isdir(item_path): + if item not in EXCLUDE_DIRS and not item.startswith('.'): + subdirs.append(item) + elif os.path.isfile(item_path): + if item not in EXCLUDE_FILES and not item.startswith('.'): + files.append(item) + + # Sort subdirectories and files alphabetically + subdirs.sort() + files.sort() + + # Get directory description and context + dir_description = get_directory_description(directory) + dir_context = analyze_directory_context(directory, files) + + # Create README.md content + content = [f"# {dir_name}\n\n"] + content.append(f"{dir_description}. {dir_context}.\n\n") + + # Add navigation links + content.append("## Navigation\n\n") + + if parent_dir: + parent_name = os.path.basename(parent_dir) + content.append(f"* [↑ Parent Directory ({parent_name})](../README.md)\n") + else: + # This is the root directory + content.append("* This is the root directory of the repository\n") + + if subdirs: + content.append("\n### Subdirectories\n\n") + for subdir in subdirs: + # Get a brief description for the subdirectory + subdir_path = os.path.join(directory, subdir) + subdir_desc = get_directory_description(subdir_path) + content.append(f"* [{subdir}]({subdir}/README.md) - {subdir_desc}\n") + + # Add files section + if files: + content.append("\n## Files\n\n") + for file in files: + if file == "README.md": + continue + + file_path = os.path.join(directory, file) + description = get_file_description(file_path) + content.append(f"### {file}\n\n") + content.append(f"{description}\n\n") + + # Add a summary section + content.append("\n## Directory Summary\n\n") + content.append(f"This directory contains {len(files)} files and {len(subdirs)} subdirectories.\n\n") + + # Add file type statistics + if files: + extension_counts = {} + for file in files: + ext = os.path.splitext(file)[1].lower() + if ext: + extension_counts[ext] = extension_counts.get(ext, 0) + 1 + + if extension_counts: + content.append("### File Types\n\n") + for ext, count in sorted(extension_counts.items(), key=lambda x: x[1], reverse=True): + content.append(f"* {ext}: {count} files\n") + + # Write README.md file + readme_path = os.path.join(directory, "README.md") + with open(readme_path, 'w', encoding='utf-8') as f: + f.write(''.join(content)) + + print(f"Generated README.md for {directory}") + + # Recursively generate README.md for subdirectories + for subdir in subdirs: + subdir_path = os.path.join(directory, subdir) + generate_readme(subdir_path, directory) + +def main(): + """Main function to generate documentation for the entire repository.""" + # Start from the repository root + repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + print(f"Generating documentation for repository: {repo_root}") + generate_readme(repo_root) + print("Documentation generation complete!") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/src/README.md b/src/README.md new file mode 100644 index 000000000..83a6bf06f --- /dev/null +++ b/src/README.md @@ -0,0 +1,16 @@ +# src + +Contains source code. Contains various files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [anoroa](anoroa/README.md) - Directory containing anoroa related files + +## Directory Summary + +This directory contains 0 files and 1 subdirectories. + diff --git a/src/anoroa/README.md b/src/anoroa/README.md new file mode 100644 index 000000000..c31910814 --- /dev/null +++ b/src/anoroa/README.md @@ -0,0 +1,26 @@ +# anoroa + +Directory containing anoroa related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (src)](../README.md) + +## Files + +### __init__.py + +Python module + +### models.py + +Represents a single candlestick in a financial chart. + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .py: 2 files diff --git a/strategies.py b/strategies.py index 8bd981a14..2085f723d 100644 --- a/strategies.py +++ b/strategies.py @@ -125,9 +125,9 @@ def __init__(self, use_real_trading=False): callback = MyXtQuantTraderCallback() self.acc = StockAccount("39131771") self.xt_trader.register_callback(callback) - self.use_real_trading = use_real_trading # 新增标志位判断是否实盘 + self.use_real_trading = use_real_trading # Added flag to determine if it's real trading - if use_real_trading: # 如果实盘才连接 + if use_real_trading: # Only connect if it's real trading self.xt_trader.start() connect_result = self.xt_trader.connect() if connect_result != 0: diff --git a/strategies/README.md b/strategies/README.md new file mode 100644 index 000000000..b6e9b787b --- /dev/null +++ b/strategies/README.md @@ -0,0 +1,86 @@ +# strategies + +Contains trading strategy implementations. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [utils](utils/README.md) - Contains utility functions and helper code + +## Files + +### bb_mean_reversal.py + +BOLLINGER BANDS RSI WITH ATR STRATEGY - (bb_rsi_atr) + +### bb_mean_reversal_rsi.py + +BOLLINGER BANDS MEAN REVERSION STRATEGY WITH POSTGRESQL DATABASE - (bb_mean_reversal_rsi) + +### bb_upper_breakout.py + +BOLLINGER BANDS UPPER BREAKOUT STRATEGY - (bb_upper_breakout) + +### channel_trading.py + +PRICE CHANNEL TRADING STRATEGY WITH POSTGRESQL DATABASE - (channel_trading) + +### cup_and_handle.py + +CUP AND HANDLE TRADING STRATEGY WITH POSTGRESQL DATABASE - (cup-and-handle) + +### fibonacci_retracement_pullback.py + +FIBONACCI RETRACEMENT PULLBACK STRATEGY WITH POSTGRESQL DATABASE - (fib-pullback) + +### gaussian_stochrsi_momentum.py + +GAUSSIAN CHANNEL WITH STOCHASTIC RSI TRADING STRATEGY - (bb-hard) + +### gaussian_triple_confirmation.py + +GAUSSIAN CHANNEL STRATEGY WITH STOCHASTIC RSI AND BOLLINGER BANDS - (bb-medium) + +### macd_divergence.py + +MACD Divergence Strategy + +### moving_average_crossover.py + +MOVING AVERAGE CROSSOVER STRATEGY WITH POSTGRESQL DATABASE - (ma-crossover) + +### risk_adverse.py + +RISK AVERSE STRATEGY WITH POSTGRESQL DATABASE - (risk_adverse) + +### rsi_divergence.py + +RSI DIVERGENCE TRADING STRATEGY - (rsi-divergence) + +### rsi_overbought_oversold_reversal.py + +RSI OVERBOUGHT/OVERSOLD REVERSAL STRATEGY WITH POSTGRESQL DATABASE - (rsi-reversal) + +### simple.py + +BACKTESTING TRADING STRATEGIES WITH POSTGRESQL DATABASE + +### support_resistance_bounce.py + +BOLLINGER BANDS MEAN REVERSION STRATEGY WITH POSTGRESQL DATABASE - (bb_mean_reversal) + +### vol_contraction.py + +Volatility Contraction Pattern (VCP) Strategy + + +## Directory Summary + +This directory contains 16 files and 1 subdirectories. + +### File Types + +* .py: 16 files diff --git a/strategies/utils/README.md b/strategies/utils/README.md new file mode 100644 index 000000000..f45b4eab1 --- /dev/null +++ b/strategies/utils/README.md @@ -0,0 +1,22 @@ +# utils + +Contains utility functions and helper code. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (strategies)](../README.md) + +## Files + +### __init__.py + +Utility functions for Backtrader strategies + + +## Directory Summary + +This directory contains 1 files and 0 subdirectories. + +### File Types + +* .py: 1 files diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 000000000..0f72d3543 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,394 @@ +# tests + +Contains test files and test utilities. Primarily contains Python code and includes test files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### test_analyzer-sqn.py + + + +### test_analyzer-timereturn.py + + + +### test_bbroker_try_exec_limit.py + + + +### test_comminfo.py + + + +### test_data_multiframe.py + +:param main: (Default value = False) + +### test_data_pandas.py + + + +### test_data_replay.py + +:param main: (Default value = False) + +### test_data_resample.py + +:param main: (Default value = False) + +### test_data_resample_optimize.py + + + +### test_ind_accdecosc.py + +:param main: (Default value = False) + +### test_ind_aroonoscillator.py + +:param main: (Default value = False) + +### test_ind_aroonupdown.py + +:param main: (Default value = False) + +### test_ind_atr.py + +:param main: (Default value = False) + +### test_ind_awesomeoscillator.py + +:param main: (Default value = False) + +### test_ind_bbands.py + +:param main: (Default value = False) + +### test_ind_cci.py + +:param main: (Default value = False) + +### test_ind_dema.py + +:param main: (Default value = False) + +### test_ind_demaenvelope.py + +:param main: (Default value = False) + +### test_ind_demaosc.py + +:param main: (Default value = False) + +### test_ind_dm.py + +:param main: (Default value = False) + +### test_ind_dma.py + +:param main: (Default value = False) + +### test_ind_downmove.py + +:param main: (Default value = False) + +### test_ind_dpo.py + +:param main: (Default value = False) + +### test_ind_dv2.py + +:param main: (Default value = False) + +### test_ind_ema.py + +:param main: (Default value = False) + +### test_ind_emaenvelope.py + +:param main: (Default value = False) + +### test_ind_emaosc.py + +:param main: (Default value = False) + +### test_ind_envelope.py + + + +### test_ind_heikinashi.py + +:param main: (Default value = False) + +### test_ind_highest.py + +:param main: (Default value = False) + +### test_ind_hma.py + +:param main: (Default value = False) + +### test_ind_ichimoku.py + +:param main: (Default value = False) + +### test_ind_kama.py + +:param main: (Default value = False) + +### test_ind_kamaenvelope.py + +:param main: (Default value = False) + +### test_ind_kamaosc.py + +:param main: (Default value = False) + +### test_ind_kst.py + +:param main: (Default value = False) + +### test_ind_lowest.py + +:param main: (Default value = False) + +### test_ind_lrsi.py + +:param main: (Default value = False) + +### test_ind_macdhisto.py + +:param main: (Default value = False) + +### test_ind_minperiod.py + +:param main: (Default value = False) + +### test_ind_momentum.py + +:param main: (Default value = False) + +### test_ind_momentumoscillator.py + +:param main: (Default value = False) + +### test_ind_oscillator.py + + + +### test_ind_pctchange.py + +:param main: (Default value = False) + +### test_ind_pctrank.py + +:param main: (Default value = False) + +### test_ind_pgo.py + +:param main: (Default value = False) + +### test_ind_ppo.py + +:param main: (Default value = False) + +### test_ind_pposhort.py + +:param main: (Default value = False) + +### test_ind_priceosc.py + +:param main: (Default value = False) + +### test_ind_rmi.py + +:param main: (Default value = False) + +### test_ind_roc.py + +:param main: (Default value = False) + +### test_ind_rsi.py + +:param main: (Default value = False) + +### test_ind_rsi_safe.py + +:param main: (Default value = False) + +### test_ind_sma.py + +:param main: (Default value = False) + +### test_ind_smaenvelope.py + +:param main: (Default value = False) + +### test_ind_smaosc.py + +:param main: (Default value = False) + +### test_ind_smma.py + +:param main: (Default value = False) + +### test_ind_smmaenvelope.py + +:param main: (Default value = False) + +### test_ind_smmaosc.py + +:param main: (Default value = False) + +### test_ind_stochastic.py + +:param main: (Default value = False) + +### test_ind_stochasticfull.py + +:param main: (Default value = False) + +### test_ind_sumn.py + +:param main: (Default value = False) + +### test_ind_tema.py + +:param main: (Default value = False) + +### test_ind_temaenvelope.py + +:param main: (Default value = False) + +### test_ind_temaosc.py + +:param main: (Default value = False) + +### test_ind_trix.py + +:param main: (Default value = False) + +### test_ind_tsi.py + +:param main: (Default value = False) + +### test_ind_ultosc.py + +:param main: (Default value = False) + +### test_ind_upmove.py + +:param main: (Default value = False) + +### test_ind_vortex.py + +:param main: (Default value = False) + +### test_ind_williamsad.py + +:param main: (Default value = False) + +### test_ind_williamsr.py + +:param main: (Default value = False) + +### test_ind_wma.py + +:param main: (Default value = False) + +### test_ind_wmaenvelope.py + +:param main: (Default value = False) + +### test_ind_wmaosc.py + +:param main: (Default value = False) + +### test_ind_zlema.py + +:param main: (Default value = False) + +### test_ind_zlind.py + +:param main: (Default value = False) + +### test_math_function_scalar.py + + + +### test_metaclass.py + +This class is used for testing that inheriting from base class that + +### test_multidata_optimize.py + + + +### test_order.py + + + +### test_pickle_datatrades.py + + + +### test_position.py + +:param main: (Default value = False) + +### test_resample_live.py + +:param open_hour: + +### test_resampler.py + +:param data_timeframe: + +### test_stores_ibstore_dt_plus_duration.py + + + +### test_strategy_optimized.py + + + +### test_strategy_unoptimized.py + + + +### test_study_fractal.py + +:param main: (Default value = False) + +### test_trade.py + + + +### test_tradingcalendar.py + +:param open_hour: + +### test_writer.py + + + +### testcommon.py + +:param filename: + +### util_asserts.py + +:param data: + + +## Directory Summary + +This directory contains 94 files and 0 subdirectories. + +### File Types + +* .py: 94 files diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 000000000..5f3993fde --- /dev/null +++ b/tools/README.md @@ -0,0 +1,34 @@ +# tools + +Contains tools and utilities. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +## Files + +### bt-run.py + +Python module + +### dump-ticker.py + +:param symbol: + +### rewrite-data.py + + + +### yahoodownload.py + + + + +## Directory Summary + +This directory contains 4 files and 0 subdirectories. + +### File Types + +* .py: 4 files diff --git a/try.py b/try.py index 60619d9bf..3993773ad 100644 --- a/try.py +++ b/try.py @@ -16,21 +16,24 @@ def finetune( todate=datetime(2020, 4, 1), count=1, ): - """为每个股票优化独立参数 - - :param Strategy: - :param method: (Default value = "Sko") - :param stocks: (Default value = ["000001.SZ"]) - :param timeframe: (Default value = bt.TimeFrame.Days) - :param fromdate: (Default value = datetime(2020, 1, 1)) - :param todate: (Default value = datetime(2020, 4, 1)) - :param count: (Default value = 1) - + """Optimize independent parameters for each stock + + Args: + Strategy: Strategy class to optimize + method: Optimization method, either "Sko" or "Optuna" (Default value = "Sko") + stocks: List of stock symbols to optimize (Default value = ["000001.SZ"]) + timeframe: Timeframe for data (Default value = bt.TimeFrame.Days) + fromdate: Start date for optimization (Default value = datetime(2020, 1, 1)) + todate: End date for optimization (Default value = datetime(2020, 4, 1)) + count: Number of optimization iterations (Default value = 1) + + Returns: + Dictionary of optimized parameters for each stock """ store = QMTStore() optimized_params = {} - # 获取策略可优化参数列表 + # Get list of optimizable strategy parameters default_params = { name: value for name, value in Strategy.params._getitems() @@ -38,14 +41,18 @@ def finetune( } param_names = list(default_params.keys()) - # 单股票优化函数 + # Single stock optimization function def optimize_single_stock(stock): """ + Optimize parameters for a single stock - :param stock: + Args: + stock: Stock symbol to optimize + Returns: + Dictionary of optimized parameters """ - # 加载单股票数据 + # Load single stock data data = store.getdata( dataname=stock, timeframe=timeframe, @@ -54,17 +61,21 @@ def optimize_single_stock(stock): live=False, ) - # 优化逻辑 + # Optimization logic if method == "Sko": n_dim = len(param_names) - lb = [1] * n_dim - ub = [50] * n_dim + lb = [1] * n_dim # Lower bounds + ub = [50] * n_dim # Upper bounds def backtest(p): """ + Run backtest with given parameters - :param p: + Args: + p: Parameter values to test + Returns: + Negative portfolio value (for minimization) """ param_dict = { name: int(round(value)) for name, value in zip(param_names, p) diff --git a/turtle/README.md b/turtle/README.md new file mode 100644 index 000000000..4bc25c69a --- /dev/null +++ b/turtle/README.md @@ -0,0 +1,58 @@ +# turtle + +Directory containing turtle related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [data](data/README.md) - Contains data files + +## Files + +### a300.py + +Python module (Contains non-English content that should be translated) + +### baostock_wrapper.py + + + +### bs.py + +Python module (Contains non-English content that should be translated) + +### csv_viewer.py + + + +### log + +Binary or data file + +### main.py + + + +### sma.py + + + +### sma_detector.py + +:param df: + +### z500.py + +Python module (Contains non-English content that should be translated) + + +## Directory Summary + +This directory contains 9 files and 1 subdirectories. + +### File Types + +* .py: 8 files diff --git a/xtquant/README.md b/xtquant/README.md new file mode 100644 index 000000000..6ef237879 --- /dev/null +++ b/xtquant/README.md @@ -0,0 +1,109 @@ +# xtquant + +Directory containing xtquant related files. Primarily contains Python code and includes configuration files. + +## Navigation + +* [↑ Parent Directory (backtrader)](../README.md) + +### Subdirectories + +* [config](config/README.md) - Contains configuration files +* [doc](doc/README.md) - Contains documentation +* [metatable](metatable/README.md) - Directory containing metatable related files +* [qmttools](qmttools/README.md) - Contains tools and utilities +* [xtbson](xtbson/README.md) - Directory containing xtbson related files + +## Files + +### __init__.py + +:param package_name: + +### libeay32.dll + +Binary or data file + +### log4cxx.dll + +Binary or data file + +### msvcp140.dll + +Binary or data file + +### ssleay32.dll + +Binary or data file + +### vcruntime140.dll + +Binary or data file + +### xtconn.py + +addr: 'localhost:58610' + +### xtconstant.py + +常量定义模块 [Contains Chinese characters that should be translated] + +### xtdata.ini + +Configuration file + +### xtdata.log4cxx + +Binary or data file + +### xtdata.py + +***** xtdata连接成功 ***** [Contains Chinese characters that should be translated] + +### xtdata_config.py + +Configuration file + +### xtdatacenter.py + +尝试创建RPCClient,如果失败,会抛出异常 [Contains Chinese characters that should be translated] + +### xtextend.py + + + +### xtstocktype.py + +Python module + +### xttools.py + + + +### xttrader.py + +:param s: (Default value = None) + +### xttype.py + +定义Python的数据结构,给Python策略使用 [Contains Chinese characters that should be translated] + +### xtutil.py + +:param buffer: + +### xtview.py + +:param ip: (Default value = "") + + +## Directory Summary + +This directory contains 20 files and 5 subdirectories. + +### File Types + +* .py: 13 files +* .dll: 5 files +* .ini: 1 files +* .log4cxx: 1 files diff --git a/xtquant/config/README.md b/xtquant/config/README.md new file mode 100644 index 000000000..0ee260ae8 --- /dev/null +++ b/xtquant/config/README.md @@ -0,0 +1,103 @@ +# config + +Contains configuration files. Primarily contains .ini files code, includes documentation, and includes configuration files. + +## Navigation + +* [↑ Parent Directory (xtquant)](../README.md) + +### Subdirectories + +* [user](user/README.md) - Directory containing user related files + +## Files + +### MarketTime.ini + +Configuration file + +### StockInfo.lua + +File with .lua extension + +### captial_structure_1.ini + +Configuration file + +### cashflow_new_1.ini + +Configuration file + +### config.lua + +Configuration file + +### configHelper.lua + +Configuration file + +### env.lua + +File with .lua extension + +### metaInfo.json + +Configuration file + +### pershare_new.ini + +Configuration file + +### sharebalance_new_1.ini + +Configuration file + +### shareholder_new_1.ini + +Configuration file + +### shareincome_new_1.ini + +Configuration file + +### table2json.lua + +File with .lua extension (Contains non-English content that should be translated) + +### top10holder_new_1.ini + +Configuration file + +### tradeTime.txt + +Documentation file + +### xtquantservice.log4cxx + +Binary or data file + +### xtquantservice.lua + +File with .lua extension + +### xtquoterconfig.xml + +Binary or data file + +### xtstocktype.lua + +File with .lua extension (Contains non-English content that should be translated) + + +## Directory Summary + +This directory contains 19 files and 1 subdirectories. + +### File Types + +* .ini: 8 files +* .lua: 7 files +* .json: 1 files +* .txt: 1 files +* .log4cxx: 1 files +* .xml: 1 files diff --git a/xtquant/config/user/README.md b/xtquant/config/user/README.md new file mode 100644 index 000000000..4028dfccd --- /dev/null +++ b/xtquant/config/user/README.md @@ -0,0 +1,16 @@ +# user + +Directory containing user related files. Contains various files. + +## Navigation + +* [↑ Parent Directory (config)](../README.md) + +### Subdirectories + +* [root2](root2/README.md) - Directory containing root2 related files + +## Directory Summary + +This directory contains 0 files and 1 subdirectories. + diff --git a/xtquant/config/user/root2/README.md b/xtquant/config/user/root2/README.md new file mode 100644 index 000000000..bfcfe5cb3 --- /dev/null +++ b/xtquant/config/user/root2/README.md @@ -0,0 +1,16 @@ +# root2 + +Directory containing root2 related files. Contains various files. + +## Navigation + +* [↑ Parent Directory (user)](../README.md) + +### Subdirectories + +* [lua](lua/README.md) - Directory containing lua related files + +## Directory Summary + +This directory contains 0 files and 1 subdirectories. + diff --git a/xtquant/config/user/root2/lua/README.md b/xtquant/config/user/root2/lua/README.md new file mode 100644 index 000000000..4ea0f12ee --- /dev/null +++ b/xtquant/config/user/root2/lua/README.md @@ -0,0 +1,70 @@ +# lua + +Directory containing lua related files. Primarily contains .lua files code. + +## Navigation + +* [↑ Parent Directory (root2)](../README.md) + +## Files + +### ConstFunc.lua + +File with .lua extension + +### FunIndex.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunLogic.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunMath.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunOther.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunRef.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunStatistic.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunString.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunSystem.lua + +File with .lua extension (Contains non-English content that should be translated) + +### FunTrader.lua + +File with .lua extension (Contains non-English content that should be translated) + +### MetaType.lua + +File with .lua extension (Contains non-English content that should be translated) + +### config.lua + +Configuration file + +### util.lua + +File with .lua extension (Contains non-English content that should be translated) + + +## Directory Summary + +This directory contains 13 files and 0 subdirectories. + +### File Types + +* .lua: 13 files diff --git a/xtquant/doc/README.md b/xtquant/doc/README.md new file mode 100644 index 000000000..3ade87aa8 --- /dev/null +++ b/xtquant/doc/README.md @@ -0,0 +1,26 @@ +# doc + +Contains documentation. Primarily contains Documentation code and includes documentation. + +## Navigation + +* [↑ Parent Directory (xtquant)](../README.md) + +## Files + +### xtdata.md + +Documentation file + +### xttrader.md + +Documentation file + + +## Directory Summary + +This directory contains 2 files and 0 subdirectories. + +### File Types + +* .md: 2 files diff --git a/xtquant/metatable/README.md b/xtquant/metatable/README.md new file mode 100644 index 000000000..95573f8e5 --- /dev/null +++ b/xtquant/metatable/README.md @@ -0,0 +1,34 @@ +# metatable + +Directory containing metatable related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (xtquant)](../README.md) + +## Files + +### __init__.py + +Python module + +### get_arrow.py + +:param codes: + +### get_bson.py + +根据字段解析metaid和field [Contains Chinese characters that should be translated] + +### meta_config.py + +下载metatable信息 [Contains Chinese characters that should be translated] + + +## Directory Summary + +This directory contains 4 files and 0 subdirectories. + +### File Types + +* .py: 4 files diff --git a/xtquant/qmttools/README.md b/xtquant/qmttools/README.md new file mode 100644 index 000000000..28afff02b --- /dev/null +++ b/xtquant/qmttools/README.md @@ -0,0 +1,38 @@ +# qmttools + +Contains tools and utilities. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (xtquant)](../README.md) + +## Files + +### __init__.py + +Python module + +### contextinfo.py + + + +### functions.py + +timelabel: str '20221231' '20221231235959' + +### stgentry.py + +:param user_script: + +### stgframe.py + + + + +## Directory Summary + +This directory contains 5 files and 0 subdirectories. + +### File Types + +* .py: 5 files diff --git a/xtquant/xtbson/README.md b/xtquant/xtbson/README.md new file mode 100644 index 000000000..52fb994a5 --- /dev/null +++ b/xtquant/xtbson/README.md @@ -0,0 +1,27 @@ +# xtbson + +Directory containing xtbson related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (xtquant)](../README.md) + +### Subdirectories + +* [bson36](bson36/README.md) - Directory containing bson36 related files +* [bson37](bson37/README.md) - Directory containing bson37 related files + +## Files + +### __init__.py + +Python module + + +## Directory Summary + +This directory contains 1 files and 2 subdirectories. + +### File Types + +* .py: 1 files diff --git a/xtquant/xtbson/bson36/README.md b/xtquant/xtbson/bson36/README.md new file mode 100644 index 000000000..f1ad0081e --- /dev/null +++ b/xtquant/xtbson/bson36/README.md @@ -0,0 +1,90 @@ +# bson36 + +Directory containing bson36 related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (xtbson)](../README.md) + +## Files + +### __init__.py + +BSON (Binary JSON) encoding and decoding. + +### _helpers.py + +Setstate and getstate functions for objects with __slots__, allowing + +### binary.py + +Tools for representing BSON binary data. + +### code.py + +Tools for representing JavaScript code in BSON. + +### codec_options.py + +Tools for specifying BSON codec options. + +### dbref.py + +Tools for manipulating DBRefs (references to MongoDB documents). + +### decimal128.py + +Tools for working with the BSON decimal128 type. + +### errors.py + +Exceptions raised by the BSON package. + +### int64.py + +A BSON wrapper for long (int in python3) + +### json_util.py + +Tools for using Python's :mod:`json` module with BSON documents. + +### max_key.py + +Representation for the MongoDB internal MaxKey type. + +### min_key.py + +Representation for the MongoDB internal MinKey type. + +### objectid.py + +Tools for working with MongoDB `ObjectIds + +### raw_bson.py + +Tools for representing raw BSON documents. + +### regex.py + +Tools for representing MongoDB regular expressions. + +### son.py + +Tools for creating and manipulating SON, the Serialized Ocument Notation. + +### timestamp.py + +Tools for representing MongoDB internal Timestamps. + +### tz_util.py + +Timezone related utilities for BSON. + + +## Directory Summary + +This directory contains 18 files and 0 subdirectories. + +### File Types + +* .py: 18 files diff --git a/xtquant/xtbson/bson37/README.md b/xtquant/xtbson/bson37/README.md new file mode 100644 index 000000000..eacaa8aa0 --- /dev/null +++ b/xtquant/xtbson/bson37/README.md @@ -0,0 +1,104 @@ +# bson37 + +Directory containing bson37 related files. Primarily contains Python code. + +## Navigation + +* [↑ Parent Directory (xtbson)](../README.md) + +## Files + +### __init__.py + +BSON (Binary JSON) encoding and decoding. + +### _helpers.py + +Setstate and getstate functions for objects with __slots__, allowing + +### binary.py + +Tools for representing BSON binary data. + +### code.py + +Tools for representing JavaScript code in BSON. + +### codec_options.py + +Tools for specifying BSON codec options. + +### codec_options.pyi + +Binary or data file + +### datetime_ms.py + +Tools for representing the BSON datetime type. + +### dbref.py + +Tools for manipulating DBRefs (references to MongoDB documents). + +### decimal128.py + +Tools for working with the BSON decimal128 type. + +### errors.py + +Exceptions raised by the BSON package. + +### int64.py + +A BSON wrapper for long (int in python3) + +### json_util.py + +Tools for using Python's :mod:`json` module with BSON documents. + +### max_key.py + +Representation for the MongoDB internal MaxKey type. + +### min_key.py + +Representation for the MongoDB internal MinKey type. + +### objectid.py + +Tools for working with MongoDB ObjectIds. + +### py.typed + +Binary or data file + +### raw_bson.py + +Tools for representing raw BSON documents. + +### regex.py + +Tools for representing MongoDB regular expressions. + +### son.py + +Tools for creating and manipulating SON, the Serialized Ocument Notation. + +### timestamp.py + +Tools for representing MongoDB internal Timestamps. + +### tz_util.py + +Timezone related utilities for BSON. + + +## Directory Summary + +This directory contains 21 files and 0 subdirectories. + +### File Types + +* .py: 19 files +* .pyi: 1 files +* .typed: 1 files