82c68fa8b0
- Switch to oil stocks (USO, XLE, OXY, CVX, XOM, SLB, HAL, DVN, MPC, VLO) - Add JPY/USD forex pairs for Japan targeting - 7-action RL space: long, short, close (was 5 long-only actions) - Bollinger Band mean-reversion scalp entries both directions - 5-minute candles with 60-second cycles for scalping - 35 features (added VWAP, fast RSI, fast ROC for scalping) - Short position support in backtest, executor, and RL environment - GA tuned for scalping: tighter SL/TP, shorter hold times Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Read BIGGFISH recent events for Krystie."""
|
|
import json, sys
|
|
|
|
EVENTS_FILE = "/opt/biggfish/src/data/krystie-events.json"
|
|
|
|
try:
|
|
with open(EVENTS_FILE) as f:
|
|
data = json.load(f)
|
|
except FileNotFoundError:
|
|
print("No events file found. BIGGFISH may not have generated any events yet.")
|
|
sys.exit(1)
|
|
|
|
events = data.get("events", [])
|
|
if not events:
|
|
print("No events recorded yet.")
|
|
sys.exit(0)
|
|
|
|
print("=== BIGGFISH EVENTS (last {}) ===".format(len(events)))
|
|
print()
|
|
|
|
for e in reversed(events[-20:]):
|
|
t = e.get("time", "?")
|
|
etype = e.get("type", "?")
|
|
d = e.get("data", {})
|
|
|
|
if etype == "trade_open":
|
|
print("[{}] TRADE OPENED: {} {} @ ${:.4f} (amount: ${:.2f})".format(
|
|
t, d.get("side", "?").upper(), d.get("symbol", "?"),
|
|
d.get("entry_price", 0), d.get("amount", 0)))
|
|
elif etype == "trade_close":
|
|
pnl = d.get("pnl", 0)
|
|
print("[{}] TRADE CLOSED: {} ${:.4f} -> ${:.4f} P&L: ${:+.2f} ({:+.1f}%) [{}]".format(
|
|
t, d.get("symbol", "?"), d.get("entry_price", 0),
|
|
d.get("exit_price", 0), pnl, d.get("pnl_pct", 0),
|
|
d.get("exit_reason", "?")))
|
|
elif etype == "ga_milestone":
|
|
print("[{}] GA MILESTONE: Gen {} | Fitness: {:.4f}".format(
|
|
t, d.get("generation", 0), d.get("fitness", 0)))
|
|
elif etype == "daily_report":
|
|
print("[{}] DAILY REPORT: Equity ${:,.2f} | Day P&L: ${:+.2f} | Trades: {}".format(
|
|
t, d.get("equity", 0), d.get("day_pnl", 0), d.get("trades_count", 0)))
|
|
elif etype == "bot_started":
|
|
print("[{}] BOT STARTED".format(t))
|
|
elif etype == "bot_stopped":
|
|
print("[{}] BOT STOPPED".format(t))
|
|
else:
|
|
print("[{}] {}: {}".format(t, etype, json.dumps(d)))
|