Commit Graph

477 Commits

Author SHA1 Message Date
3a053a0fb0 feat: Add backtesting page with dynamic strategy configuration and optimization 2025-02-13 22:58:28 -08:00
ab5b4a9cd2 refactor: Simplify report filtering logic by removing technical filter 2025-02-13 21:53:57 -08:00
88345df736 refactor: Simplify non_canslim filtering logic in report loading 2025-02-13 21:51:47 -08:00
d8658e9b8b feat: Add non-CANSLIM report filtering option to load_scanner_reports() 2025-02-13 21:50:04 -08:00
4be088c0b2 refactor: Improve overall P/L calculation with realized and paper P/L 2025-02-13 13:22:14 -08:00
d7834d78f5 refactor: Update trading system page portfolio calculation logic 2025-02-13 13:03:43 -08:00
217707b4d9 refactor: Simplify open position value calculation using trade summary data 2025-02-13 12:58:09 -08:00
6097ce6367 feat: Improve portfolio value calculation with detailed open trades tracking 2025-02-13 12:55:44 -08:00
3e1775534c feat: Enhance trading system page with total portfolio value calculation and usage metrics 2025-02-13 12:49:31 -08:00
336afa8170 feat: Enhance trading system page with cash-aware position sizing 2025-02-13 12:46:57 -08:00
a643a1649e refactor: Fix indentation and remove unused portfolio code 2025-02-13 12:44:10 -08:00
51ebdc1d74 fix: Correct indentation in trading system page input fields 2025-02-13 12:40:01 -08:00
5398d683b9 refactor: Remove unnecessary whitespace and indentation in trading system page 2025-02-13 12:39:40 -08:00
6439412bb3 refactor: Fix search/replace block matching in trading system page 2025-02-13 12:39:32 -08:00
eea63e6cbb refactor: Simplify trading system page to focus on position calculator 2025-02-13 12:39:00 -08:00
4659496889 feat: Enhance portfolio overview with dynamic value calculation and cash balance input 2025-02-13 12:34:37 -08:00
bd4dce4f42 refactor: Improve timezone handling in calculate_weekly_metrics function 2025-02-13 12:30:17 -08:00
18f689115e fix: Resolve timezone awareness issue in weekly metrics calculation 2025-02-13 12:29:05 -08:00
00d00fb06b feat: Add weekly performance metrics to Portfolio Overview section 2025-02-13 12:27:35 -08:00
201d48c302 feat: Enhance trading journal with portfolio allocation and performance metrics 2025-02-13 12:21:11 -08:00
a6746ff267 fix: Improve trade P/L calculation in plot_trade_history function 2025-02-13 11:28:12 -08:00
b1240cd582 refactor: Update plot_trade_history to only show realized P/L from closed trades 2025-02-13 11:25:11 -08:00
85c8f97cc5 refactor: Optimize open trades summary query with position totals subquery 2025-02-13 11:21:04 -08:00
e5b35e50e5 refactor: Improve open trades query with net shares calculation and position tracking 2025-02-13 11:20:47 -08:00
4196a61b99 refactor: Update open trades queries to handle empty exit prices and null exit dates 2025-02-13 11:18:00 -08:00
4bd9bd8c42 fix: Adjust open trades summary query to handle sell orders and filter zero total shares 2025-02-13 11:14:28 -08:00
abaf3ab855 feat: Improve trade entry and performance calculation for sell orders 2025-02-13 11:11:42 -08:00
6d29558752 fix: Handle missing trade direction by inferring from exit price 2025-02-13 11:05:38 -08:00
731b4e9e2d refactor: Simplify position summary query and add debug logging 2025-02-13 10:58:09 -08:00
814a7db5de feat: Add debug print statements to trading journal page for trade entry tracking 2025-02-13 10:52:36 -08:00
417747be86 refactor: Optimize position handling logic in trading journal page 2025-02-13 10:46:55 -08:00
46c37e2f63 refactor: Improve position selection logic for buy and sell trades 2025-02-13 10:43:45 -08:00
0f8a75ca28 refactor: Improve trade direction inference and add debug logging in position performance calculation 2025-02-13 10:39:25 -08:00
aedd96eef4 refactor: Simplify open trades summary query calculation 2025-02-13 10:34:46 -08:00
52839b451e feat: Add debug logging to get_open_trades function 2025-02-13 10:29:50 -08:00
c4b253cc88 feat: Add debug logging to open trades functions 2025-02-13 10:29:33 -08:00
dbb1393c08 feat: Add comprehensive debug statements to trading journal page and data retrieval functions 2025-02-13 10:29:01 -08:00
7f1077a951 refactor: Replace st.query_params with st.experimental_rerun for trade updates 2025-02-13 10:23:25 -08:00
28ffb22f71 fix: Move entry datetime input before position ID generation 2025-02-13 10:10:20 -08:00
ef762d2132 feat: Update position ID generation to use trade entry datetime 2025-02-13 10:09:53 -08:00
b3ac7c1705 refactor: Remove debug output lines from trading journal page 2025-02-13 09:36:23 -08:00
a37b70d88d refactor: Simplify trade sorting to use chronological order 2025-02-13 09:35:19 -08:00
646d4b847f refactor: Update trade history query to explicitly list columns 2025-02-13 09:32:57 -08:00
e322743f33 fix: Add direction field to trade history query and improve error handling 2025-02-13 09:32:40 -08:00
e22a0ad67e refactor: Update trade entry handling for sell orders with exit price and date 2025-02-13 09:30:38 -08:00
9493f5d7ac fix: Add default value for trade direction in debug output 2025-02-13 09:26:29 -08:00
f162cdb91b fix: Correct trade direction processing in trading journal 2025-02-13 09:26:18 -08:00
94671119f2 feat: Replace time_input with text_input for time entry validation 2025-02-13 09:14:27 -08:00
b6117c84f2 feat: Add docstring and lowercase trade direction in add_trade function 2025-02-13 09:13:03 -08:00
a3eae62be3 fix: Improve trade direction detection in position performance calculation 2025-02-13 09:09:39 -08:00
bd880cbb46 fix: Use order_type instead of corrupted direction field for trade classification 2025-02-13 09:07:12 -08:00
522e889467 refactor: Improve trade direction handling and debug output 2025-02-13 09:04:47 -08:00
58c59a4633 refactor: Improve trade direction handling and add debug output 2025-02-13 09:02:42 -08:00
3bc111288e fix: Improve trade performance calculation and add debug logging 2025-02-13 09:00:17 -08:00
47b58faddd refactor: Enhance trade history display with performance metrics and detailed trade information 2025-02-13 08:58:34 -08:00
b1b22ac026 refactor: Improve trade display sorting and exit price handling 2025-02-13 08:54:04 -08:00
f85299b518 fix: Add type checking for trade direction to prevent AttributeError 2025-02-13 08:50:49 -08:00
0c30213688 fix: Handle entry_price formatting with error handling 2025-02-13 08:50:05 -08:00
9ef81fb589 fix: Improve trade history display with correct price labels and direction 2025-02-13 08:49:04 -08:00
b8a561f37c fix: Handle potential type conversion errors for exit price in trading journal 2025-02-13 08:45:50 -08:00
287dd32485 fix: Handle non-string trade direction in trading journal display 2025-02-13 08:44:37 -08:00
c030f87d9a fix: Handle missing trade direction by defaulting to 'Buy' 2025-02-13 08:43:41 -08:00
fb27bf3003 fix: Handle non-numeric exit prices in trade history plotting 2025-02-13 08:42:08 -08:00
0b07861265 fix: Convert trade prices and shares to float to prevent type errors 2025-02-13 08:40:44 -08:00
8d76d820fe feat: Enhance trade history display with position-based grouping and comprehensive trade details 2025-02-13 08:39:51 -08:00
3f0b10ed41 fix: Correct trade type display in trading journal 2025-02-13 08:35:40 -08:00
9642d78942 feat: Add support for sell orders in trade history query and display 2025-02-13 08:32:58 -08:00
bc064fc011 fix: Correct trade summary calculations for buy and sell directions 2025-02-13 08:29:01 -08:00
e60f18e41a fix: Add None checks for portfolio position metrics to prevent TypeError 2025-02-13 08:10:18 -08:00
0cb11574a3 refactor: Add None checks to Position class property methods 2025-02-13 08:07:52 -08:00
3a962fb685 fix: Handle None values for numeric trade fields in trading journal 2025-02-13 07:58:35 -08:00
7764821ec9 fix: Correct syntax error in process_signal_data function signature 2025-02-12 22:17:19 -08:00
4ad01316b7 feat: Add Heikin Ashi signal handling with dynamic target price calculation 2025-02-12 22:17:04 -08:00
aec5929ea7 feat: Add Heikin-Ashi scanner to technical scanner framework 2025-02-12 22:09:39 -08:00
a24605e839 refactor: Simplify technical scanner results display with summary table and download option 2025-02-12 20:45:26 -08:00
83159566e3 feat: Return signals from scanner functions and handle errors 2025-02-12 20:39:31 -08:00
5502c54845 refactor: Update load_scanner_reports with debug logging and robust path resolution 2025-02-12 20:09:36 -08:00
f4f7505e5c refactor: Update report filtering logic to match specific scanner naming patterns 2025-02-12 20:02:00 -08:00
c1382ba694 refactor: Centralize scanner report loading with universal utility function 2025-02-12 19:59:32 -08:00
28713d9fcd fix: Update imports for initialize_scanner and process_signal_data in t_atr_ema_v2.py 2025-02-12 19:53:45 -08:00
057cd7e1e1 refactor: Move process_signal_data from data_utils to scanner_utils and update imports 2025-02-12 19:53:09 -08:00
9c6d1d1f10 refactor: Remove orphaned database query code block from data_utils.py 2025-02-12 19:52:16 -08:00
8775d35326 refactor: Split large functions in data_utils.py into smaller modules 2025-02-12 19:50:27 -08:00
3e98ba4e9d refactor: Resolve circular import by creating common_utils module 2025-02-12 19:50:00 -08:00
8ea0895f73 refactor: Resolve circular import by moving get_user_input to scanner_utils.py 2025-02-12 19:47:56 -08:00
7d7262fd8c refactor: Consolidate initialize_scanner function and remove duplicate 2025-02-12 19:46:35 -08:00
ec50fc1ebc fix: Update initialize_scanner function signature to match parameter order 2025-02-12 19:44:10 -08:00
fb254129ad fix: Import timedelta to resolve undefined name errors 2025-02-12 19:42:58 -08:00
b9704646f9 refactor: Update run_sunny_scanner with consistent parameter handling 2025-02-12 19:42:49 -08:00
17644db50b fix: Import datetime to resolve undefined name errors 2025-02-12 19:40:10 -08:00
c387396254 refactor: Update scanner initialization to accept start and end dates as parameters 2025-02-12 19:40:01 -08:00
3b2cd794ec refactor: Update scanner initialization to use passed interval parameter 2025-02-12 19:37:48 -08:00
7d842f661b feat: Add interval parameter to run_sunny_scanner function 2025-02-12 19:06:51 -08:00
11da135ea2 refactor: Prevent duplicate table creation messages in trading_plan table 2025-02-12 17:54:46 -08:00
f291cd631f removed whitespace 2025-02-12 17:49:08 -08:00
c5d7a96e38 refactor: Move trading plan page to dedicated module 2025-02-12 17:33:51 -08:00
60029268f7 fix: Correct syntax error in portfolio data check condition 2025-02-12 17:10:35 -08:00
a8aea03499 feat: Refactor trading system page into separate module 2025-02-12 17:10:23 -08:00
2fcf238f6b feat: Move trading system functionality to separate module 2025-02-12 17:07:19 -08:00
f7fd7dc7b8 fix: Add missing import for load_scanner_reports function 2025-02-12 17:04:16 -08:00
723a7dfc9f refactor: Move technical scanner functionality to separate module 2025-02-12 17:02:40 -08:00
3bb0ede559 fix: Import load_scanner_reports function from canslim_screener_page 2025-02-12 17:00:18 -08:00
ce1db8a8d9 refactor: Move CANSLIM screener to dedicated module 2025-02-12 17:00:08 -08:00
c2feece0d6 fix: Import missing journal functions and format_datetime 2025-02-12 16:51:25 -08:00
bf034d9ada refactor: Move trading journal functionality to separate module 2025-02-12 16:51:05 -08:00
417dbbc596 refactor: Move strategy guide to dedicated page module 2025-02-11 21:38:38 -08:00
b35349c885 refactor: Improve NULL handling in unlink_trades_from_plan function 2025-02-11 21:06:37 -08:00
84378e32f8 refactor: Replace nested expanders with cleaner trade display layout 2025-02-11 19:22:34 -08:00
1506deff0d feat: Add linked trades and trade statistics to trading plan view 2025-02-11 19:21:25 -08:00
a2bbd31f27 fix: Modify trade linking query to correctly handle ClickHouse IN clause 2025-02-11 19:18:36 -08:00
062be5863f feat: Add unlink_trades_from_plan import to trading_plan module imports 2025-02-11 19:17:06 -08:00
bee908180c feat: Add functionality to unlink trades from trading plans 2025-02-11 19:16:52 -08:00
f3d932443e fix: Remove duplicate Trade Management section and add unique keys 2025-02-11 19:14:59 -08:00
d9692e9811 feat: Add dynamic plan_id column check and creation in get_plan_trades 2025-02-11 19:13:39 -08:00
a47cd3e1cc refactor: Update SQL queries to use parameterized queries in trading_plan.py 2025-02-11 19:12:14 -08:00
85d7638ef4 feat: Add trade management section to trading plan edit page 2025-02-11 19:09:51 -08:00
c1bd9e7701 fix: Resolve f-string syntax error in trading plan page format_func 2025-02-11 19:07:56 -08:00
4a0bc2bb0f fix: Resolve f-string syntax error in trading plan trade formatting 2025-02-11 19:07:42 -08:00
eeb7e6d682 feat: Enhance trade selection with direction, strategy, and profit/loss details 2025-02-11 19:07:24 -08:00
722f0d8a14 fix: Import missing functions for trading plan management 2025-02-11 19:03:25 -08:00
e575842664 feat: Add trade linking and performance metrics to trading plans 2025-02-11 19:00:24 -08:00
bdfd53e653 feat: Enhance trading plan view with comprehensive details and improved layout 2025-02-11 18:56:27 -08:00
9f0be3f617 fix: Update Streamlit query params method to use .update() 2025-02-11 18:53:15 -08:00
0312411a47 refactor: Replace deprecated st.experimental_set_query_params with st.query_params 2025-02-11 18:51:27 -08:00
613f50ec5b fix: Correct indentation for delete button in trading plan page 2025-02-11 18:48:37 -08:00
9369eadd47 fix: Correct syntax error in trading plan delete button placement 2025-02-11 18:47:12 -08:00
9e7e1dd2b1 fix: Correct indentation for delete plan button in trading plan page 2025-02-11 18:47:02 -08:00
35cebb7010 fix: Correct indentation for delete plan button in trading plan page 2025-02-11 18:46:51 -08:00
25edd0a77f fix: Correct indentation for "Delete Plan" button in trading plan page 2025-02-11 18:46:38 -08:00
f0065af3a2 fix: Resolve indentation error and remove duplicate exception handler in trading plan page 2025-02-11 18:44:57 -08:00
11660b3449 fix: Remove misplaced delete plan button and add it to trading plan page 2025-02-11 18:44:46 -08:00
b1e843e796 feat: Add delete functionality for trading plans in edit mode 2025-02-11 18:44:33 -08:00
e7946667e4 feat: Add comprehensive editing capabilities for trading plans 2025-02-11 18:40:44 -08:00
430520a307 refactor: Remove updated_at as version column in ReplacingMergeTree engine 2025-02-11 18:36:58 -08:00
978d9c7a20 feat: Update trading_plans table to use ReplacingMergeTree for better update support 2025-02-11 18:34:35 -08:00
aa282de020 refactor: Switch trading_plans table engine from TinyLog to MergeTree 2025-02-11 18:33:01 -08:00
7fe73d725c fix: Remove DROP TABLE command to preserve trading plan data 2025-02-11 18:31:15 -08:00
74e1d43936 feat: Add unique keys to Streamlit form elements to prevent duplicate IDs 2025-02-11 18:28:15 -08:00
5acfe4bfc4 fix: Correctly handle query results in trading plan retrieval functions 2025-02-11 18:25:02 -08:00
1d423d3291 refactor: Update Streamlit query params and trading plan retrieval method 2025-02-11 18:22:58 -08:00
26238a6afb refactor: Update query result handling and deprecated Streamlit function 2025-02-11 18:21:33 -08:00
7fe83a0f6a fix: Update st.rerun() to st.experimental_set_query_params(rerun=True) 2025-02-11 18:20:07 -08:00
9897b9029b refactor: Replace st.experimental_rerun() with st.experimental_set_query_params(rerun=True) 2025-02-11 18:20:03 -08:00
d17dc47d42 fix: Correctly handle query result rows when generating new trading plan ID 2025-02-11 18:17:33 -08:00
0ac499ae8c refactor: Update database client methods to use command and query for SQL execution 2025-02-11 18:15:54 -08:00
41de719250 refactor: Add error handling to get_all_trading_plans function 2025-02-11 18:02:38 -08:00
2a790a164a refactor: Improve error handling in create_trading_plan_table function 2025-02-11 18:01:35 -08:00
a22f4a444a refactor: Simplify trading_plans table structure with TinyLog engine 2025-02-11 17:59:38 -08:00
19f06601d9 refactor: Simplify trading plans table structure with MergeTree engine and default values 2025-02-11 17:58:13 -08:00
7ccb5a8065 refactor: Simplify trading plans table structure with Log engine 2025-02-11 17:56:59 -08:00