Commit ade0b0c
committed
Implement database synchronization for backtests, plus some new backtest features such as notes, and strategy snapshots
- Streamlined the process of preparing chart data by directly assigning formatted values to the chart_data dictionary.
- Removed redundant variable assignments to enhance code clarity and maintainability.
Add backtest session management features
- Introduced new API endpoints for managing backtest sessions, including fetching all sessions, retrieving a session by ID, updating session state, and removing sessions.
- Created a new BacktestSession model to handle session data in the database.
- Implemented functions for storing, updating, and deleting backtest sessions.
- Enhanced the backtest execution process to log session status and exceptions in the database.
- Updated transformers to format backtest session data for API responses.
Add clean_infinite_values function and enhance backtest session API
- Introduced clean_infinite_values function to recursively clean infinite values from data structures, replacing them with None or 0.
- Updated get_backtest_sessions endpoint to support pagination through request body.
- Modified get_backtest_sessions function to accept limit and offset parameters for improved session retrieval.
- Enhanced data transformation in get_backtest_session_for_load_more to clean infinite values from metrics, equity curve, trades, hyperparameters, and chart data.
- Added GetBacktestSessionsRequestJson model for structured request handling in the API.
Update backtest session status on cancellation request
- Added functionality to update the status of a backtest session to 'cancelled' when a cancellation request is processed.
- Enhanced the backtest_controller to import and utilize the update_backtest_session_status function for managing session states.
Add backtest session notes management and enhance session model
- Introduced a new API endpoint to update notes (title, description, strategy codes) for backtest sessions.
- Enhanced the BacktestSession model to include fields for user notes.
- Updated the update_backtest_session_results function to handle strategy codes.
- Modified transformers to include notes in the session data returned by the API.
- Added a new request model for updating backtest session notes.
Enhance backtest session retrieval with additional filters
- Updated the get_backtest_sessions function to support title search, status filtering, and date filtering for improved session management.
- Modified the GetBacktestSessionsRequestJson model to include new optional parameters for filtering.
- Enhanced the backtest_controller to utilize the updated session retrieval logic with pagination and filters.
Add purge sessions functionality to backtest controller and model
- Introduced a new API endpoint to purge backtest sessions older than a specified number of days.
- Implemented the purge_backtest_sessions function in the BacktestSession model to handle the deletion of old sessions based on the provided criteria.
- Enhanced error handling and logging for the purging process to improve debugging and user feedback.
Remove debug print statement from purge_backtest_sessions function in BacktestSession model to streamline error handling and improve logging clarity.
Add chart data retrieval endpoint for backtest sessions
- Introduced a new API endpoint to fetch chart data for a specific backtest session.
- Implemented validation for authorization tokens and session existence.
- Enhanced data transformation to clean infinite values from chart data before returning it.
- Updated the backtest session model to indicate the presence of chart data without returning it directly in the load more function.1 parent 96378e7 commit ade0b0c
File tree
8 files changed
+771
-21
lines changed- jesse
- controllers
- models
- modes
- services
- tests
8 files changed
+771
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
96 | 114 | | |
97 | | - | |
98 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
99 | 135 | | |
100 | | - | |
| 136 | + | |
101 | 137 | | |
102 | | - | |
| 138 | + | |
103 | 139 | | |
104 | 140 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 141 | + | |
| 142 | + | |
108 | 143 | | |
109 | | - | |
110 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
111 | 148 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
115 | 261 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1123 | 1123 | | |
1124 | 1124 | | |
1125 | 1125 | | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1126 | 1148 | | |
1127 | 1149 | | |
1128 | 1150 | | |
| |||
0 commit comments