reorganized data files and enhance backtesting structure, monte carlo sim

This commit is contained in:
moen0
2026-04-13 01:30:34 +02:00
parent 373e589297
commit 7d53f8589a
26 changed files with 65383 additions and 766 deletions
+4 -4
View File
@@ -19,7 +19,7 @@ def find_liquidity_levels(swings, tolerance=0.015, max_distance=100):
"price": avg_price,
"type": "equal_highs",
"count": len(cluster),
"indexes": [s["index"] for s in cluster]
"indexes": [s["index"] for s in cluster],
})
used.add(i)
@@ -30,7 +30,7 @@ def find_liquidity_levels(swings, tolerance=0.015, max_distance=100):
cluster = [l1]
for j, l2 in enumerate(lows):
if j != i and j not in used:
if abs(h1["price"] - h2["price"]) <= tolerance and abs(h1["index"] - h2["index"]) <= max_distance:
if abs(l1["price"] - l2["price"]) <= tolerance and abs(l1["index"] - l2["index"]) <= max_distance:
cluster.append(l2)
used.add(j)
if len(cluster) >= 2:
@@ -39,8 +39,8 @@ def find_liquidity_levels(swings, tolerance=0.015, max_distance=100):
"price": avg_price,
"type": "equal_lows",
"count": len(cluster),
"indexes": [s["index"] for s in cluster]
"indexes": [s["index"] for s in cluster],
})
used.add(i)
return levels
return levels