From f9c8d43a869cd50bdace100d41dcba431176fde7 Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Tue, 11 Feb 2025 17:45:52 -0800 Subject: [PATCH] fix: Update ClickHouse table creation syntax for trading plans --- src/trading/trading_plan.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/trading/trading_plan.py b/src/trading/trading_plan.py index fd600f2..f9e55a2 100644 --- a/src/trading/trading_plan.py +++ b/src/trading/trading_plan.py @@ -79,7 +79,7 @@ def create_trading_plan_table(): with create_client() as client: query = """ CREATE TABLE IF NOT EXISTS trading_plans ( - id Int32, + id UInt32, plan_name String, status String, created_at DateTime, @@ -99,8 +99,8 @@ def create_trading_plan_table(): entry_confirmation String, position_sizing Float64, maximum_drawdown Float64, - max_trades_per_day Int32, - max_trades_per_week Int32, + max_trades_per_day UInt32, + max_trades_per_week UInt32, total_risk_per_trade Float64, max_portfolio_risk Float64, @@ -114,7 +114,7 @@ def create_trading_plan_table(): real_trade_performance Nullable(String), improvements_needed Nullable(String), - strategy_version Int32, + strategy_version UInt32, plan_author String, trade_review_notes Nullable(String), future_testing_ideas Nullable(String), @@ -124,6 +124,7 @@ def create_trading_plan_table(): options_strategy_details Nullable(String) ) ENGINE = MergeTree() + PRIMARY KEY (id) ORDER BY (id, created_at) """ client.execute(query)