File tree Expand file tree Collapse file tree 5 files changed +14
-8
lines changed
investing_algorithm_framework
infrastructure/models/market_data_sources Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 3434 # ----------------------------------------------
3535 - run : python -m pip install black flake8 isort
3636 - run : |
37- flake8 ./investing_algorithm_framework
37+ flake8 ./investing_algorithm_framework --exclude="investing_algorithm_framework/domain/utils/backtesting.py"
3838 test :
3939 needs : linting
4040 strategy :
Original file line number Diff line number Diff line change @@ -785,7 +785,8 @@ def run_backtests(
785785
786786 print (
787787 f"{ COLOR_YELLOW } Running backtests for date "
788- f"range:{ COLOR_RESET } { COLOR_GREEN } { start_date } - { end_date } for a "
788+ f"range:{ COLOR_RESET } { COLOR_GREEN } { start_date } - "
789+ f"{ end_date } for a "
789790 f"total of { len (algorithms )} algorithms.{ COLOR_RESET } "
790791 )
791792 for algorithm in algorithms :
Original file line number Diff line number Diff line change 55from investing_algorithm_framework .domain .exceptions import \
66 OperationalException
77from investing_algorithm_framework .domain .models .base_model import BaseModel
8- from investing_algorithm_framework .domain .models .order import OrderStatus , \
9- OrderType , OrderSide
8+ from investing_algorithm_framework .domain .models .order .order_status import \
9+ OrderStatus
10+ from investing_algorithm_framework .domain .models .order .order_type import \
11+ OrderType
12+ from investing_algorithm_framework .domain .models .order .order_side import \
13+ OrderSide
1014from investing_algorithm_framework .domain .models .order .order_fee import \
1115 OrderFee
1216
Original file line number Diff line number Diff line change 1717COLOR_GREEN = '\033 [92m'
1818COLOR_YELLOW = '\033 [93m'
1919
20+
2021def print_tables_side_by_side (* tables , spacing : int = 3 ):
21- string_tables_split = [tabulate (t , headers = "firstrow" ).splitlines () for t in tables ]
22+ string_tables_split = [tabulate (t , headers = "firstrow" )
23+ .splitlines () for t in tables ]
2224 spacing_str = " " * spacing
2325
2426 num_lines = max (map (len , string_tables_split ))
@@ -63,7 +65,8 @@ def pretty_print_profit_evaluation(
6365 report .name for report in profits [:number_of_reports ]
6466 ]
6567 profit_table ["Profit" ] = [
66- f"{ report .total_net_gain :.{precision }f} { report .trading_symbol } " for report in profits [:number_of_reports ]
68+ f"{ report .total_net_gain :.{precision }f} { report .trading_symbol } "
69+ for report in profits [:number_of_reports ]
6770 ]
6871 profit_table ["Profit percentage" ] = [
6972 f"{ report .total_net_gain_percentage :.{precision }f} %" for report in profits [:number_of_reports ]
Original file line number Diff line number Diff line change @@ -365,8 +365,6 @@ def get_data(self, **kwargs):
365365 )
366366
367367 file_path = self ._create_file_path ()
368- timeframe_minutes = TimeFrame .from_string (self .timeframe )\
369- .amount_of_minutes
370368 backtest_index_date = kwargs ["backtest_index_date" ]
371369
372370 # Filter the data based on the backtest index date and the end date
You can’t perform that action at this time.
0 commit comments