deploy: 2026-03-20 07:49
This commit is contained in:
54
debug_zones2.py
Normal file
54
debug_zones2.py
Normal file
@@ -0,0 +1,54 @@
|
||||
import os
|
||||
os.environ["SMC_CREDIT"] = "0"
|
||||
import asyncio, pandas as pd
|
||||
from execution.paper_exchange import PaperExchangeClient
|
||||
from core.data_feed import DataFeed
|
||||
from indicators.ict_engine import ICTEngine
|
||||
|
||||
async def debug():
|
||||
client = PaperExchangeClient(300)
|
||||
await client.connect()
|
||||
feed = DataFeed(client)
|
||||
await feed.connect()
|
||||
engine = ICTEngine()
|
||||
|
||||
sym = "BTC/USDT"
|
||||
await feed.fetch_multi_timeframe(sym)
|
||||
df = feed.get_dataframe(sym, "1h")
|
||||
signals = engine.analyze(df)
|
||||
|
||||
# Raw OB data
|
||||
ob_raw = signals.order_blocks
|
||||
print("=== RAW ORDER BLOCKS ===")
|
||||
print("Columns:", list(ob_raw.columns))
|
||||
ob_nonnan = ob_raw[ob_raw["OB"].notna()]
|
||||
print("Total rows with OB value:", len(ob_nonnan))
|
||||
if len(ob_nonnan) > 0:
|
||||
for idx, r in ob_nonnan.tail(10).iterrows():
|
||||
mit = r.get("MitigatedIndex", None)
|
||||
print(" idx=%d OB=%d Top=%.2f Bot=%.2f Mitigated=%s" % (
|
||||
idx, int(r["OB"]), float(r["Top"]), float(r["Bottom"]),
|
||||
"None" if pd.isna(mit) else str(int(mit))
|
||||
))
|
||||
|
||||
# Raw FVG data
|
||||
fvg_raw = signals.fvg
|
||||
print("\n=== RAW FVG ===")
|
||||
print("Columns:", list(fvg_raw.columns))
|
||||
fvg_nonnan = fvg_raw[fvg_raw["FVG"].notna()]
|
||||
print("Total rows with FVG value:", len(fvg_nonnan))
|
||||
if len(fvg_nonnan) > 0:
|
||||
for idx, r in fvg_nonnan.tail(10).iterrows():
|
||||
mit = r.get("MitigatedIndex", None)
|
||||
print(" idx=%d FVG=%d Top=%.2f Bot=%.2f Mitigated=%s" % (
|
||||
idx, int(r["FVG"]), float(r["Top"]), float(r["Bottom"]),
|
||||
"None" if pd.isna(mit) else str(int(mit))
|
||||
))
|
||||
|
||||
price = float(df["close"].iloc[-1])
|
||||
print("\nCurrent price:", price)
|
||||
print("DataFrame length:", len(df))
|
||||
|
||||
await client.disconnect()
|
||||
|
||||
asyncio.run(debug())
|
||||
Reference in New Issue
Block a user