-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreproduce_issue.py
More file actions
49 lines (39 loc) · 1.4 KB
/
reproduce_issue.py
File metadata and controls
49 lines (39 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import sys
import os
from pathlib import Path
# Add backend to path
sys.path.append(os.path.join(os.getcwd(), 'backend'))
from strategies.registry import get_registry, load_default_strategies
from strategies.DonchianBreakoutV2 import DonchianBreakoutV2
def test_instantiation():
print("Loading strategies...")
load_default_strategies()
registry = get_registry()
print("Getting strategy instance...")
strategy = registry.get("donchian_v2")
print(f"Strategy: {strategy}, Type: {type(strategy)}")
if strategy is None:
print("ERROR: Strategy not found")
return
print("Checking generate_signals method...")
if hasattr(strategy, 'generate_signals'):
print(f"Method found: {strategy.generate_signals}")
else:
print("ERROR: generate_signals not found")
print("Attempting to call generate_signals...")
try:
# Pseudo-call
signals = strategy.generate_signals(tokens=["BTC"], timeframe="1h")
print(f"Success! Signals: {signals}")
except Exception as e:
print(f"CRASHED: {e}")
import traceback
traceback.print_exc()
print("Checking for accidental callability...")
try:
strategy()
print("Strategy object IS callable (Unexpected!)")
except TypeError as e:
print(f"Strategy object is NOT callable (Expected): {e}")
if __name__ == "__main__":
test_instantiation()