investing-algorithm-framework 5.0.2__tar.gz → 6.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- investing_algorithm_framework-6.0.0/PKG-INFO +381 -0
- investing_algorithm_framework-6.0.0/README.md +342 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/__init__.py +6 -5
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/__init__.py +3 -1
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/app/algorithm.py +383 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/app.py +53 -33
- investing_algorithm_framework-5.0.2/investing_algorithm_framework/app/algorithm.py → investing_algorithm_framework-6.0.0/investing_algorithm_framework/app/context.py +109 -442
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +2 -1
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/strategy.py +78 -70
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/create_app.py +4 -1
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/dependency_container.py +14 -6
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/__init__.py +5 -2
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/data_structures.py +3 -2
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/__init__.py +6 -2
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/market/market_credential.py +4 -2
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/order/order.py +2 -1
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/order/order_type.py +0 -2
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/domain/models/trade/__init__.py +13 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/trade/trade.py +91 -14
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/domain/models/trade/trade_risk_type.py +34 -0
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +179 -0
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/domain/models/trade/trade_take_profit.py +206 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/backtesting.py +358 -64
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/__init__.py +11 -3
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/__init__.py +6 -3
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py +35 -34
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/csv.py +26 -22
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/order/__init__.py +4 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/order/order.py +8 -17
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/order/order_metadata.py +38 -0
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/trades/__init__.py +9 -0
- {investing_algorithm_framework-5.0.2/investing_algorithm_framework/infrastructure/models → investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/trades}/trade.py +20 -10
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +38 -0
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +39 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/__init__.py +7 -1
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/repositories/order_metadata_repository.py +17 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/repository.py +15 -2
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +23 -0
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +23 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/backtesting/backtest_service.py +6 -8
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py +2 -1
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/order_service/order_service.py +173 -13
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/position_service.py +0 -2
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/strategy_orchestrator_service.py +15 -15
- investing_algorithm_framework-6.0.0/investing_algorithm_framework/services/trade_service/trade_service.py +929 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/pyproject.toml +1 -1
- investing_algorithm_framework-5.0.2/PKG-INFO +0 -367
- investing_algorithm_framework-5.0.2/README.md +0 -328
- investing_algorithm_framework-5.0.2/investing_algorithm_framework/domain/models/trade/__init__.py +0 -4
- investing_algorithm_framework-5.0.2/investing_algorithm_framework/infrastructure/models/order/__init__.py +0 -3
- investing_algorithm_framework-5.0.2/investing_algorithm_framework/services/trade_service/trade_service.py +0 -347
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/LICENSE +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/action_handlers/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/stateless/exception_handler.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/task.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/controllers/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/controllers/orders.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/controllers/portfolio.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/controllers/positions.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/create_app.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/error_handler.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/responses.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/run_strategies.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/schemas/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/schemas/order.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/schemas/portfolio.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/schemas/position.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/app/web/setup_cors.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/create_azure_function_app_skeleton.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/deploy_to_azure_function.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/templates/azure_function_framework_app.py.template +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/templates/azure_function_host.json.template +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/config.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/constants.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/decimal_parsing.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/exceptions.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/metrics/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/metrics/price_efficiency.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/app_mode.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/backtesting/backtest_date_range.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/backtesting/backtest_position.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/backtesting/backtest_report.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/backtesting/backtest_reports_evaluation.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/base_model.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/date_range.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/market/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/market_data_type.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/order/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/order/order_side.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/order/order_status.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/position/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/position/position.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/strategy_profile.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/time_frame.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/time_interval.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/time_unit.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/tracing/trace.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/trade/trade_status.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/trading_data_types.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/models/trading_time_frame.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/market_data_sources.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/market_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/services/rounding_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/singleton.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/stateless_actions.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/strategy.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/csv.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/polars.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/random.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/signatures.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/stoppable_thread.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/domain/utils/synchronized.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/indicators/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/indicators/advanced.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/indicators/momentum.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/indicators/trend.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/indicators/utils.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/database/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/database/sql_alchemy.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/decimal_parser.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/pandas.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/market_data_sources/us_treasury_yield.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/model_extension.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/order_trade_association.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/position/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/position/position.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/order_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/position_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/repositories/trade_repository.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/azure/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/azure/state_handler.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/market_service/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/performance_service/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/performance_service/backtest_performance_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/infrastructure/services/performance_service/performance_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/backtesting/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/configuration_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/market_credential_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/market_data_source_service/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/order_service/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/order_service/order_backtest_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/__init__.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/portfolio_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/position_snapshot_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/repository_service.py +0 -0
- {investing_algorithm_framework-5.0.2 → investing_algorithm_framework-6.0.0}/investing_algorithm_framework/services/trade_service/__init__.py +0 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: investing-algorithm-framework
|
|
3
|
+
Version: 6.0.0
|
|
4
|
+
Summary: A framework for creating trading bots
|
|
5
|
+
Author: MDUYN
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Requires-Dist: Flask (>=2.3.2,<3.0.0)
|
|
13
|
+
Requires-Dist: Flask-Cors (>=3.0.9,<5.0.0)
|
|
14
|
+
Requires-Dist: Flask-Migrate (>=2.6.0,<3.0.0)
|
|
15
|
+
Requires-Dist: MarkupSafe (>=2.1.2,<3.0.0)
|
|
16
|
+
Requires-Dist: SQLAlchemy (>=2.0.18,<3.0.0)
|
|
17
|
+
Requires-Dist: azure-identity (>=1.19.0,<2.0.0)
|
|
18
|
+
Requires-Dist: azure-mgmt-resource (>=23.2.0,<24.0.0)
|
|
19
|
+
Requires-Dist: azure-mgmt-storage (>=21.2.1,<22.0.0)
|
|
20
|
+
Requires-Dist: azure-mgmt-web (>=7.3.1,<8.0.0)
|
|
21
|
+
Requires-Dist: azure-storage-blob (>=12.24.0,<13.0.0)
|
|
22
|
+
Requires-Dist: ccxt (>=4.2.48,<5.0.0)
|
|
23
|
+
Requires-Dist: dependency-injector (>=4.40.0,<5.0.0)
|
|
24
|
+
Requires-Dist: jupyter (>=1.0.0,<2.0.0)
|
|
25
|
+
Requires-Dist: marshmallow (>=3.5.0,<4.0.0)
|
|
26
|
+
Requires-Dist: numpy (>=2.1.3,<3.0.0)
|
|
27
|
+
Requires-Dist: plotly (>=5.22.0,<6.0.0)
|
|
28
|
+
Requires-Dist: polars[numpy,pandas] (>=0.20.10,<0.21.0)
|
|
29
|
+
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
|
30
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
31
|
+
Requires-Dist: schedule (>=1.1.0,<2.0.0)
|
|
32
|
+
Requires-Dist: scipy (>=1.14.1,<2.0.0)
|
|
33
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
|
34
|
+
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
|
|
35
|
+
Requires-Dist: tulipy (>=0.4.0,<0.5.0)
|
|
36
|
+
Requires-Dist: wrapt (>=1.16.0,<2.0.0)
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
<a href=https://investing-algorithm-framework.com><img src="https://img.shields.io/badge/docs-website-brightgreen"></a>
|
|
40
|
+
[](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/publish.yml)
|
|
41
|
+
[](https://github.com/coding-kitties/investing-algorithm-framework/actions/workflows/test.yml)
|
|
42
|
+
[](https://pepy.tech/badge/investing-algorithm-framework)
|
|
43
|
+
[](https://img.shields.io/pypi/v/investing_algorithm_framework.svg)
|
|
44
|
+
<a href="https://www.reddit.com/r/InvestingBots/"><img src="https://img.shields.io/reddit/subreddit-subscribers/investingbots?style=social"></a> <br/>
|
|
45
|
+
[](https://github.com/SeaQL/sea-orm/stargazers/) If you like what we do, consider starring, sharing and contributing!
|
|
46
|
+
|
|
47
|
+
# [Investing Algorithm Framework](https://github.com/coding-kitties/investing-algorithm-framework)
|
|
48
|
+
|
|
49
|
+
The Investing Algorithm Framework is a Python framework that enables swift and elegant development of trading bots.
|
|
50
|
+
|
|
51
|
+
## Sponsors
|
|
52
|
+
|
|
53
|
+
<a href="https://www.finterion.com/" target="_blank">
|
|
54
|
+
<picture style="height: 30px;">
|
|
55
|
+
<source media="(prefers-color-scheme: dark)" srcset="static/sponsors/finterion-dark.png">
|
|
56
|
+
<source media="(prefers-color-scheme: light)" srcset="static/sponsors/finterion-light.png">
|
|
57
|
+
<img src="static/sponsors/finterion-light.svg" alt="Finterion Logo" width="200px" height="50px">
|
|
58
|
+
</picture>
|
|
59
|
+
</a>
|
|
60
|
+
|
|
61
|
+
## Features and planned features:
|
|
62
|
+
|
|
63
|
+
- [x] **Based on Python 3.9+**: Windows, macOS and Linux.
|
|
64
|
+
- [x] **Documentation**: [Documentation](https://investing-algorithm-framework.com)
|
|
65
|
+
- [x] **Persistence of portfolios, orders, positions and trades**: Persistence is achieved through sqlite.
|
|
66
|
+
- [x] **Limit orders**: Create limit orders for buying and selling.
|
|
67
|
+
- [x] **Trade models**: Models and functionality for trades, trades stop losses (fixed and trailing) and take profits (fixed and trailing).
|
|
68
|
+
- [x] **Market data sources**: Market data sources for OHLCV data and ticker data, and extendible with custom data and events.
|
|
69
|
+
- [x] **Polars and Pandas dataframes support** Out of the box dataframes support for fast data processing ([pola.rs](https://pola.rs/), [pandas](https://pandas.pydata.org/)).
|
|
70
|
+
- [x] **Azure Functions support**: Stateless running for cloud function deployments in Azure.
|
|
71
|
+
- [x] **Live trading**: Live trading.
|
|
72
|
+
- [x] **Backtesting and performance analysis reports** [example](./examples/backtest_example)
|
|
73
|
+
- [x] **Backtesting multiple algorithms with different backtest date ranges** [example](./examples/backtests_example)
|
|
74
|
+
- [x] **Backtest comparison and experiments**: Compare multiple backtests and run experiments.
|
|
75
|
+
- [x] **Order execution**: Currently support for a wide range of crypto exchanges through [ccxt](https://github.com/ccxt/ccxt) (Support for traditional asset brokers is planned).
|
|
76
|
+
- [x] **Web API**: Rest API for interacting with your deployed trading bot
|
|
77
|
+
- [x] **PyIndicators**: Works natively with [PyIndicators](https://github.com/coding-kitties/PyIndicators) for technical analysis on your Pandas and Polars dataframes.
|
|
78
|
+
- [ ] **Builtin WebUI (Planned)**: Builtin web UI to manage your bot and evaluate your backtests.
|
|
79
|
+
- [ ] **Manageable via Telegram (Planned)**: Manage the bot with Telegram.
|
|
80
|
+
- [ ] **Performance status report via Web UI and telegram(Planned)**: Provide a performance status of your current trades.
|
|
81
|
+
- [ ] **CI/CD integration (Planned)**: Tools for continuous integration and deployment (version tracking, comparison of backtests, automatic deployments).
|
|
82
|
+
- [ ] **Tracing and replaying of strategies in backtests (Planned)**: Tracing and replaying of strategies in backtests for specific dates and date ranges so you can evaluate your strategy step by step.
|
|
83
|
+
- [ ] **AWS Lambda support (Planned)**: Stateless running for cloud function deployments in AWS.
|
|
84
|
+
- [ ] **Azure App services support (Planned)**: deployments in Azure app services with Web UI.
|
|
85
|
+
|
|
86
|
+
## Example implementation
|
|
87
|
+
|
|
88
|
+
The following algorithm connects to binance and buys BTC every 2 hours.
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
import logging.config
|
|
92
|
+
from dotenv import load_dotenv
|
|
93
|
+
|
|
94
|
+
from investing_algorithm_framework import create_app, PortfolioConfiguration, \
|
|
95
|
+
TimeUnit, CCXTOHLCVMarketDataSource, Context, CCXTTickerMarketDataSource, \
|
|
96
|
+
MarketCredential, DEFAULT_LOGGING_CONFIG, Algorithm, Context
|
|
97
|
+
|
|
98
|
+
load_dotenv()
|
|
99
|
+
logging.config.dictConfig(DEFAULT_LOGGING_CONFIG)
|
|
100
|
+
|
|
101
|
+
# OHLCV data for candles
|
|
102
|
+
bitvavo_btc_eur_ohlcv_2h = CCXTOHLCVMarketDataSource(
|
|
103
|
+
identifier="BTC-ohlcv",
|
|
104
|
+
market="BITVAVO",
|
|
105
|
+
symbol="BTC/EUR",
|
|
106
|
+
time_frame="2h",
|
|
107
|
+
window_size=200
|
|
108
|
+
)
|
|
109
|
+
# Ticker data for orders, trades and positions
|
|
110
|
+
bitvavo_btc_eur_ticker = CCXTTickerMarketDataSource(
|
|
111
|
+
identifier="BTC-ticker",
|
|
112
|
+
market="BITVAVO",
|
|
113
|
+
symbol="BTC/EUR",
|
|
114
|
+
)
|
|
115
|
+
app = create_app()
|
|
116
|
+
|
|
117
|
+
# Bitvavo market credentials are read from .env file, or you can
|
|
118
|
+
# set them manually as params
|
|
119
|
+
app.add_market_credential(MarketCredential(market="bitvavo"))
|
|
120
|
+
app.add_portfolio_configuration(
|
|
121
|
+
PortfolioConfiguration(
|
|
122
|
+
market="bitvavo", trading_symbol="EUR", initial_balance=40
|
|
123
|
+
)
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
algorithm = Algorithm(name="test_algorithm")
|
|
127
|
+
|
|
128
|
+
# Define a strategy for the algorithm that will run every 10 seconds
|
|
129
|
+
@algorithm.strategy(
|
|
130
|
+
time_unit=TimeUnit.SECOND,
|
|
131
|
+
interval=10,
|
|
132
|
+
market_data_sources=[bitvavo_btc_eur_ticker, bitvavo_btc_eur_ohlcv_2h]
|
|
133
|
+
)
|
|
134
|
+
def perform_strategy(context: Context, market_data: dict):
|
|
135
|
+
# Access the data sources with the indentifier
|
|
136
|
+
polars_df = market_data["BTC-ohlcv"]
|
|
137
|
+
ticker_data = market_data["BTC-ticker"]
|
|
138
|
+
unallocated_balance = context.get_unallocated()
|
|
139
|
+
positions = context.get_positions()
|
|
140
|
+
trades = context.get_trades()
|
|
141
|
+
open_trades = context.get_open_trades()
|
|
142
|
+
closed_trades = context.get_closed_trades()
|
|
143
|
+
|
|
144
|
+
app.add_algorithm(algorithm)
|
|
145
|
+
|
|
146
|
+
if __name__ == "__main__":
|
|
147
|
+
app.run()
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
> You can find more examples [here](./examples) folder.
|
|
151
|
+
|
|
152
|
+
## Backtesting and experiments
|
|
153
|
+
|
|
154
|
+
The framework also supports backtesting and performing backtest experiments. After a backtest, you can print a report that shows the performance of your trading bot.
|
|
155
|
+
|
|
156
|
+
To run a single backtest you can use the example code that can be found [here](./examples/backtest_example). Simply run:
|
|
157
|
+
|
|
158
|
+
> Its assumed here that you have cloned the repository, installed the framework and
|
|
159
|
+
> are in the root of the project.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
python examples/backtest_example/run_backtest.py
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Backtesting report
|
|
166
|
+
|
|
167
|
+
You can use the ```pretty_print_backtest``` function to print a backtest report.
|
|
168
|
+
For example if you run the [moving average example trading bot](./examples/backtest_example/run_backtest.py)
|
|
169
|
+
you will get the following backtesting report:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
|
|
173
|
+
:%%%#+- .=*#%%% Backtest report
|
|
174
|
+
*%%%%%%%+------=*%%%%%%%- ---------------------------
|
|
175
|
+
*%%%%%%%%%%%%%%%%%%%%%%%- Start date: 2023-08-24 00:00:00
|
|
176
|
+
.%%%%%%%%%%%%%%%%%%%%%%# End date: 2023-12-02 00:00:00
|
|
177
|
+
#%%%####%%%%%%%%**#%%%+ Number of days: 100
|
|
178
|
+
.:-+*%%%%- -+..#%%%+.+- +%%%#*=-: Number of runs: 1201
|
|
179
|
+
.:-=*%%%%. += .%%# -+.-%%%%=-:.. Number of orders: 14
|
|
180
|
+
.:=+#%%%%%*###%%%%#*+#%%%%%%*+-: Initial balance: 400.0
|
|
181
|
+
+%%%%%%%%%%%%%%%%%%%= Final balance: 417.8982
|
|
182
|
+
:++ .=#%%%%%%%%%%%%%*- Total net gain: 15.4755 3.869%
|
|
183
|
+
:++: :+%%%%%%#-. Growth: 17.8982 4.475%
|
|
184
|
+
:++: .%%%%%#= Number of trades closed: 2
|
|
185
|
+
:++: .#%%%%%#*= Number of trades open(end of backtest): 2
|
|
186
|
+
:++- :%%%%%%%%%+= Percentage positive trades: 75.0%
|
|
187
|
+
.++- -%%%%%%%%%%%+= Percentage negative trades: 25.0%
|
|
188
|
+
.++- .%%%%%%%%%%%%%+= Average trade size: 98.8050 EUR
|
|
189
|
+
.++- *%%%%%%%%%%%%%*+: Average trade duration: 11665.866590240556 hours
|
|
190
|
+
.++- %%%%%%%%%%%%%%#+=
|
|
191
|
+
=++........:::%%%%%%%%%%%%%%*+-
|
|
192
|
+
.=++++++++++**#%%%%%%%%%%%%%++.
|
|
193
|
+
|
|
194
|
+
Positions overview
|
|
195
|
+
╭────────────┬──────────┬──────────────────────┬───────────────────────┬──────────────┬───────────────┬───────────────────────────┬────────────────┬───────────────╮
|
|
196
|
+
│ Position │ Amount │ Pending buy amount │ Pending sell amount │ Cost (EUR) │ Value (EUR) │ Percentage of portfolio │ Growth (EUR) │ Growth_rate │
|
|
197
|
+
├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
|
|
198
|
+
│ EUR │ 218.062 │ 0 │ 0 │ 218.062 │ 218.062 │ 52.1806% │ 0 │ 0.0000% │
|
|
199
|
+
├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
|
|
200
|
+
│ BTC │ 0.0028 │ 0 │ 0 │ 97.4139 │ 99.7171 │ 23.8616% │ 2.3032 │ 2.3644% │
|
|
201
|
+
├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤
|
|
202
|
+
│ DOT │ 19.9084 │ 0 │ 0 │ 99.9999 │ 100.119 │ 23.9578% │ 0.1195 │ 0.1195% │
|
|
203
|
+
╰────────────┴──────────┴──────────────────────┴───────────────────────┴──────────────┴───────────────┴───────────────────────────┴────────────────┴───────────────╯
|
|
204
|
+
Trades overview
|
|
205
|
+
╭───────────────────┬────────────┬─────────────────────────────────┬─────────────────────┬────────────────────────────┬──────────────────────────┬────────────────────┬─────────────────────────────────╮
|
|
206
|
+
│ Pair (Trade id) │ Status │ Net gain (EUR) │ Open date │ Close date │ Duration │ Open price (EUR) │ Close price's (EUR) │
|
|
207
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
208
|
+
│ BTC/EUR (1) │ CLOSED, TP │ 2.9820 (3.0460%) │ 2023-09-13 14:00:00 │ 2025-02-19 15:21:54.823674 │ 12601.365228798333 hours │ 24474.4 │ 25427.69, 25012.105 │
|
|
209
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
210
|
+
│ DOT/EUR (2) │ CLOSED, TP │ 9.3097 (9.3097%) │ 2023-10-30 04:00:00 │ 2025-02-19 15:22:02.227035 │ 11483.3672852875 hours │ 4.0565 │ 4.233, 4.377, 4.807499999999999 │
|
|
211
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
212
|
+
│ BTC/EUR (3) │ CLOSED │ -0.4248 (-0.4322%) │ 2023-11-06 14:00:00 │ 2025-02-19 15:21:59.823557 │ 11305.366617654721 hours │ 32761.8 │ 32620.225 │
|
|
213
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
214
|
+
│ BTC/EUR (4) │ CLOSED, TP │ 3.6086 (3.6364%) │ 2023-11-07 22:00:00 │ 2025-02-19 15:22:02.025198 │ 11273.367229221665 hours │ 33077.9 │ 34637.09, 33924.39 │
|
|
215
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
216
|
+
│ BTC/EUR (5) │ OPEN │ 2.3880 (2.4514%) (unrealized) │ 2023-11-29 12:00:00 │ │ 60.0 hours │ 34790.7 │ │
|
|
217
|
+
├───────────────────┼────────────┼─────────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼─────────────────────────────────┤
|
|
218
|
+
│ DOT/EUR (6) │ OPEN │ -0.0398 (-0.0398%) (unrealized) │ 2023-11-30 18:00:00 │ │ 30.0 hours │ 5.023 │ │
|
|
219
|
+
╰───────────────────┴────────────┴─────────────────────────────────┴─────────────────────┴────────────────────────────┴──────────────────────────┴────────────────────┴─────────────────────────────────╯
|
|
220
|
+
Stop losses overview
|
|
221
|
+
╭────────────────────┬───────────────┬──────────┬────────┬──────────────────────┬────────────────┬────────────────┬───────────────────┬──────────────┬─────────────┬───────────────╮
|
|
222
|
+
│ Trade (Trade id) │ Status │ Active │ Type │ stop loss │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │
|
|
223
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
224
|
+
│ BTC/EUR (1) │ NOT TRIGGERED │ True │ FIXED │ 23250.6847(5.0%) EUR │ 24474.4050 EUR │ None │ 24474.4 │ 50.0% │ 0.0020 BTC │ │
|
|
225
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
226
|
+
│ DOT/EUR (2) │ NOT TRIGGERED │ True │ FIXED │ 3.8537(5.0%) EUR │ 4.0565 EUR │ None │ 4.0565 │ 50.0% │ 12.3259 DOT │ │
|
|
227
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
228
|
+
│ BTC/EUR (3) │ NOT TRIGGERED │ True │ FIXED │ 31123.7242(5.0%) EUR │ 32761.8150 EUR │ None │ 32761.8 │ 50.0% │ 0.0015 BTC │ │
|
|
229
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
230
|
+
│ BTC/EUR (4) │ NOT TRIGGERED │ True │ FIXED │ 31423.9908(5.0%) EUR │ 33077.8850 EUR │ None │ 33077.9 │ 50.0% │ 0.0015 BTC │ │
|
|
231
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
232
|
+
│ BTC/EUR (5) │ NOT TRIGGERED │ True │ FIXED │ 33051.1460(5.0%) EUR │ 34790.6800 EUR │ None │ 34790.7 │ 50.0% │ 0.0014 BTC │ │
|
|
233
|
+
├────────────────────┼───────────────┼──────────┼────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────┤
|
|
234
|
+
│ DOT/EUR (6) │ NOT TRIGGERED │ True │ FIXED │ 4.7718(5.0%) EUR │ 5.0230 EUR │ None │ 5.023 │ 50.0% │ 9.9542 DOT │ │
|
|
235
|
+
╰────────────────────┴───────────────┴──────────┴────────┴──────────────────────┴────────────────┴────────────────┴───────────────────┴──────────────┴─────────────┴───────────────╯
|
|
236
|
+
Take profits overview
|
|
237
|
+
╭────────────────────┬───────────────┬──────────┬──────────┬───────────────────────┬────────────────┬────────────────┬───────────────────┬──────────────┬─────────────┬───────────────────╮
|
|
238
|
+
│ Trade (Trade id) │ Status │ Active │ Type │ Take profit │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │
|
|
239
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
240
|
+
│ BTC/EUR (1) │ TRIGGERED │ False │ TRAILING │ 25698.1253(5.0)% EUR │ 24474.4050 EUR │ 25427.69 │ 25703.77 │ 50.0% │ 0.0020 BTC │ 0.002 │
|
|
241
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
242
|
+
│ BTC/EUR (1) │ NOT TRIGGERED │ True │ TRAILING │ 26921.8455(10.0)% EUR │ 24474.4050 EUR │ None │ │ 20.0% │ 0.0008 BTC │ │
|
|
243
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
244
|
+
│ DOT/EUR (2) │ TRIGGERED │ False │ TRAILING │ 5.1756(5.0)% EUR │ 4.0565 EUR │ 4.233 │ 5.448 │ 50.0% │ 12.3259 DOT │ 12.32585 │
|
|
245
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
246
|
+
│ DOT/EUR (2) │ TRIGGERED │ False │ TRAILING │ 4.9032(10.0)% EUR │ 4.0565 EUR │ 4.377 │ 5.448 │ 20.0% │ 4.9303 DOT │ 4.930340000000001 │
|
|
247
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
248
|
+
│ BTC/EUR (3) │ NOT TRIGGERED │ True │ TRAILING │ 34399.9057(5.0)% EUR │ 32761.8150 EUR │ None │ │ 50.0% │ 0.0015 BTC │ │
|
|
249
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
250
|
+
│ BTC/EUR (3) │ NOT TRIGGERED │ True │ TRAILING │ 36037.9965(10.0)% EUR │ 32761.8150 EUR │ None │ │ 20.0% │ 0.0006 BTC │ │
|
|
251
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
252
|
+
│ BTC/EUR (4) │ TRIGGERED │ False │ TRAILING │ 34731.7793(5.0)% EUR │ 33077.8850 EUR │ 34637.09 │ 34967.12 │ 50.0% │ 0.0015 BTC │ 0.0015 │
|
|
253
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
254
|
+
│ BTC/EUR (4) │ NOT TRIGGERED │ True │ TRAILING │ 36385.6735(10.0)% EUR │ 33077.8850 EUR │ None │ │ 20.0% │ 0.0006 BTC │ │
|
|
255
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
256
|
+
│ BTC/EUR (5) │ NOT TRIGGERED │ True │ TRAILING │ 36530.2140(5.0)% EUR │ 34790.6800 EUR │ None │ │ 50.0% │ 0.0014 BTC │ │
|
|
257
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
258
|
+
│ BTC/EUR (5) │ NOT TRIGGERED │ True │ TRAILING │ 38269.7480(10.0)% EUR │ 34790.6800 EUR │ None │ │ 20.0% │ 0.0006 BTC │ │
|
|
259
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
260
|
+
│ DOT/EUR (6) │ NOT TRIGGERED │ True │ TRAILING │ 5.2741(5.0)% EUR │ 5.0230 EUR │ None │ │ 50.0% │ 9.9542 DOT │ │
|
|
261
|
+
├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼─────────────┼───────────────────┤
|
|
262
|
+
│ DOT/EUR (6) │ NOT TRIGGERED │ True │ TRAILING │ 5.5253(10.0)% EUR │ 5.0230 EUR │ None │ │ 20.0% │ 3.9817 DOT │ │
|
|
263
|
+
╰────────────────────┴───────────────┴──────────┴──────────┴───────────────────────┴────────────────┴────────────────┴───────────────────┴──────────────┴─────────────┴───────────────────╯
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Backtest experiments
|
|
267
|
+
|
|
268
|
+
The framework also supports backtest experiments. Backtest experiments allows you to
|
|
269
|
+
compare multiple algorithms and evaluate their performance. Ideally,
|
|
270
|
+
you would do this by parameterizing your strategy and creating a factory function that
|
|
271
|
+
creates the algorithm with the different parameters. You can find an example of this
|
|
272
|
+
in the [backtest experiments example](./examples/backtest_experiment).
|
|
273
|
+
|
|
274
|
+
## Broker/Exchange configuration
|
|
275
|
+
|
|
276
|
+
The framework has by default support for [ccxt](https://github.com/ccxt/ccxt).
|
|
277
|
+
This should allow you to connect to a lot of brokers/exchanges.
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
from investing_algorithm_framework import PortfolioConfiguration, \
|
|
281
|
+
MarketCredential, create_app
|
|
282
|
+
app = create_app()
|
|
283
|
+
app.add_market_credential(
|
|
284
|
+
MarketCredential(
|
|
285
|
+
market="<your market>",
|
|
286
|
+
api_key="<your api key>",
|
|
287
|
+
secret_key="<your secret key>",
|
|
288
|
+
)
|
|
289
|
+
)
|
|
290
|
+
app.add_portfolio_configuration(
|
|
291
|
+
PortfolioConfiguration(
|
|
292
|
+
market="<your market>",
|
|
293
|
+
initial_balance=400,
|
|
294
|
+
trading_symbol="EUR"
|
|
295
|
+
)
|
|
296
|
+
)
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Performance
|
|
300
|
+
|
|
301
|
+
We are continuously working on improving the performance of the framework. If
|
|
302
|
+
you have any suggestions, please let us know.
|
|
303
|
+
|
|
304
|
+
## How to install
|
|
305
|
+
|
|
306
|
+
You can download the framework with pypi.
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
pip install investing-algorithm-framework
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Installation for local development
|
|
313
|
+
|
|
314
|
+
The framework is built with poetry. To install the framework for local development, you can run the following commands:
|
|
315
|
+
|
|
316
|
+
> Make sure you have poetry installed. If you don't have poetry installed, you can find installation instructions [here](https://python-poetry.org/docs/#installation)
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
git clone http
|
|
320
|
+
cd investing-algorithm-framework
|
|
321
|
+
poetry install
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Running tests
|
|
325
|
+
|
|
326
|
+
To run the tests, you can run the following command:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# In the root of the project
|
|
330
|
+
python -m unittest discover -s tests
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Disclaimer
|
|
334
|
+
|
|
335
|
+
If you use this framework for your investments, do not risk money
|
|
336
|
+
which you are afraid to lose, until you have clear understanding how
|
|
337
|
+
the framework works. We can't stress this enough:
|
|
338
|
+
|
|
339
|
+
BEFORE YOU START USING MONEY WITH THE FRAMEWORK, MAKE SURE THAT YOU TESTED
|
|
340
|
+
YOUR COMPONENTS THOROUGHLY. USE THE SOFTWARE AT YOUR OWN RISK.
|
|
341
|
+
THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR INVESTMENT RESULTS.
|
|
342
|
+
|
|
343
|
+
Also, make sure that you read the source code of any plugin you use or
|
|
344
|
+
implementation of an algorithm made with this framework.
|
|
345
|
+
|
|
346
|
+
## Documentation
|
|
347
|
+
|
|
348
|
+
All the documentation can be found online
|
|
349
|
+
at the [documentation webstie](https://investing-algorithm-framework.com)
|
|
350
|
+
|
|
351
|
+
In most cases, you'll probably never have to change code on this repo directly
|
|
352
|
+
if you are building your algorithm/bot. But if you do, check out the
|
|
353
|
+
contributing page at the website.
|
|
354
|
+
|
|
355
|
+
If you'd like to chat with investing-algorithm-framework users
|
|
356
|
+
and developers, [join us on Slack](https://inv-algo-framework.slack.com) or [join us on reddit](https://www.reddit.com/r/InvestingBots/)
|
|
357
|
+
|
|
358
|
+
## Acknowledgements
|
|
359
|
+
|
|
360
|
+
We want to thank all contributors to this project. A full list of all the people that contributed to the project can be
|
|
361
|
+
found [here](https://github.com/investing-algorithms/investing-algorithm-framework/blob/master/AUTHORS.md)
|
|
362
|
+
|
|
363
|
+
### [Bugs / Issues](https://github.com/investing-algorithms/investing-algorithm-framework/issues?q=is%3Aissue)
|
|
364
|
+
|
|
365
|
+
If you discover a bug in the framework, please [search our issue tracker](https://github.com/investing-algorithms/investing-algorithm-framework/issues?q=is%3Aissue)
|
|
366
|
+
first. If it hasn't been reported, please [create a new issue](https://github.com/investing-algorithms/investing-algorithm-framework/issues/new).
|
|
367
|
+
|
|
368
|
+
### Contributing
|
|
369
|
+
|
|
370
|
+
The investing algorithm framework is a community driven project.
|
|
371
|
+
We welcome you to participate, contribute and together help build the future trading bots developed in python.
|
|
372
|
+
|
|
373
|
+
Feel like the framework is missing a feature? We welcome your pull requests!
|
|
374
|
+
If you want to contribute to the project roadmap, please take a look at the [project board](https://github.com/coding-kitties/investing-algorithm-framework/projects?query=is%3Aopen).
|
|
375
|
+
You can pick up a task by assigning yourself to it.
|
|
376
|
+
|
|
377
|
+
**Note** before starting any major new feature work, *please open an issue describing what you are planning to do*.
|
|
378
|
+
This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.
|
|
379
|
+
|
|
380
|
+
**Important:** Always create your feature or hotfix against the `develop` branch, not `main`.
|
|
381
|
+
|