双买交易行权价拆分为看涨行权价和看跌行权价,支持不同价位

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-07-28 14:37:53 +08:00
parent af3e359d24
commit 39c5e22ed6
4 changed files with 53 additions and 28 deletions
+9
View File
@@ -53,6 +53,15 @@ def _migrate(engine):
if "point_value" not in cols:
cur.execute("ALTER TABLE option_trades ADD COLUMN point_value INTEGER DEFAULT 20")
cur.execute("PRAGMA table_info(dual_option_trades)")
cols = {row[1] for row in cur.fetchall()}
if "call_strike_price" not in cols:
cur.execute("ALTER TABLE dual_option_trades ADD COLUMN call_strike_price FLOAT DEFAULT 0")
if "put_strike_price" not in cols:
cur.execute("ALTER TABLE dual_option_trades ADD COLUMN put_strike_price FLOAT DEFAULT 0")
if "strike_price" in cols:
cur.execute("ALTER TABLE dual_option_trades DROP COLUMN strike_price")
conn.commit()
finally:
conn.close()