investing-algorithm-framework 7.19.14__py3-none-any.whl

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

Potentially problematic release.


This version of investing-algorithm-framework might be problematic. Click here for more details.

Files changed (260) hide show
  1. investing_algorithm_framework/__init__.py +197 -0
  2. investing_algorithm_framework/app/__init__.py +47 -0
  3. investing_algorithm_framework/app/algorithm/__init__.py +7 -0
  4. investing_algorithm_framework/app/algorithm/algorithm.py +239 -0
  5. investing_algorithm_framework/app/algorithm/algorithm_factory.py +114 -0
  6. investing_algorithm_framework/app/analysis/__init__.py +15 -0
  7. investing_algorithm_framework/app/analysis/backtest_data_ranges.py +121 -0
  8. investing_algorithm_framework/app/analysis/backtest_utils.py +107 -0
  9. investing_algorithm_framework/app/analysis/permutation.py +116 -0
  10. investing_algorithm_framework/app/analysis/ranking.py +297 -0
  11. investing_algorithm_framework/app/app.py +2204 -0
  12. investing_algorithm_framework/app/app_hook.py +28 -0
  13. investing_algorithm_framework/app/context.py +1667 -0
  14. investing_algorithm_framework/app/eventloop.py +590 -0
  15. investing_algorithm_framework/app/reporting/__init__.py +27 -0
  16. investing_algorithm_framework/app/reporting/ascii.py +921 -0
  17. investing_algorithm_framework/app/reporting/backtest_report.py +349 -0
  18. investing_algorithm_framework/app/reporting/charts/__init__.py +19 -0
  19. investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py +66 -0
  20. investing_algorithm_framework/app/reporting/charts/equity_curve.py +37 -0
  21. investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py +74 -0
  22. investing_algorithm_framework/app/reporting/charts/line_chart.py +11 -0
  23. investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py +70 -0
  24. investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py +51 -0
  25. investing_algorithm_framework/app/reporting/charts/rolling_sharp_ratio.py +79 -0
  26. investing_algorithm_framework/app/reporting/charts/yearly_returns_barchart.py +55 -0
  27. investing_algorithm_framework/app/reporting/generate.py +185 -0
  28. investing_algorithm_framework/app/reporting/tables/__init__.py +11 -0
  29. investing_algorithm_framework/app/reporting/tables/key_metrics_table.py +217 -0
  30. investing_algorithm_framework/app/reporting/tables/stop_loss_table.py +0 -0
  31. investing_algorithm_framework/app/reporting/tables/time_metrics_table.py +80 -0
  32. investing_algorithm_framework/app/reporting/tables/trade_metrics_table.py +147 -0
  33. investing_algorithm_framework/app/reporting/tables/trades_table.py +75 -0
  34. investing_algorithm_framework/app/reporting/tables/utils.py +29 -0
  35. investing_algorithm_framework/app/reporting/templates/report_template.html.j2 +154 -0
  36. investing_algorithm_framework/app/stateless/__init__.py +35 -0
  37. investing_algorithm_framework/app/stateless/action_handlers/__init__.py +84 -0
  38. investing_algorithm_framework/app/stateless/action_handlers/action_handler_strategy.py +8 -0
  39. investing_algorithm_framework/app/stateless/action_handlers/check_online_handler.py +15 -0
  40. investing_algorithm_framework/app/stateless/action_handlers/run_strategy_handler.py +40 -0
  41. investing_algorithm_framework/app/stateless/exception_handler.py +40 -0
  42. investing_algorithm_framework/app/strategy.py +675 -0
  43. investing_algorithm_framework/app/task.py +41 -0
  44. investing_algorithm_framework/app/web/__init__.py +5 -0
  45. investing_algorithm_framework/app/web/controllers/__init__.py +13 -0
  46. investing_algorithm_framework/app/web/controllers/orders.py +20 -0
  47. investing_algorithm_framework/app/web/controllers/portfolio.py +20 -0
  48. investing_algorithm_framework/app/web/controllers/positions.py +18 -0
  49. investing_algorithm_framework/app/web/create_app.py +20 -0
  50. investing_algorithm_framework/app/web/error_handler.py +59 -0
  51. investing_algorithm_framework/app/web/responses.py +20 -0
  52. investing_algorithm_framework/app/web/run_strategies.py +4 -0
  53. investing_algorithm_framework/app/web/schemas/__init__.py +12 -0
  54. investing_algorithm_framework/app/web/schemas/order.py +12 -0
  55. investing_algorithm_framework/app/web/schemas/portfolio.py +22 -0
  56. investing_algorithm_framework/app/web/schemas/position.py +15 -0
  57. investing_algorithm_framework/app/web/setup_cors.py +6 -0
  58. investing_algorithm_framework/cli/__init__.py +0 -0
  59. investing_algorithm_framework/cli/cli.py +207 -0
  60. investing_algorithm_framework/cli/deploy_to_aws_lambda.py +499 -0
  61. investing_algorithm_framework/cli/deploy_to_azure_function.py +718 -0
  62. investing_algorithm_framework/cli/initialize_app.py +603 -0
  63. investing_algorithm_framework/cli/templates/.gitignore.template +178 -0
  64. investing_algorithm_framework/cli/templates/app.py.template +18 -0
  65. investing_algorithm_framework/cli/templates/app_aws_lambda_function.py.template +48 -0
  66. investing_algorithm_framework/cli/templates/app_azure_function.py.template +14 -0
  67. investing_algorithm_framework/cli/templates/app_web.py.template +18 -0
  68. investing_algorithm_framework/cli/templates/aws_lambda_dockerfile.template +22 -0
  69. investing_algorithm_framework/cli/templates/aws_lambda_dockerignore.template +92 -0
  70. investing_algorithm_framework/cli/templates/aws_lambda_readme.md.template +110 -0
  71. investing_algorithm_framework/cli/templates/aws_lambda_requirements.txt.template +2 -0
  72. investing_algorithm_framework/cli/templates/azure_function_function_app.py.template +65 -0
  73. investing_algorithm_framework/cli/templates/azure_function_host.json.template +15 -0
  74. investing_algorithm_framework/cli/templates/azure_function_local.settings.json.template +8 -0
  75. investing_algorithm_framework/cli/templates/azure_function_requirements.txt.template +3 -0
  76. investing_algorithm_framework/cli/templates/data_providers.py.template +17 -0
  77. investing_algorithm_framework/cli/templates/env.example.template +2 -0
  78. investing_algorithm_framework/cli/templates/env_azure_function.example.template +4 -0
  79. investing_algorithm_framework/cli/templates/market_data_providers.py.template +9 -0
  80. investing_algorithm_framework/cli/templates/readme.md.template +135 -0
  81. investing_algorithm_framework/cli/templates/requirements.txt.template +2 -0
  82. investing_algorithm_framework/cli/templates/run_backtest.py.template +20 -0
  83. investing_algorithm_framework/cli/templates/strategy.py.template +124 -0
  84. investing_algorithm_framework/create_app.py +54 -0
  85. investing_algorithm_framework/dependency_container.py +155 -0
  86. investing_algorithm_framework/domain/__init__.py +148 -0
  87. investing_algorithm_framework/domain/backtesting/__init__.py +21 -0
  88. investing_algorithm_framework/domain/backtesting/backtest.py +503 -0
  89. investing_algorithm_framework/domain/backtesting/backtest_date_range.py +96 -0
  90. investing_algorithm_framework/domain/backtesting/backtest_evaluation_focuss.py +242 -0
  91. investing_algorithm_framework/domain/backtesting/backtest_metrics.py +459 -0
  92. investing_algorithm_framework/domain/backtesting/backtest_permutation_test.py +275 -0
  93. investing_algorithm_framework/domain/backtesting/backtest_run.py +435 -0
  94. investing_algorithm_framework/domain/backtesting/backtest_summary_metrics.py +162 -0
  95. investing_algorithm_framework/domain/backtesting/combine_backtests.py +280 -0
  96. investing_algorithm_framework/domain/config.py +111 -0
  97. investing_algorithm_framework/domain/constants.py +83 -0
  98. investing_algorithm_framework/domain/data_provider.py +334 -0
  99. investing_algorithm_framework/domain/data_structures.py +42 -0
  100. investing_algorithm_framework/domain/decimal_parsing.py +40 -0
  101. investing_algorithm_framework/domain/exceptions.py +112 -0
  102. investing_algorithm_framework/domain/models/__init__.py +43 -0
  103. investing_algorithm_framework/domain/models/app_mode.py +34 -0
  104. investing_algorithm_framework/domain/models/base_model.py +25 -0
  105. investing_algorithm_framework/domain/models/data/__init__.py +7 -0
  106. investing_algorithm_framework/domain/models/data/data_source.py +214 -0
  107. investing_algorithm_framework/domain/models/data/data_type.py +46 -0
  108. investing_algorithm_framework/domain/models/event.py +35 -0
  109. investing_algorithm_framework/domain/models/market/__init__.py +5 -0
  110. investing_algorithm_framework/domain/models/market/market_credential.py +88 -0
  111. investing_algorithm_framework/domain/models/order/__init__.py +6 -0
  112. investing_algorithm_framework/domain/models/order/order.py +384 -0
  113. investing_algorithm_framework/domain/models/order/order_side.py +36 -0
  114. investing_algorithm_framework/domain/models/order/order_status.py +37 -0
  115. investing_algorithm_framework/domain/models/order/order_type.py +30 -0
  116. investing_algorithm_framework/domain/models/portfolio/__init__.py +9 -0
  117. investing_algorithm_framework/domain/models/portfolio/portfolio.py +169 -0
  118. investing_algorithm_framework/domain/models/portfolio/portfolio_configuration.py +93 -0
  119. investing_algorithm_framework/domain/models/portfolio/portfolio_snapshot.py +208 -0
  120. investing_algorithm_framework/domain/models/position/__init__.py +4 -0
  121. investing_algorithm_framework/domain/models/position/position.py +68 -0
  122. investing_algorithm_framework/domain/models/position/position_snapshot.py +47 -0
  123. investing_algorithm_framework/domain/models/snapshot_interval.py +45 -0
  124. investing_algorithm_framework/domain/models/strategy_profile.py +33 -0
  125. investing_algorithm_framework/domain/models/time_frame.py +153 -0
  126. investing_algorithm_framework/domain/models/time_interval.py +124 -0
  127. investing_algorithm_framework/domain/models/time_unit.py +149 -0
  128. investing_algorithm_framework/domain/models/tracing/__init__.py +0 -0
  129. investing_algorithm_framework/domain/models/tracing/trace.py +23 -0
  130. investing_algorithm_framework/domain/models/trade/__init__.py +13 -0
  131. investing_algorithm_framework/domain/models/trade/trade.py +388 -0
  132. investing_algorithm_framework/domain/models/trade/trade_risk_type.py +34 -0
  133. investing_algorithm_framework/domain/models/trade/trade_status.py +40 -0
  134. investing_algorithm_framework/domain/models/trade/trade_stop_loss.py +267 -0
  135. investing_algorithm_framework/domain/models/trade/trade_take_profit.py +303 -0
  136. investing_algorithm_framework/domain/order_executor.py +112 -0
  137. investing_algorithm_framework/domain/portfolio_provider.py +118 -0
  138. investing_algorithm_framework/domain/positions/__init__.py +4 -0
  139. investing_algorithm_framework/domain/positions/position_size.py +41 -0
  140. investing_algorithm_framework/domain/services/__init__.py +11 -0
  141. investing_algorithm_framework/domain/services/market_credential_service.py +37 -0
  142. investing_algorithm_framework/domain/services/portfolios/__init__.py +5 -0
  143. investing_algorithm_framework/domain/services/portfolios/portfolio_sync_service.py +9 -0
  144. investing_algorithm_framework/domain/services/rounding_service.py +27 -0
  145. investing_algorithm_framework/domain/services/state_handler.py +38 -0
  146. investing_algorithm_framework/domain/stateless_actions.py +7 -0
  147. investing_algorithm_framework/domain/strategy.py +44 -0
  148. investing_algorithm_framework/domain/utils/__init__.py +27 -0
  149. investing_algorithm_framework/domain/utils/csv.py +104 -0
  150. investing_algorithm_framework/domain/utils/custom_tqdm.py +22 -0
  151. investing_algorithm_framework/domain/utils/dates.py +57 -0
  152. investing_algorithm_framework/domain/utils/jupyter_notebook_detection.py +19 -0
  153. investing_algorithm_framework/domain/utils/polars.py +53 -0
  154. investing_algorithm_framework/domain/utils/random.py +41 -0
  155. investing_algorithm_framework/domain/utils/signatures.py +17 -0
  156. investing_algorithm_framework/domain/utils/stoppable_thread.py +26 -0
  157. investing_algorithm_framework/domain/utils/synchronized.py +12 -0
  158. investing_algorithm_framework/download_data.py +108 -0
  159. investing_algorithm_framework/infrastructure/__init__.py +50 -0
  160. investing_algorithm_framework/infrastructure/data_providers/__init__.py +36 -0
  161. investing_algorithm_framework/infrastructure/data_providers/ccxt.py +1143 -0
  162. investing_algorithm_framework/infrastructure/data_providers/csv.py +568 -0
  163. investing_algorithm_framework/infrastructure/data_providers/pandas.py +599 -0
  164. investing_algorithm_framework/infrastructure/database/__init__.py +10 -0
  165. investing_algorithm_framework/infrastructure/database/sql_alchemy.py +120 -0
  166. investing_algorithm_framework/infrastructure/models/__init__.py +16 -0
  167. investing_algorithm_framework/infrastructure/models/decimal_parser.py +14 -0
  168. investing_algorithm_framework/infrastructure/models/model_extension.py +6 -0
  169. investing_algorithm_framework/infrastructure/models/order/__init__.py +4 -0
  170. investing_algorithm_framework/infrastructure/models/order/order.py +124 -0
  171. investing_algorithm_framework/infrastructure/models/order/order_metadata.py +44 -0
  172. investing_algorithm_framework/infrastructure/models/order_trade_association.py +10 -0
  173. investing_algorithm_framework/infrastructure/models/portfolio/__init__.py +4 -0
  174. investing_algorithm_framework/infrastructure/models/portfolio/portfolio_snapshot.py +37 -0
  175. investing_algorithm_framework/infrastructure/models/portfolio/sql_portfolio.py +114 -0
  176. investing_algorithm_framework/infrastructure/models/position/__init__.py +4 -0
  177. investing_algorithm_framework/infrastructure/models/position/position.py +63 -0
  178. investing_algorithm_framework/infrastructure/models/position/position_snapshot.py +23 -0
  179. investing_algorithm_framework/infrastructure/models/trades/__init__.py +9 -0
  180. investing_algorithm_framework/infrastructure/models/trades/trade.py +130 -0
  181. investing_algorithm_framework/infrastructure/models/trades/trade_stop_loss.py +40 -0
  182. investing_algorithm_framework/infrastructure/models/trades/trade_take_profit.py +41 -0
  183. investing_algorithm_framework/infrastructure/order_executors/__init__.py +21 -0
  184. investing_algorithm_framework/infrastructure/order_executors/backtest_oder_executor.py +28 -0
  185. investing_algorithm_framework/infrastructure/order_executors/ccxt_order_executor.py +200 -0
  186. investing_algorithm_framework/infrastructure/portfolio_providers/__init__.py +19 -0
  187. investing_algorithm_framework/infrastructure/portfolio_providers/ccxt_portfolio_provider.py +199 -0
  188. investing_algorithm_framework/infrastructure/repositories/__init__.py +21 -0
  189. investing_algorithm_framework/infrastructure/repositories/order_metadata_repository.py +17 -0
  190. investing_algorithm_framework/infrastructure/repositories/order_repository.py +96 -0
  191. investing_algorithm_framework/infrastructure/repositories/portfolio_repository.py +30 -0
  192. investing_algorithm_framework/infrastructure/repositories/portfolio_snapshot_repository.py +56 -0
  193. investing_algorithm_framework/infrastructure/repositories/position_repository.py +66 -0
  194. investing_algorithm_framework/infrastructure/repositories/position_snapshot_repository.py +21 -0
  195. investing_algorithm_framework/infrastructure/repositories/repository.py +299 -0
  196. investing_algorithm_framework/infrastructure/repositories/trade_repository.py +71 -0
  197. investing_algorithm_framework/infrastructure/repositories/trade_stop_loss_repository.py +23 -0
  198. investing_algorithm_framework/infrastructure/repositories/trade_take_profit_repository.py +23 -0
  199. investing_algorithm_framework/infrastructure/services/__init__.py +7 -0
  200. investing_algorithm_framework/infrastructure/services/aws/__init__.py +6 -0
  201. investing_algorithm_framework/infrastructure/services/aws/state_handler.py +113 -0
  202. investing_algorithm_framework/infrastructure/services/azure/__init__.py +5 -0
  203. investing_algorithm_framework/infrastructure/services/azure/state_handler.py +158 -0
  204. investing_algorithm_framework/services/__init__.py +132 -0
  205. investing_algorithm_framework/services/backtesting/__init__.py +5 -0
  206. investing_algorithm_framework/services/backtesting/backtest_service.py +651 -0
  207. investing_algorithm_framework/services/configuration_service.py +96 -0
  208. investing_algorithm_framework/services/data_providers/__init__.py +5 -0
  209. investing_algorithm_framework/services/data_providers/data_provider_service.py +850 -0
  210. investing_algorithm_framework/services/market_credential_service.py +40 -0
  211. investing_algorithm_framework/services/metrics/__init__.py +114 -0
  212. investing_algorithm_framework/services/metrics/alpha.py +0 -0
  213. investing_algorithm_framework/services/metrics/beta.py +0 -0
  214. investing_algorithm_framework/services/metrics/cagr.py +60 -0
  215. investing_algorithm_framework/services/metrics/calmar_ratio.py +40 -0
  216. investing_algorithm_framework/services/metrics/drawdown.py +181 -0
  217. investing_algorithm_framework/services/metrics/equity_curve.py +24 -0
  218. investing_algorithm_framework/services/metrics/exposure.py +210 -0
  219. investing_algorithm_framework/services/metrics/generate.py +358 -0
  220. investing_algorithm_framework/services/metrics/mean_daily_return.py +83 -0
  221. investing_algorithm_framework/services/metrics/price_efficiency.py +57 -0
  222. investing_algorithm_framework/services/metrics/profit_factor.py +165 -0
  223. investing_algorithm_framework/services/metrics/recovery.py +113 -0
  224. investing_algorithm_framework/services/metrics/returns.py +452 -0
  225. investing_algorithm_framework/services/metrics/risk_free_rate.py +28 -0
  226. investing_algorithm_framework/services/metrics/sharpe_ratio.py +137 -0
  227. investing_algorithm_framework/services/metrics/sortino_ratio.py +74 -0
  228. investing_algorithm_framework/services/metrics/standard_deviation.py +157 -0
  229. investing_algorithm_framework/services/metrics/trades.py +500 -0
  230. investing_algorithm_framework/services/metrics/treynor_ratio.py +0 -0
  231. investing_algorithm_framework/services/metrics/ulcer.py +0 -0
  232. investing_algorithm_framework/services/metrics/value_at_risk.py +0 -0
  233. investing_algorithm_framework/services/metrics/volatility.py +97 -0
  234. investing_algorithm_framework/services/metrics/win_rate.py +177 -0
  235. investing_algorithm_framework/services/order_service/__init__.py +9 -0
  236. investing_algorithm_framework/services/order_service/order_backtest_service.py +178 -0
  237. investing_algorithm_framework/services/order_service/order_executor_lookup.py +110 -0
  238. investing_algorithm_framework/services/order_service/order_service.py +826 -0
  239. investing_algorithm_framework/services/portfolios/__init__.py +16 -0
  240. investing_algorithm_framework/services/portfolios/backtest_portfolio_service.py +54 -0
  241. investing_algorithm_framework/services/portfolios/portfolio_configuration_service.py +75 -0
  242. investing_algorithm_framework/services/portfolios/portfolio_provider_lookup.py +106 -0
  243. investing_algorithm_framework/services/portfolios/portfolio_service.py +188 -0
  244. investing_algorithm_framework/services/portfolios/portfolio_snapshot_service.py +136 -0
  245. investing_algorithm_framework/services/portfolios/portfolio_sync_service.py +182 -0
  246. investing_algorithm_framework/services/positions/__init__.py +7 -0
  247. investing_algorithm_framework/services/positions/position_service.py +210 -0
  248. investing_algorithm_framework/services/positions/position_snapshot_service.py +18 -0
  249. investing_algorithm_framework/services/repository_service.py +40 -0
  250. investing_algorithm_framework/services/trade_order_evaluator/__init__.py +9 -0
  251. investing_algorithm_framework/services/trade_order_evaluator/backtest_trade_oder_evaluator.py +132 -0
  252. investing_algorithm_framework/services/trade_order_evaluator/default_trade_order_evaluator.py +66 -0
  253. investing_algorithm_framework/services/trade_order_evaluator/trade_order_evaluator.py +41 -0
  254. investing_algorithm_framework/services/trade_service/__init__.py +3 -0
  255. investing_algorithm_framework/services/trade_service/trade_service.py +1083 -0
  256. investing_algorithm_framework-7.19.14.dist-info/LICENSE +201 -0
  257. investing_algorithm_framework-7.19.14.dist-info/METADATA +459 -0
  258. investing_algorithm_framework-7.19.14.dist-info/RECORD +260 -0
  259. investing_algorithm_framework-7.19.14.dist-info/WHEEL +4 -0
  260. investing_algorithm_framework-7.19.14.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,162 @@
