ce601c4507
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
499 B
Python
14 lines
499 B
Python
import pandas as pd
|
|
from src.data.downloader import load_data
|
|
from scripts.strategies.DIP01_dip_buy import Dip01DipBuy
|
|
|
|
|
|
def test_dip01_generates_long_signals_with_exits():
|
|
df = load_data("BTC", "1h").iloc[-5000:].reset_index(drop=True)
|
|
ts = pd.to_datetime(df["timestamp"], unit="ms", utc=True)
|
|
sigs = Dip01DipBuy().generate_signals(df, ts, asset="BTC", tf="1h")
|
|
assert len(sigs) > 0
|
|
s = sigs[0]
|
|
assert s.direction == 1
|
|
assert {"tp", "sl", "max_bars"} <= set(s.metadata)
|