1
+ import json
2
+ import os
3
+ from dataclasses import dataclass
4
+ from logging import getLogger
5
+ from pathlib import Path
6
+
7
+ logger = getLogger(__name__)
8
+
9
+
10
+ @dataclass
11
+ class BacktestSummaryMetrics:
12
+ """
13
+ Represents the summarized results of a backtest,
14
+ focusing on key headline performance and risk metrics.
15
+
16
+ Attributes:
17
+ total_net_gain (float): Total net gain from the backtest.
18
+ total_net_gain_percentage (float): Total net gain percentage
19
+ from the backtest.
20
+ total_loss (float): Total gross loss from all trades.
21
+ total_loss_percentage (float): Total gross loss percentage.
22
+ total_growth (float): Total growth from the backtest.
23
+ total_growth_percentage (float): Total growth percentage
24
+ from the backtest.
25
+ average_net_gain (float): Average returns across multiple backtests.
26
+ average_net_gain_percentage (float): Average return percentage across
27
+ multiple backtests.
28
+ average_growth (float): Average growth across multiple backtests.
29
+ average_growth_percentage (float): Average growth percentage across
30
+ multiple backtests.
31
+ average_loss (float): Average loss across multiple backtests.
32
+ average_loss_percentage (float): Average loss percentage across
33
+ multiple backtests.
34
+ average_trade_return (float): Average return per trade.
35
+ average_trade_return_percentage (float): Average return percentage
36
+ per trade.
37
+ average_trade_loss (float): Total gross loss from all trades.
38
+ average_trade_loss_percentage (float): Average trade loss percentage.
39
+ average_trade_gain (float): Average gain from winning trades.
40
+ average_trade_gain_percentage (float): Average gain percentage
41
+ cagr (float): Compound annual growth rate of the backtest.
42
+ sharpe_ratio (float): Sharpe ratio, risk-adjusted return.
43
+ sortino_ratio (float): Sortino ratio, downside-risk adjusted return.
44
+ calmar_ratio (float): CAGR relative to max drawdown.
45
+ profit_factor (float): Total profit / total loss.
46
+ annual_volatility (float): Annualized volatility of returns.
47
+ max_drawdown (float): Maximum drawdown observed.
48
+ max_drawdown_duration (int): Duration of the maximum drawdown.
49
+ trades_per_year (float): Average trades executed per year.
50
+ win_rate (float): Percentage of winning trades.
51
+ current_win_rate (float): Win rate over recent trades.
52
+ win_loss_ratio (float): Ratio of average win to average loss.
53
+ current_win_loss_ratio (float): Win/loss ratio over recent trades.
54
+ number_of_trades (int): Total number of trades executed.
55
+ cumulative_exposure (float): Total exposure over the backtest period.
56
+ exposure_ratio (float): Ratio of exposure to available capital.
57
+ """
58
+ total_net_gain: float = None
59
+ total_net_gain_percentage: float = None
60
+ total_growth: float = None
61
+ total_growth_percentage: float = None
62
+ total_loss: float = None
63
+ total_loss_percentage: float = None
64
+ average_net_gain: float = None
65
+ average_net_gain_percentage: float = None
66
+ average_growth: float = None
67
+ average_growth_percentage: float = None
68
+ average_loss: float = None
69
+ average_loss_percentage: float = None
70
+ average_trade_return: float = None
71
+ average_trade_return_percentage: float = None
72
+ average_trade_loss: float = None
73
+ average_trade_loss_percentage: float = None
74
+ average_trade_gain: float = None
75
+ average_trade_gain_percentage: float = None
76
+ cagr: float = None
77
+ sharpe_ratio: float = None
78
+ sortino_ratio: float = None
79
+ calmar_ratio: float = None
80
+ profit_factor: float = None
81
+ annual_volatility: float = None
82
+ max_drawdown: float = None
83
+ max_drawdown_duration: int = None
84
+ trades_per_year: float = None
85
+ win_rate: float = None
86
+ current_win_rate: float = None
87
+ win_loss_ratio: float = None
88
+ current_win_loss_ratio: float = None
89
+ number_of_trades: int = None
90
+ number_of_trades_closed: int = None
91
+ cumulative_exposure: float = None
92
+ exposure_ratio: float = None
93
+
94
+ def to_dict(self) -> dict:
95
+ """
96
+ Convert the BacktestSummaryMetrics instance to a dictionary.
97
+ """
98
+ return {
99
+ "total_net_gain": self.total_net_gain,
100
+ "total_net_gain_percentage": self.total_net_gain_percentage,
101
+ "total_growth": self.total_growth,
102
+ "total_growth_percentage": self.total_growth_percentage,
103
+ "total_loss": self.total_loss,
104
+ "total_loss_percentage": self.total_loss_percentage,
105
+ "average_loss": self.average_loss,
106
+ "average_loss_percentage": self.average_loss_percentage,
107
+ "average_net_gain": self.average_net_gain,
108
+ "average_net_gain_percentage": self.average_net_gain_percentage,
109
+ "average_growth": self.average_growth,
110
+ "average_growth_percentage": self.average_growth_percentage,
111
+ "average_trade_return": self.average_trade_return,
112
+ "average_trade_return_percentage":
113
+ self.average_trade_return_percentage,
114
+ "average_trade_loss": self.average_trade_loss,
115
+ "average_trade_loss_percentage":
116
+ self.average_trade_loss_percentage,
117
+ "average_trade_gain": self.average_trade_gain,
118
+ "average_trade_gain_percentage":
119
+ self.average_trade_gain_percentage,
120
+ "cagr": self.cagr,
121
+ "sharpe_ratio": self.sharpe_ratio,
122
+ "sortino_ratio": self.sortino_ratio,
123
+ "calmar_ratio": self.calmar_ratio,
124
+ "profit_factor": self.profit_factor,
125
+ "annual_volatility": self.annual_volatility,
126
+ "max_drawdown": self.max_drawdown,
127
+ "max_drawdown_duration": self.max_drawdown_duration,
128
+ "trades_per_year": self.trades_per_year,
129
+ "win_rate": self.win_rate,
130
+ "current_win_rate": self.current_win_rate,
131
+ "win_loss_ratio": self.win_loss_ratio,
132
+ "current_win_loss_ratio": self.current_win_loss_ratio,
133
+ "number_of_trades": self.number_of_trades,
134
+ "number_of_trades_closed": self.number_of_trades_closed,
135
+ "cumulative_exposure": self.cumulative_exposure,
136
+ "exposure_ratio": self.exposure_ratio,
137
+ }
138
+
139
+ def save(self, file_path: str | Path) -> None:
140
+ """
141
+ Save the summary metrics to a JSON file.
142
+ """
143
+ with open(file_path, 'w') as file:
144
+ json.dump(self.to_dict(), file, indent=4, default=str)
145
+
146
+ @staticmethod
147
+ def open(file_path: str | Path) -> 'BacktestSummaryMetrics':
148
+ """
149
+ Load summary metrics from a JSON file.
150
+ """
151
+ if not os.path.exists(file_path):
152
+ raise FileNotFoundError(f"Metrics file not found at {file_path}")
153
+
154
+ with open(file_path, 'r') as file:
155
+ data = json.load(file)
156
+
157
+ return BacktestSummaryMetrics(**data)
158
+
159
+ def __repr__(self):
160
+ return json.dumps(
161
+ self.to_dict(), indent=4, sort_keys=True, default=str
162
+ )
@@ -0,0 +1,280 @@
1
+ import logging
2
+ from typing import List
3
+
4
+ from .backtest_metrics import BacktestMetrics
5
+ from .backtest_summary_metrics import BacktestSummaryMetrics
6
+
7
+ logger = logging.getLogger("investing_algorithm_framework")
8
+
9
+
10
+ def safe_weighted_mean(values, weights):
11
+ """
12
+ Calculate the weighted mean of a list of values,
13
+ ignoring None values and weights <= 0.
14
+
15
+ Args:
16
+ values (List[float | None]): List of values to average.
17
+ weights (List[float | None]): Corresponding weights for the values.
18
+
19
+ Returns:
20
+ float | None: The weighted mean, or None if no valid values.
21
+ """
22
+ vals = [(v, w) for v, w in zip(values, weights) if
23
+ v is not None and w is not None and w > 0]
24
+ if not vals:
25
+ return None
26
+ total_weight = sum(w for _, w in vals)
27
+ return sum(
28
+ v * w for v, w in vals
29
+ ) / total_weight if total_weight > 0 else None
30
+
31
+
32
+ def combine_backtests(backtests):
33
+ """
34
+ Combine multiple backtests into a single backtest by aggregating
35
+ their results.
36
+
37
+ Args:
38
+ backtests (List[Backtest]): List of Backtest instances to combine.
39
+
40
+ Returns:
41
+ Backtest: A new Backtest instance representing the combined results.
42
+ """
43
+ backtest_metrics = []
44
+ backtest_runs = []
45
+
46
+ for backtest in backtests:
47
+ backtest_runs += backtest.get_all_backtest_runs()
48
+ backtest_metrics += backtest.get_all_backtest_metrics()
49
+
50
+ summary = generate_backtest_summary_metrics(backtest_metrics)
51
+
52
+ metadata = None
53
+ risk_free_rate = None
54
+
55
+ # Check if there are duplicate backtest runs
56
+ unique_date_ranges = set()
57
+ for backtest in backtests:
58
+ for run in backtest.get_all_backtest_runs():
59
+ date_range = (run.backtest_start_date, run.backtest_end_date)
60
+ if date_range in unique_date_ranges:
61
+ logger.warning(
62
+ "Duplicate backtest run detected for date range: "
63
+ f"{date_range} when combining backtests."
64
+ )
65
+ unique_date_ranges.add(date_range)
66
+
67
+ # Merge all metadata dictionaries
68
+ metadata = {}
69
+ for backtest in backtests:
70
+ if backtest.metadata:
71
+ metadata.update(backtest.metadata)
72
+
73
+ # Get the first risk-free rate
74
+ for backtest in backtests:
75
+ if backtest.risk_free_rate is not None:
76
+ risk_free_rate = backtest.risk_free_rate
77
+ break
78
+ from .backtest import Backtest
79
+
80
+ backtest = Backtest(
81
+ backtest_summary=summary,
82
+ metadata=metadata,
83
+ risk_free_rate=risk_free_rate,
84
+ backtest_runs=backtest_runs
85
+ )
86
+ return backtest
87
+
88
+
89
+ def generate_backtest_summary_metrics(
90
+ backtest_metrics: List[BacktestMetrics]
91
+ ) -> BacktestSummaryMetrics:
92
+ """
93
+ Combine multiple BacktestMetrics into a single BacktestMetrics
94
+ by aggregating their results.
95
+
96
+ Args:
97
+ backtest_metrics (List[BacktestMetrics]): List of BacktestMetrics
98
+ instances to combine.
99
+
100
+ Returns:
101
+ BacktestMetrics: A new BacktestMetrics instance representing the
102
+ combined results.
103
+ """
104
+ total_net_gain = sum(
105
+ b.total_net_gain for b in backtest_metrics
106
+ if b.total_net_gain is not None
107
+ )
108
+ total_net_gain_percentage = sum(
109
+ b.total_net_gain_percentage for b in backtest_metrics
110
+ if b.total_net_gain_percentage is not None
111
+ )
112
+ average_total_net_gain = safe_weighted_mean(
113
+ [b.total_net_gain for b in backtest_metrics],
114
+ [b.total_number_of_days for b in backtest_metrics]
115
+ )
116
+ average_total_net_gain_percentage = safe_weighted_mean(
117
+ [b.total_net_gain_percentage for b in backtest_metrics],
118
+ [b.total_number_of_days for b in backtest_metrics]
119
+ )
120
+ total_loss = sum(
121
+ b.gross_loss for b in backtest_metrics
122
+ if b.gross_loss is not None
123
+ )
124
+ total_loss_percentage = sum(
125
+ b.total_loss_percentage for b in backtest_metrics
126
+ if b.total_loss_percentage is not None
127
+ )
128
+ average_total_loss = safe_weighted_mean(
129
+ [b.gross_loss for b in backtest_metrics],
130
+ [b.total_number_of_days for b in backtest_metrics]
131
+ )
132
+ average_total_loss_percentage = safe_weighted_mean(
133
+ [b.total_loss_percentage for b in backtest_metrics],
134
+ [b.total_number_of_days for b in backtest_metrics]
135
+ )
136
+ total_growth = sum(
137
+ b.total_growth for b in backtest_metrics
138
+ if b.total_growth is not None
139
+ )
140
+ total_growth_percentage = sum(
141
+ b.total_growth_percentage for b in backtest_metrics
142
+ if b.total_growth_percentage is not None
143
+ )
144
+ average_growth = safe_weighted_mean(
145
+ [b.total_growth for b in backtest_metrics],
146
+ [b.total_number_of_days for b in backtest_metrics]
147
+ )
148
+ average_growth_percentage = safe_weighted_mean(
149
+ [b.total_growth_percentage for b in backtest_metrics],
150
+ [b.total_number_of_days for b in backtest_metrics]
151
+ )
152
+ cagr = safe_weighted_mean(
153
+ [b.cagr for b in backtest_metrics],
154
+ [b.total_number_of_days for b in backtest_metrics]
155
+ )
156
+ sharp_ratio = safe_weighted_mean(
157
+ [b.sharpe_ratio for b in backtest_metrics],
158
+ [b.total_number_of_days for b in backtest_metrics]
159
+ )
160
+ sortino_ratio = safe_weighted_mean(
161
+ [b.sortino_ratio for b in backtest_metrics],
162
+ [b.total_number_of_days for b in backtest_metrics]
163
+ )
164
+ calmar_ratio = safe_weighted_mean(
165
+ [b.calmar_ratio for b in backtest_metrics],
166
+ [b.total_number_of_days for b in backtest_metrics]
167
+ )
168
+ profit_factor = safe_weighted_mean(
169
+ [b.profit_factor for b in backtest_metrics],
170
+ [b.total_number_of_days for b in backtest_metrics]
171
+ )
172
+ annual_volatility = safe_weighted_mean(
173
+ [b.annual_volatility for b in backtest_metrics],
174
+ [b.total_number_of_days for b in backtest_metrics]
175
+ )
176
+ max_drawdown = max(
177
+ (b.max_drawdown for b in backtest_metrics
178
+ if b.max_drawdown is not None), default=None
179
+ )
180
+ max_drawdown_duration = max(
181
+ (b.max_drawdown_duration for b in backtest_metrics
182
+ if b.max_drawdown_duration is not None), default=None
183
+ )
184
+ trades_per_year = safe_weighted_mean(
185
+ [b.trades_per_year for b in backtest_metrics],
186
+ [b.total_number_of_days for b in backtest_metrics]
187
+ )
188
+ win_rate = safe_weighted_mean(
189
+ [b.win_rate for b in backtest_metrics],
190
+ [b.total_number_of_days for b in backtest_metrics]
191
+ )
192
+ current_win_rate = safe_weighted_mean(
193
+ [b.current_win_rate for b in backtest_metrics],
194
+ [b.total_number_of_days for b in backtest_metrics]
195
+ )
196
+ win_loss_ratio = safe_weighted_mean(
197
+ [b.win_loss_ratio for b in backtest_metrics],
198
+ [b.total_number_of_days for b in backtest_metrics]
199
+ )
200
+ current_win_loss_ratio = safe_weighted_mean(
201
+ [b.current_win_loss_ratio for b in backtest_metrics],
202
+ [b.total_number_of_days for b in backtest_metrics]
203
+ )
204
+ number_of_trades = sum(
205
+ b.number_of_trades for b in backtest_metrics
206
+ if b.number_of_trades is not None
207
+ )
208
+ number_of_trades_closed = sum(
209
+ b.number_of_trades_closed for b in backtest_metrics
210
+ if b.number_of_trades_closed is not None
211
+ )
212
+ cumulative_exposure = safe_weighted_mean(
213
+ [b.cumulative_exposure for b in backtest_metrics],
214
+ [b.total_number_of_days for b in backtest_metrics]
215
+ )
216
+ exposure_ratio = safe_weighted_mean(
217
+ [b.exposure_ratio for b in backtest_metrics],
218
+ [b.total_number_of_days for b in backtest_metrics]
219
+ )
220
+ average_trade_return = safe_weighted_mean(
221
+ [b.average_trade_return for b in backtest_metrics],
222
+ [b.number_of_trades for b in backtest_metrics]
223
+ )
224
+ average_trade_return_percentage = safe_weighted_mean(
225
+ [b.average_trade_return_percentage for b in backtest_metrics],
226
+ [b.number_of_trades for b in backtest_metrics]
227
+ )
228
+ average_trade_loss = safe_weighted_mean(
229
+ [b.average_trade_loss for b in backtest_metrics],
230
+ [b.number_of_trades for b in backtest_metrics]
231
+ )
232
+ average_trade_loss_percentage = safe_weighted_mean(
233
+ [b.average_trade_loss_percentage for b in backtest_metrics],
234
+ [b.number_of_trades for b in backtest_metrics]
235
+ )
236
+ average_trade_gain = safe_weighted_mean(
237
+ [b.average_trade_gain for b in backtest_metrics],
238
+ [b.number_of_trades for b in backtest_metrics]
239
+ )
240
+ average_trade_gain_percentage = safe_weighted_mean(
241
+ [b.average_trade_gain_percentage for b in backtest_metrics],
242
+ [b.number_of_trades for b in backtest_metrics]
243
+ )
244
+ return BacktestSummaryMetrics(
245
+ total_net_gain=total_net_gain,
246
+ total_net_gain_percentage=total_net_gain_percentage,
247
+ average_net_gain=average_total_net_gain,
248
+ average_net_gain_percentage=average_total_net_gain_percentage,
249
+ total_loss=total_loss,
250
+ total_loss_percentage=total_loss_percentage,
251
+ average_loss=average_total_loss,
252
+ average_loss_percentage=average_total_loss_percentage,
253
+ total_growth=total_growth,
254
+ total_growth_percentage=total_growth_percentage,
255
+ average_growth=average_growth,
256
+ average_growth_percentage=average_growth_percentage,
257
+ cagr=cagr,
258
+ sharpe_ratio=sharp_ratio,
259
+ sortino_ratio=sortino_ratio,
260
+ calmar_ratio=calmar_ratio,
261
+ profit_factor=profit_factor,
262
+ annual_volatility=annual_volatility,
263
+ max_drawdown=max_drawdown,
264
+ max_drawdown_duration=max_drawdown_duration,
265
+ trades_per_year=trades_per_year,
266
+ win_rate=win_rate,
267
+ current_win_rate=current_win_rate,
268
+ win_loss_ratio=win_loss_ratio,
269
+ current_win_loss_ratio=current_win_loss_ratio,
270
+ number_of_trades=number_of_trades,
271
+ number_of_trades_closed=number_of_trades_closed,
272
+ cumulative_exposure=cumulative_exposure,
273
+ exposure_ratio=exposure_ratio,
274
+ average_trade_return=average_trade_return,
275
+ average_trade_return_percentage=average_trade_return_percentage,
276
+ average_trade_loss=average_trade_loss,
277
+ average_trade_loss_percentage=average_trade_loss_percentage,
278
+ average_trade_gain=average_trade_gain,
279
+ average_trade_gain_percentage=average_trade_gain_percentage
280
+ )
@@ -0,0 +1,111 @@
1
+ import logging
2
+ from enum import Enum
3
+
4
+ from .exceptions import OperationalException
5
+
6
+ logger = logging.getLogger("investing_algorithm_framework")
7
+
8
+
9
+ class Environment(Enum):
10
+ """
11
+ Class TimeUnit: Enum for data_provider base type
12
+ """
13
+ DEV = 'DEV'
14
+ PROD = 'PROD'
15
+ TEST = 'TEST'
16
+ BACKTEST = 'BACKTEST'
17
+
18
+ # Static factory method to convert
19
+ # a string to environment
20
+ @staticmethod
21
+ def from_string(value: str):
22
+
23
+ if isinstance(value, str):
24
+
25
+ for entry in Environment:
26
+
27
+ if value.upper() == entry.value:
28
+ return entry
29
+
30
+ raise OperationalException(
31
+ "Could not convert value to a environment type"
32
+ )
33
+
34
+ else:
35
+ raise OperationalException(
36
+ "Could not convert non string value to a environment type"
37
+ )
38
+
39
+ def equals(self, other):
40
+
41
+ if isinstance(other, Enum):
42
+ return self.value == other.value
43
+ else:
44
+
45
+ try:
46
+ data_base_type = Environment.from_string(other)
47
+ return data_base_type == self
48
+ except OperationalException:
49
+ pass
50
+
51
+ return other == self.value
52
+
53
+
54
+ DEFAULT_LOGGING_CONFIG = {
55
+ 'version': 1,
56
+ 'disable_existing_loggers': False,
57
+ 'formatters': {
58
+ 'default': {
59
+ 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
60
+ },
61
+ },
62
+ 'handlers': {
63
+ 'console': {
64
+ 'class': 'logging.StreamHandler',
65
+ 'formatter': 'default',
66
+ },
67
+ 'file': {
68
+ 'class': 'logging.FileHandler',
69
+ 'formatter': 'default',
70
+ 'filename': 'app_logs.log',
71
+ },
72
+ },
73
+ 'loggers': { # Make sure to add a 'loggers' section
74
+ 'investing_algorithm_framework': { # Define your logger here
75
+ 'level': 'INFO', # Set the desired level
76
+ 'handlers': ['console', 'file'], # Use these handlers
77
+ 'propagate': False,
78
+ },
79
+ },
80
+ 'root': { # Optional: Root logger configuration
81
+ 'level': 'WARNING', # Root logger defaults to WARNING
82
+ 'handlers': ['console', 'file'],
83
+ },
84
+ }
85
+
86
+ AWS_LAMBDA_LOGGING_CONFIG = {
87
+ 'version': 1,
88
+ 'disable_existing_loggers': False,
89
+ 'formatters': {
90
+ 'default': {
91
+ 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
92
+ },
93
+ },
94
+ 'handlers': {
95
+ 'console': {
96
+ 'class': 'logging.StreamHandler',
97
+ 'formatter': 'default',
98
+ },
99
+ },
100
+ 'loggers': { # Make sure to add a 'loggers' section
101
+ 'investing_algorithm_framework': { # Define your logger here
102
+ 'level': 'INFO', # Set the desired level
103
+ 'handlers': ['console'], # Use these handlers
104
+ 'propagate': False,
105
+ },
106
+ },
107
+ 'root': { # Optional: Root logger configuration
108
+ 'level': 'WARNING', # Root logger defaults to WARNING
109
+ 'handlers': ['console'],
110
+ },
111
+ }
@@ -0,0 +1,83 @@
1
+ # Framework constants
2
+ FRAMEWORK_NAME = 'FRAMEWORK_NAME'
3
+ ENVIRONMENT = "ENVIRONMENT"
4
+ STATELESS = "STATELESS"
5
+
6
+ # Database Constants
7
+ DATABASE_CONFIG = 'DATABASE_CONFIG'
8
+ DATABASE_NAME = 'DATABASE_NAME'
9
+ DATABASE_TYPE = 'DATABASE_TYPE'
10
+ DATABASE_DIRECTORY_PATH = 'DATABASE_DIRECTORY_PATH'
11
+ DATABASE_DIRECTORY_NAME = 'DATABASE_DIRECTORY_NAME'
12
+ DATABASE_URL = 'DATABASE_URL'
13
+ DEFAULT_DATABASE_NAME = "database"
14
+
15
+ SYMBOLS = "SYMBOLS"
16
+ APPLICATION_DIRECTORY = "APP_DIR"
17
+ RESOURCE_DIRECTORY = "RESOURCE_DIRECTORY"
18
+ BACKTEST_DATA_DIRECTORY_NAME = "BACKTEST_DATA_DIRECTORY_NAME"
19
+ DATA_DIRECTORY = "DATA_DIRECTORY"
20
+ LOG_LEVEL = 'LOG_LEVEL'
21
+ BASE_DIR = 'BASE_DIR'
22
+ SQLALCHEMY_DATABASE_URI = 'SQLALCHEMY_DATABASE_URI'
23
+ SQLITE_INITIALIZED = "SQLITE_INITIALIZED"
24
+ SQLALCHEMY_INITIALIZED = "SQLALCHEMY_INITIALIZED"
25
+ RESERVED_BALANCES = "RESERVED_BALANCES"
26
+ APP_MODE = "APP_MODE"
27
+ BINANCE = "BINANCE"
28
+
29
+ IDENTIFIER_QUERY_PARAM = "identifier"
30
+ TARGET_SYMBOL_QUERY_PARAM = "target_symbol"
31
+ TRADING_SYMBOL_QUERY_PARAM = "trading_symbol"
32
+ ORDER_SIDE_QUERY_PARAM = "order_size"
33
+ STATUS_QUERY_PARAM = "status"
34
+ POSITION_SYMBOL_QUERY_PARAM = "position"
35
+ SYMBOL_QUERY_PARAM = "symbol"
36
+ TIME_FRAME_QUERY_PARAM = "time_frame"
37
+
38
+ RESERVED_IDENTIFIERS = [
39
+ BINANCE
40
+ ]
41
+
42
+ BINANCE_API_KEY = "binance_api_key"
43
+ BINANCE_SECRET_KEY = "binance_secret_key"
44
+
45
+ CHECK_PENDING_ORDERS = "CHECK_PENDING_ORDERS"
46
+ RUN_STRATEGY = "RUN_STRATEGY"
47
+
48
+ # Configuration
49
+ TRADING_SYMBOL = "TRADING_SYMBOL"
50
+ CCXT_ENABLED = "CCXT_ENABLED"
51
+ API_KEY = "API_KEY"
52
+ SECRET_KEY = "SECRET_KEY"
53
+ MARKET = "MARKET"
54
+ TRACK_PORTFOLIO_FROM = "TRACK_PORTFOLIO_FROM"
55
+ SQLITE_ENABLED = "SQLITE_ENABLED"
56
+ PORTFOLIOS = "PORTFOLIOS"
57
+ STRATEGIES = "STRATEGIES"
58
+ APPLICATION_CONFIGURED = "APPLICATION_CONFIGURED"
59
+ ACTION = "ACTION"
60
+ DEFAULT_PER_PAGE_VALUE = 10
61
+ DEFAULT_PAGE_VALUE = 1
62
+ ITEMIZE = 'itemize'
63
+ ITEMIZED = 'itemized'
64
+ PAGE = 'page'
65
+ PER_PAGE = 'per_page'
66
+ DATETIME_FORMAT_BACKTESTING = "%Y-%m-%d-%H-%M"
67
+ CCXT_DATETIME_FORMAT_WITH_TIMEZONE = "%Y-%m-%dT%H:%M:%S.%fZ"
68
+ CCXT_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
69
+ DEFAULT_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
70
+ BACKTESTING_FLAG = "BACKTESTING"
71
+ INDEX_DATETIME = "INDEX_DATETIME"
72
+ LAST_SNAPSHOT_DATETIME = "LAST_SNAPSHOT_DATETIME"
73
+ BACKTESTING_START_DATE = "BACKTESTING_START_DATE"
74
+ BACKTESTING_END_DATE = "BACKTESTING_END_DATE"
75
+ BACKTESTING_INITIAL_AMOUNT = "BACKTESTING_INITIAL_AMOUNT"
76
+ TICKER_DATA_TYPE = "TICKER"
77
+ OHLCV_DATA_TYPE = "OHLCV"
78
+ CURRENT_UTC_DATETIME = "CURRENT_UTC_DATETIME"
79
+ SNAPSHOT_INTERVAL = "SNAPSHOT_INTERVAL"
80
+ DATETIME_FORMAT = "DATETIME_FORMAT"
81
+ DATETIME_FORMAT_FILE_NAME = "DATETIME_FORMAT_FILE_NAME"
82
+ # Deployment
83
+ AWS_S3_STATE_BUCKET_NAME = "AWS_S3_STATE_BUCKET_NAME"