第一版策略
This commit is contained in:
294
strategy/bb_midline_backtest.py
Normal file
294
strategy/bb_midline_backtest.py
Normal file
@@ -0,0 +1,294 @@
|
||||
"""布林带均线策略回测(优化版)
|
||||
|
||||
策略逻辑:
|
||||
- 阳线 + 碰到布林带均线 → 开多(可选 1m 线过滤:先涨碰到才开)
|
||||
- 持多: 碰到上轨 → 止盈(无下轨止损)
|
||||
- 阴线 + 碰到布林带均线 → 平多开空(可选 1m:先跌碰到才开)
|
||||
- 持空: 碰到下轨 → 止盈(无上轨止损)
|
||||
|
||||
全仓模式 | 200U | 1% 权益/单 | 万五手续费 | 90%返佣次日8点到账 | 100x杠杆
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Optional
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
from .indicators import bollinger
|
||||
|
||||
|
||||
@dataclass
|
||||
class BBMidlineConfig:
|
||||
bb_period: int = 20
|
||||
bb_std: float = 2.0
|
||||
initial_capital: float = 200.0
|
||||
margin_pct: float = 0.01
|
||||
leverage: float = 100.0
|
||||
cross_margin: bool = True
|
||||
fee_rate: float = 0.0005
|
||||
rebate_pct: float = 0.90
|
||||
rebate_hour_utc: int = 0
|
||||
slippage_pct: float = 0.0
|
||||
fill_at_close: bool = True
|
||||
# 是否用 1m 线判断「先涨碰到」/「先跌碰到」均线
|
||||
use_1m_touch_filter: bool = True
|
||||
# 主K线周期(分钟),用于 1m 触及方向时的桶对齐,5/15/30
|
||||
kline_step_min: int = 5
|
||||
|
||||
|
||||
@dataclass
|
||||
class BBTrade:
|
||||
side: str
|
||||
entry_price: float
|
||||
exit_price: float
|
||||
entry_time: object
|
||||
exit_time: object
|
||||
margin: float
|
||||
leverage: float
|
||||
qty: float
|
||||
gross_pnl: float
|
||||
fee: float
|
||||
net_pnl: float
|
||||
exit_reason: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class BBMidlineResult:
|
||||
equity_curve: pd.DataFrame
|
||||
trades: List[BBTrade]
|
||||
daily_stats: pd.DataFrame
|
||||
total_fee: float
|
||||
total_rebate: float
|
||||
config: BBMidlineConfig
|
||||
|
||||
|
||||
def run_bb_midline_backtest(
|
||||
df: pd.DataFrame,
|
||||
cfg: BBMidlineConfig,
|
||||
df_1m: Optional[pd.DataFrame] = None,
|
||||
arr_touch_dir_override: Optional[np.ndarray] = None,
|
||||
) -> BBMidlineResult:
|
||||
close = df["close"].astype(float)
|
||||
high = df["high"].astype(float)
|
||||
low = df["low"].astype(float)
|
||||
open_ = df["open"].astype(float)
|
||||
n = len(df)
|
||||
|
||||
bb_mid, bb_upper, bb_lower, _ = bollinger(close, cfg.bb_period, cfg.bb_std)
|
||||
arr_mid = bb_mid.values
|
||||
|
||||
# 1m 触及方向:1=先涨碰到, -1=先跌碰到, 0=未碰到
|
||||
arr_touch_dir = None
|
||||
if arr_touch_dir_override is not None:
|
||||
arr_touch_dir = np.asarray(arr_touch_dir_override, dtype=np.int32)
|
||||
if len(arr_touch_dir) != n:
|
||||
raise ValueError(f"arr_touch_dir_override 长度不匹配: {len(arr_touch_dir)} != {n}")
|
||||
elif cfg.use_1m_touch_filter and df_1m is not None and len(df_1m) > 0:
|
||||
from .data_loader import get_1m_touch_direction
|
||||
arr_touch_dir = get_1m_touch_direction(df, df_1m, arr_mid, kline_step_min=cfg.kline_step_min)
|
||||
|
||||
arr_close = close.values
|
||||
arr_high = high.values
|
||||
arr_low = low.values
|
||||
arr_open = open_.values
|
||||
arr_upper = bb_upper.values
|
||||
arr_lower = bb_lower.values
|
||||
ts_index = df.index
|
||||
|
||||
balance = cfg.initial_capital
|
||||
position = 0
|
||||
entry_price = 0.0
|
||||
entry_time = None
|
||||
entry_margin = 0.0
|
||||
entry_qty = 0.0
|
||||
|
||||
trades: List[BBTrade] = []
|
||||
total_fee = 0.0
|
||||
total_rebate = 0.0
|
||||
|
||||
day_pnl = 0.0
|
||||
current_day = None
|
||||
today_fees = 0.0
|
||||
pending_rebate = 0.0
|
||||
rebate_applied_today = False
|
||||
|
||||
out_equity = np.full(n, np.nan)
|
||||
out_balance = np.full(n, np.nan)
|
||||
out_position = np.zeros(n)
|
||||
|
||||
def unrealised(price):
|
||||
if position == 0:
|
||||
return 0.0
|
||||
if position == 1:
|
||||
return entry_qty * (price - entry_price)
|
||||
return entry_qty * (entry_price - price)
|
||||
|
||||
def close_position(exit_price, exit_idx, reason: str):
|
||||
nonlocal balance, position, entry_price, entry_time, entry_margin, entry_qty
|
||||
nonlocal total_fee, total_rebate, day_pnl, today_fees
|
||||
|
||||
if position == 0:
|
||||
return
|
||||
|
||||
if position == 1:
|
||||
exit_price = exit_price * (1 - cfg.slippage_pct)
|
||||
else:
|
||||
exit_price = exit_price * (1 + cfg.slippage_pct)
|
||||
|
||||
if position == 1:
|
||||
gross = entry_qty * (exit_price - entry_price)
|
||||
else:
|
||||
gross = entry_qty * (entry_price - exit_price)
|
||||
|
||||
exit_notional = entry_qty * exit_price
|
||||
fee = exit_notional * cfg.fee_rate
|
||||
net = gross - fee
|
||||
|
||||
trades.append(BBTrade(
|
||||
side="long" if position == 1 else "short",
|
||||
entry_price=entry_price,
|
||||
exit_price=exit_price,
|
||||
entry_time=entry_time,
|
||||
exit_time=ts_index[exit_idx],
|
||||
margin=entry_margin,
|
||||
leverage=cfg.leverage,
|
||||
qty=entry_qty,
|
||||
gross_pnl=gross,
|
||||
fee=fee,
|
||||
net_pnl=net,
|
||||
exit_reason=reason,
|
||||
))
|
||||
|
||||
balance += net
|
||||
total_fee += fee
|
||||
today_fees += fee
|
||||
day_pnl += net
|
||||
position = 0
|
||||
entry_price = 0.0
|
||||
entry_time = None
|
||||
entry_margin = 0.0
|
||||
entry_qty = 0.0
|
||||
|
||||
def open_position(side, price, idx):
|
||||
nonlocal position, entry_price, entry_time, entry_margin, entry_qty
|
||||
nonlocal balance, total_fee, day_pnl, today_fees
|
||||
|
||||
if side == "long":
|
||||
price = price * (1 + cfg.slippage_pct)
|
||||
else:
|
||||
price = price * (1 - cfg.slippage_pct)
|
||||
|
||||
equity = balance + unrealised(price) if position != 0 else balance
|
||||
margin = equity * cfg.margin_pct
|
||||
margin = min(margin, balance * 0.95)
|
||||
if margin <= 0:
|
||||
return False
|
||||
|
||||
notional = margin * cfg.leverage
|
||||
qty = notional / price
|
||||
fee = notional * cfg.fee_rate
|
||||
|
||||
balance -= fee
|
||||
total_fee += fee
|
||||
today_fees += fee
|
||||
day_pnl -= fee
|
||||
|
||||
position = 1 if side == "long" else -1
|
||||
entry_price = price
|
||||
entry_time = ts_index[idx]
|
||||
entry_margin = margin
|
||||
entry_qty = qty
|
||||
return True
|
||||
|
||||
for i in range(n):
|
||||
bar_day = ts_index[i].date() if hasattr(ts_index[i], 'date') else None
|
||||
bar_hour = ts_index[i].hour if hasattr(ts_index[i], 'hour') else 0
|
||||
|
||||
if bar_day is not None and bar_day != current_day:
|
||||
pending_rebate += today_fees * cfg.rebate_pct
|
||||
today_fees = 0.0
|
||||
rebate_applied_today = False
|
||||
day_pnl = 0.0
|
||||
current_day = bar_day
|
||||
|
||||
if cfg.rebate_pct > 0 and not rebate_applied_today and bar_hour >= cfg.rebate_hour_utc and pending_rebate > 0:
|
||||
balance += pending_rebate
|
||||
total_rebate += pending_rebate
|
||||
pending_rebate = 0.0
|
||||
rebate_applied_today = True
|
||||
|
||||
if np.isnan(arr_upper[i]) or np.isnan(arr_lower[i]) or np.isnan(arr_mid[i]):
|
||||
out_equity[i] = balance + unrealised(arr_close[i])
|
||||
out_balance[i] = balance
|
||||
out_position[i] = position
|
||||
continue
|
||||
|
||||
fill_price = arr_close[i] if cfg.fill_at_close else None
|
||||
bullish = arr_close[i] > arr_open[i]
|
||||
bearish = arr_close[i] < arr_open[i]
|
||||
# 碰到均线:K 线贯穿或触及 mid
|
||||
touched_mid = arr_low[i] <= arr_mid[i] <= arr_high[i]
|
||||
touched_upper = arr_high[i] >= arr_upper[i]
|
||||
touched_lower = arr_low[i] <= arr_lower[i]
|
||||
|
||||
exec_upper = fill_price if fill_price is not None else arr_upper[i]
|
||||
exec_lower = fill_price if fill_price is not None else arr_lower[i]
|
||||
|
||||
# 1m 过滤:开多需先涨碰到,开空需先跌碰到
|
||||
touch_up_ok = True if arr_touch_dir is None else (arr_touch_dir[i] == 1)
|
||||
touch_down_ok = True if arr_touch_dir is None else (arr_touch_dir[i] == -1)
|
||||
|
||||
# 单根 K 线只允许一次操作
|
||||
if position == 1 and touched_upper:
|
||||
# 持多止盈
|
||||
close_position(exec_upper, i, "tp_upper")
|
||||
elif position == -1 and touched_lower:
|
||||
# 持空止盈
|
||||
close_position(exec_lower, i, "tp_lower")
|
||||
elif position == 1 and bearish and touched_mid and touch_down_ok:
|
||||
# 阴线触中轨: 平多并反手开空
|
||||
close_position(arr_close[i], i, "flip_to_short")
|
||||
if balance > 0:
|
||||
open_position("short", arr_close[i], i)
|
||||
elif position == -1 and bullish and touched_mid and touch_up_ok:
|
||||
# 阳线触中轨: 平空并反手开多
|
||||
close_position(arr_close[i], i, "flip_to_long")
|
||||
if balance > 0:
|
||||
open_position("long", arr_close[i], i)
|
||||
elif position == 0 and bullish and touched_mid and touch_up_ok:
|
||||
# 空仓开多
|
||||
open_position("long", arr_close[i], i)
|
||||
elif position == 0 and bearish and touched_mid and touch_down_ok:
|
||||
# 空仓开空
|
||||
open_position("short", arr_close[i], i)
|
||||
|
||||
out_equity[i] = balance + unrealised(arr_close[i])
|
||||
out_balance[i] = balance
|
||||
out_position[i] = position
|
||||
|
||||
if position != 0:
|
||||
close_position(arr_close[n - 1], n - 1, "end")
|
||||
out_equity[n - 1] = balance
|
||||
out_balance[n - 1] = balance
|
||||
out_position[n - 1] = 0
|
||||
|
||||
eq_df = pd.DataFrame({
|
||||
"equity": out_equity,
|
||||
"balance": out_balance,
|
||||
"price": arr_close,
|
||||
"position": out_position,
|
||||
}, index=ts_index)
|
||||
|
||||
daily_eq = eq_df["equity"].resample("1D").last().dropna().to_frame("equity")
|
||||
daily_eq["pnl"] = daily_eq["equity"].diff().fillna(0.0)
|
||||
|
||||
return BBMidlineResult(
|
||||
equity_curve=eq_df,
|
||||
trades=trades,
|
||||
daily_stats=daily_eq,
|
||||
total_fee=total_fee,
|
||||
total_rebate=total_rebate,
|
||||
config=cfg,
|
||||
)
|
||||
@@ -1,14 +1,16 @@
|
||||
"""
|
||||
数据加载模块 - 从 SQLite 加载多周期K线数据为 DataFrame
|
||||
"""
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from peewee import SqliteDatabase
|
||||
from pathlib import Path
|
||||
|
||||
DB_PATH = Path(__file__).parent.parent / 'models' / 'database.db'
|
||||
|
||||
# 周期 -> 表名
|
||||
# 周期 -> 表名 (bitmart / binance)
|
||||
PERIOD_MAP = {
|
||||
'1s': 'bitmart_eth_1s',
|
||||
'1m': 'bitmart_eth_1m',
|
||||
'3m': 'bitmart_eth_3m',
|
||||
'5m': 'bitmart_eth_5m',
|
||||
@@ -17,17 +19,29 @@ PERIOD_MAP = {
|
||||
'1h': 'bitmart_eth_1h',
|
||||
}
|
||||
|
||||
BINANCE_PERIOD_MAP = {
|
||||
'1s': 'binance_eth_1s',
|
||||
'1m': 'binance_eth_1m',
|
||||
'3m': 'binance_eth_3m',
|
||||
'5m': 'binance_eth_5m',
|
||||
'15m': 'binance_eth_15m',
|
||||
'30m': 'binance_eth_30m',
|
||||
'1h': 'binance_eth_1h',
|
||||
}
|
||||
|
||||
def load_klines(period: str, start_date: str, end_date: str, tz: str | None = None) -> pd.DataFrame:
|
||||
|
||||
def load_klines(period: str, start_date: str, end_date: str, tz: str | None = None,
|
||||
source: str = "bitmart") -> pd.DataFrame:
|
||||
"""
|
||||
加载指定周期、指定日期范围的K线数据
|
||||
:param period: '1m','3m','5m','15m','30m','1h'
|
||||
:param period: '1s','1m','3m','5m','15m','30m','1h'
|
||||
:param start_date: 'YYYY-MM-DD'
|
||||
:param end_date: 'YYYY-MM-DD' (不包含该日)
|
||||
:param tz: 日期解释的时区,如 'Asia/Shanghai' 表示按北京时间;None 则用本地时区
|
||||
:return: DataFrame with columns: datetime, open, high, low, close
|
||||
"""
|
||||
table = PERIOD_MAP.get(period)
|
||||
period_map = BINANCE_PERIOD_MAP if source == "binance" else PERIOD_MAP
|
||||
table = period_map.get(period)
|
||||
if not table:
|
||||
raise ValueError(f"不支持的周期: {period}, 可选: {list(PERIOD_MAP.keys())}")
|
||||
|
||||
@@ -56,18 +70,55 @@ def load_klines(period: str, start_date: str, end_date: str, tz: str | None = No
|
||||
return df
|
||||
|
||||
|
||||
def load_multi_period(periods: list, start_date: str, end_date: str) -> dict:
|
||||
def load_multi_period(periods: list, start_date: str, end_date: str, source: str = "bitmart") -> dict:
|
||||
"""
|
||||
加载多个周期的数据
|
||||
:return: {period: DataFrame}
|
||||
"""
|
||||
result = {}
|
||||
for p in periods:
|
||||
result[p] = load_klines(p, start_date, end_date)
|
||||
result[p] = load_klines(p, start_date, end_date, source=source)
|
||||
print(f" 加载 {p}: {len(result[p])} 条 ({start_date} ~ {end_date})")
|
||||
return result
|
||||
|
||||
|
||||
def get_1m_touch_direction(df_5m: pd.DataFrame, df_1m: pd.DataFrame,
|
||||
arr_mid: np.ndarray, kline_step_min: int = 5) -> np.ndarray:
|
||||
"""
|
||||
根据 1 分钟线判断每根 5m K 线「先涨碰到均线」还是「先跌碰到均线」。
|
||||
返回: 1=先涨碰到(可开多), -1=先跌碰到(可开空), 0=未碰到或无法判断
|
||||
"""
|
||||
df_1m = df_1m.copy()
|
||||
df_1m["_bucket"] = df_1m.index.floor(f"{kline_step_min}min")
|
||||
|
||||
# 5m 索引与 mid 对齐
|
||||
mid_sr = pd.Series(arr_mid, index=df_5m.index)
|
||||
|
||||
touch_map: dict[pd.Timestamp, int] = {}
|
||||
for bucket, grp in df_1m.groupby("_bucket", sort=True):
|
||||
mid = mid_sr.get(bucket, np.nan)
|
||||
if pd.isna(mid):
|
||||
touch_map[bucket] = 0
|
||||
continue
|
||||
|
||||
o = grp["open"].to_numpy(dtype=float)
|
||||
h = grp["high"].to_numpy(dtype=float)
|
||||
l_ = grp["low"].to_numpy(dtype=float)
|
||||
|
||||
touch = 0
|
||||
for j in range(len(grp)):
|
||||
if l_[j] <= mid <= h[j]:
|
||||
touch = 1 if o[j] < mid else -1
|
||||
break
|
||||
touch_map[bucket] = touch
|
||||
|
||||
# 对齐到主周期 index
|
||||
out = np.zeros(len(df_5m), dtype=np.int32)
|
||||
for i, t in enumerate(df_5m.index):
|
||||
out[i] = touch_map.get(t, 0)
|
||||
return out
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
data = load_multi_period(['5m', '15m', '1h'], '2020-01-01', '2024-01-01')
|
||||
for k, v in data.items():
|
||||
|
||||
2193
strategy/results/bb_midline_15m_2020_2025_daily.csv
Normal file
2193
strategy/results/bb_midline_15m_2020_2025_daily.csv
Normal file
File diff suppressed because it is too large
Load Diff
19008
strategy/results/bb_midline_15m_2020_2025_trade_detail.csv
Normal file
19008
strategy/results/bb_midline_15m_2020_2025_trade_detail.csv
Normal file
File diff suppressed because it is too large
Load Diff
85
strategy/results/bb_midline_15m_param_sweep.csv
Normal file
85
strategy/results/bb_midline_15m_param_sweep.csv
Normal file
@@ -0,0 +1,85 @@
|
||||
period,std,period_step,std_step,final_eq,ret_pct,n_trades,win_rate,sharpe,dd
|
||||
15,1.5,10,0.5,48.48092814523593,-75.75953592738203,39080,37.35926305015353,-0.13119006344299677,-697.4004561224623
|
||||
15,2.0,10,0.5,36.80358364077569,-81.59820817961216,40087,34.42263077805772,-0.1511470195866686,-639.962755073432
|
||||
15,2.5,10,0.5,15.801154047365497,-92.09942297631726,41183,31.27746885850958,-0.2043489750410225,-608.2984283591458
|
||||
15,3.0,10,0.5,10.259192622590602,-94.8704036887047,42341,28.449965754233485,-0.2628767129294784,-456.8505810537002
|
||||
15,3.5,10,0.5,10.780007201280425,-94.60999639935979,43317,26.490754207355078,-0.3519748652128244,-315.69577713194894
|
||||
15,4.0,10,0.5,6.762275289834179,-96.61886235508291,43780,25.48423937871174,-0.44416507239126524,-220.0935343290423
|
||||
25,1.5,10,0.5,15.185351901530389,-92.4073240492348,29514,35.12909127871519,-0.4186681901048435,-273.0478151000914
|
||||
25,2.0,10,0.5,11.75114974910751,-94.12442512544625,30273,31.972384633171476,-0.4746326737292537,-221.26735265117904
|
||||
25,2.5,10,0.5,22.991590869749515,-88.50420456512524,30921,29.355454222049737,-0.48801085648391873,-209.49673224901383
|
||||
25,3.0,10,0.5,32.34220252441412,-83.82889873779294,31558,27.05177767919387,-0.3753596284992899,-198.35054814330795
|
||||
25,3.5,10,0.5,21.650159567897365,-89.17492021605132,32117,25.503627362456022,-0.39733883257515135,-218.6979255650799
|
||||
25,4.0,10,0.5,31.860026972198018,-84.06998651390099,32563,24.432638270429628,-0.29302419118789713,-239.82444497645355
|
||||
35,1.5,10,0.5,4.101201077511393,-97.9493994612443,24993,33.06525827231625,-0.8217792504548787,-245.46414083107442
|
||||
35,2.0,10,0.5,5.823800486102119,-97.08809975694894,25587,29.866729198421073,-0.7426470214087769,-286.4406699983145
|
||||
35,2.5,10,0.5,5.192863521634847,-97.40356823918258,26051,27.265747955932596,-0.7730880094730899,-266.1512752758687
|
||||
35,3.0,10,0.5,3.4579745963381434,-98.27101270183093,26599,25.33553893003496,-0.4636391572882053,-387.52773267113974
|
||||
35,3.5,10,0.5,3.5341183807460554,-98.23294080962697,27034,24.058592883036177,-0.5140569048308203,-362.5140804337234
|
||||
35,4.0,10,0.5,5.611416981128725,-97.19429150943564,27353,23.255218805981063,-0.3312688921086745,-564.2468214116803
|
||||
45,1.5,10,0.5,14.632970646405713,-92.68351467679715,21687,32.23590169225803,-0.6509354804642926,-235.74612368411292
|
||||
45,2.0,10,0.5,31.77948296599959,-84.1102585170002,22150,29.16027088036117,-0.4284165792843191,-269.6776110433831
|
||||
45,2.5,10,0.5,172.40643379727345,-13.796783101363275,22525,26.81908990011099,-0.043299240462867164,-256.7844732672258
|
||||
45,3.0,10,0.5,41.377840288991365,-79.31107985550432,22953,25.077331939180063,-0.34899879597984057,-296.6696402361111
|
||||
45,3.5,10,0.5,74.54221936958507,-62.728890315207465,23241,24.052321328686375,-0.2535287445141998,-305.77109805667635
|
||||
45,4.0,10,0.5,197.09642100514674,-1.4517894974266312,23514,23.394573445606873,-0.003849297905947261,-346.25462265446606
|
||||
55,1.5,10,0.5,16.079473075595672,-91.96026346220216,19596,31.02163706878955,-0.6486187784866569,-231.27610776888795
|
||||
55,2.0,10,0.5,66.87668346352854,-66.56165826823573,19950,28.25062656641604,-0.33475319699218586,-252.4384445697346
|
||||
55,2.5,10,0.5,103.71180081815875,-48.144099590920625,20315,26.059561900073835,-0.23234055949460508,-230.74049378986336
|
||||
55,3.0,10,0.5,30.706542292630328,-84.64672885368483,20620,24.539282250242483,-0.5332739163457259,-280.4316033186037
|
||||
55,3.5,10,0.5,19.94144489188811,-90.02927755405594,20900,23.535885167464116,-0.4556365722046084,-337.09291756128977
|
||||
55,4.0,10,0.5,35.10054549461695,-82.44972725269153,21094,22.88802503081445,-0.41982398626910356,-291.17676700223814
|
||||
65,1.5,10,0.5,40.332952988339386,-79.8335235058303,17772,30.31172631105109,-0.37260054288227523,-282.40115704942934
|
||||
65,2.0,10,0.5,50.70752436109092,-74.64623781945454,18112,27.49006183745583,-0.4263815652152113,-215.11807270889656
|
||||
65,2.5,10,0.5,208.09642220895924,4.04821110447962,18381,25.55356074207062,0.013052853027704602,-225.3544321606581
|
||||
65,3.0,10,0.5,69.17941178529537,-65.41029410735231,18603,24.27565446433371,-0.3475091632420777,-267.8026072891796
|
||||
65,3.5,10,0.5,205.87085569261697,2.9354278463084853,18841,23.459476673212677,0.007794090142701672,-365.7703099142676
|
||||
65,4.0,10,0.5,295.45309206039354,47.72654603019677,19007,22.812647971799862,0.07753257373956958,-359.300057037728
|
||||
75,1.5,10,0.5,10.983713106190567,-94.50814344690471,16303,29.761393608538306,-0.7512444028811992,-213.15198872906865
|
||||
75,2.0,10,0.5,13.482406589107267,-93.25879670544637,16620,27.081829121540313,-0.9839660957936669,-208.4588882425938
|
||||
75,2.5,10,0.5,89.942884051582,-55.028557974209,16868,25.43277211287645,-0.36375113759430683,-211.31503916370698
|
||||
75,3.0,10,0.5,52.241254269813616,-73.87937286509319,17087,24.28747000643764,-0.5981765475484465,-226.7492413952581
|
||||
75,3.5,10,0.5,83.14852160988522,-58.42573919505739,17305,23.449869979774633,-0.3267893523857235,-230.606510358243
|
||||
75,4.0,10,0.5,119.23474995074422,-40.38262502462789,17460,22.82359679266896,-0.20534903490050124,-207.9658889220549
|
||||
85,1.5,10,0.5,7.349676583985419,-96.32516170800729,15179,28.89518413597734,-0.8318675275223718,-239.72913883031944
|
||||
85,2.0,10,0.5,18.984025431376047,-90.50798728431198,15430,26.629941672067403,-0.7833690422200502,-235.6042347672767
|
||||
85,2.5,10,0.5,57.167618532561264,-71.41619073371936,15664,24.86593462717058,-0.506936066912954,-235.03840225356828
|
||||
85,3.0,10,0.5,35.58954831791428,-82.20522584104286,15844,23.54834637717748,-0.6040070996108049,-234.6785523683346
|
||||
85,3.5,10,0.5,63.4069876968914,-68.2965061515543,16023,22.72982587530425,-0.3382080473039228,-295.9762241559409
|
||||
85,4.0,10,0.5,88.47696456769705,-55.761517716151474,16178,22.147360613178392,-0.20193042953347687,-316.4817254821683
|
||||
95,1.5,10,0.5,10.405821375357965,-94.79708931232102,14416,28.24639289678135,-0.7837973560897118,-270.90798093738533
|
||||
95,2.0,10,0.5,13.815903557653941,-93.09204822117303,14665,25.741561541084213,-0.8765580107174691,-263.12113920477657
|
||||
95,2.5,10,0.5,25.71688278154052,-87.14155860922975,14858,23.832278906986133,-0.6723450672405393,-274.7658311337973
|
||||
95,3.0,10,0.5,19.356147709815595,-90.3219261450922,15049,22.652667951358893,-0.726365789425801,-269.1728308007388
|
||||
95,3.5,10,0.5,25.893289102448367,-87.05335544877582,15185,22.081000987816925,-0.6885792508968731,-278.83350717325703
|
||||
95,4.0,10,0.5,34.075610133322904,-82.96219493333855,15310,21.606792945787067,-0.541211763961438,-255.9863145165913
|
||||
105,1.5,10,0.5,11.125302869126308,-94.43734856543685,13778,27.340688053418493,-0.6600706399042071,-269.35929952511646
|
||||
105,2.0,10,0.5,10.200827786542048,-94.89958610672898,14010,24.753747323340473,-0.6866326886722063,-258.9303568592826
|
||||
105,2.5,10,0.5,9.579821710127378,-95.2100891449363,14163,23.151874602838383,-0.5987791032180315,-274.5676511660392
|
||||
105,3.0,10,0.5,4.3087765598937855,-97.84561172005311,14346,21.971281193364003,-0.6400093736324544,-278.89884430849224
|
||||
105,3.5,10,0.5,13.027667066344636,-93.48616646682768,14469,21.528785679729076,-0.5524535568435962,-284.41705640185387
|
||||
105,4.0,10,0.5,13.547757879797267,-93.22612106010136,14605,21.027045532351934,-0.3485713143577096,-412.93208491456176
|
||||
115,1.5,10,0.5,29.66121970936215,-85.16939014531893,13296,27.030685920577618,-0.45172471596332026,-235.02860926589415
|
||||
115,2.0,10,0.5,14.293240724692515,-92.85337963765375,13517,24.4432936302434,-0.568103750659441,-232.03742432596695
|
||||
115,2.5,10,0.5,11.574164514147391,-94.21291774292631,13681,22.87113515093926,-0.4778439718297106,-259.1164560473074
|
||||
115,3.0,10,0.5,9.287076704988312,-95.35646164750584,13830,21.800433839479393,-0.44032821158432417,-275.63595981438704
|
||||
115,3.5,10,0.5,21.398944760292235,-89.30052761985388,13960,21.181948424068768,-0.287420801784064,-317.14370796930467
|
||||
115,4.0,10,0.5,60.40509496475816,-69.79745251762091,14063,20.75659532105525,-0.09411868706769629,-829.2395563032217
|
||||
15,1.5,20,1.0,48.48092814523593,-75.75953592738203,39080,37.35926305015353,-0.13119006344299677,-697.4004561224623
|
||||
15,2.5,20,1.0,15.801154047365497,-92.09942297631726,41183,31.27746885850958,-0.2043489750410225,-608.2984283591458
|
||||
15,3.5,20,1.0,10.780007201280425,-94.60999639935979,43317,26.490754207355078,-0.3519748652128244,-315.69577713194894
|
||||
35,1.5,20,1.0,4.101201077511393,-97.9493994612443,24993,33.06525827231625,-0.8217792504548787,-245.46414083107442
|
||||
35,2.5,20,1.0,5.192863521634847,-97.40356823918258,26051,27.265747955932596,-0.7730880094730899,-266.1512752758687
|
||||
35,3.5,20,1.0,3.5341183807460554,-98.23294080962697,27034,24.058592883036177,-0.5140569048308203,-362.5140804337234
|
||||
55,1.5,20,1.0,16.079473075595672,-91.96026346220216,19596,31.02163706878955,-0.6486187784866569,-231.27610776888795
|
||||
55,2.5,20,1.0,103.71180081815875,-48.144099590920625,20315,26.059561900073835,-0.23234055949460508,-230.74049378986336
|
||||
55,3.5,20,1.0,19.94144489188811,-90.02927755405594,20900,23.535885167464116,-0.4556365722046084,-337.09291756128977
|
||||
75,1.5,20,1.0,10.983713106190567,-94.50814344690471,16303,29.761393608538306,-0.7512444028811992,-213.15198872906865
|
||||
75,2.5,20,1.0,89.942884051582,-55.028557974209,16868,25.43277211287645,-0.36375113759430683,-211.31503916370698
|
||||
75,3.5,20,1.0,83.14852160988522,-58.42573919505739,17305,23.449869979774633,-0.3267893523857235,-230.606510358243
|
||||
95,1.5,20,1.0,10.405821375357965,-94.79708931232102,14416,28.24639289678135,-0.7837973560897118,-270.90798093738533
|
||||
95,2.5,20,1.0,25.71688278154052,-87.14155860922975,14858,23.832278906986133,-0.6723450672405393,-274.7658311337973
|
||||
95,3.5,20,1.0,25.893289102448367,-87.05335544877582,15185,22.081000987816925,-0.6885792508968731,-278.83350717325703
|
||||
115,1.5,20,1.0,29.66121970936215,-85.16939014531893,13296,27.030685920577618,-0.45172471596332026,-235.02860926589415
|
||||
115,2.5,20,1.0,11.574164514147391,-94.21291774292631,13681,22.87113515093926,-0.4778439718297106,-259.1164560473074
|
||||
115,3.5,20,1.0,21.398944760292235,-89.30052761985388,13960,21.181948424068768,-0.287420801784064,-317.14370796930467
|
||||
|
2193
strategy/results/bb_midline_2020_2025_daily.csv
Normal file
2193
strategy/results/bb_midline_2020_2025_daily.csv
Normal file
File diff suppressed because it is too large
Load Diff
74474
strategy/results/bb_midline_2020_2025_trade_detail.csv
Normal file
74474
strategy/results/bb_midline_2020_2025_trade_detail.csv
Normal file
File diff suppressed because it is too large
Load Diff
2193
strategy/results/bb_midline_30m_2020_2025_daily.csv
Normal file
2193
strategy/results/bb_midline_30m_2020_2025_daily.csv
Normal file
File diff suppressed because it is too large
Load Diff
13142
strategy/results/bb_midline_30m_2020_2025_trade_detail.csv
Normal file
13142
strategy/results/bb_midline_30m_2020_2025_trade_detail.csv
Normal file
File diff suppressed because it is too large
Load Diff
85
strategy/results/bb_midline_30m_param_sweep.csv
Normal file
85
strategy/results/bb_midline_30m_param_sweep.csv
Normal file
@@ -0,0 +1,85 @@
|
||||
period,std,period_step,std_step,final_eq,ret_pct,n_trades,win_rate,sharpe,dd
|
||||
15,1.5,10,0.5,11.855192165034223,-94.07240391748289,19708,37.77146336513091,-0.6235222422995786,-284.85443596149724
|
||||
15,2.0,10,0.5,8.753359275898845,-95.62332036205058,20195,35.246348105966824,-0.7569673183718936,-263.2971212724792
|
||||
15,2.5,10,0.5,9.803525418208569,-95.09823729089571,20708,32.639559590496425,-0.4752350103234552,-277.4245022765702
|
||||
15,3.0,10,0.5,3.412780495824038,-98.29360975208797,21275,29.83783783783784,-0.511480053076418,-338.8119559579532
|
||||
15,3.5,10,0.5,6.198174773117584,-96.9009126134412,21716,27.73531037023393,-0.5128705717437164,-313.48715997416474
|
||||
15,4.0,10,0.5,20.69226809284817,-89.65386595357592,21948,26.571897211591033,-0.32674764882357116,-403.7400501883454
|
||||
25,1.5,10,0.5,5.836491805389524,-97.08175409730524,15020,35.22636484687084,-1.2249549689127937,-204.09205005290724
|
||||
25,2.0,10,0.5,12.081211963616443,-93.95939401819177,15311,32.577885180589114,-0.8898463515682434,-222.54350054966164
|
||||
25,2.5,10,0.5,19.914003433039493,-90.04299828348026,15659,30.161568427102626,-0.7895621638697325,-209.1994100018314
|
||||
25,3.0,10,0.5,9.425303324148096,-95.28734833792595,15976,28.067100650976464,-0.7300825335867858,-243.96197406916642
|
||||
25,3.5,10,0.5,5.855289614688857,-97.07235519265558,16253,26.55509752045776,-0.7085359518779542,-278.87154684168763
|
||||
25,4.0,10,0.5,19.200810578463244,-90.39959471076838,16495,25.407699302819037,-0.5772741076812997,-259.23352233813335
|
||||
35,1.5,10,0.5,28.21206634200495,-85.89396682899752,12085,34.73727761688043,-0.647009511262925,-223.61914840751774
|
||||
35,2.0,10,0.5,55.70970922376068,-72.14514538811966,12306,31.569965870307165,-0.39673167475158405,-248.8668646132019
|
||||
35,2.5,10,0.5,104.49489503334085,-47.75255248332957,12520,29.249201277955272,-0.235045001015176,-230.00122971261297
|
||||
35,3.0,10,0.5,56.342667499287515,-71.82866625035624,12752,27.40746549560853,-0.3682997075298054,-252.50663799518358
|
||||
35,3.5,10,0.5,107.45577769881035,-46.272111150594824,12984,26.070548367221196,-0.11749439894681797,-338.48701280893147
|
||||
35,4.0,10,0.5,247.34481984104798,23.67240992052399,13141,25.34053724982878,0.056546089336753404,-264.63887018550304
|
||||
45,1.5,10,0.5,13.15646879250955,-93.42176560374523,10385,34.10688493018777,-0.8149857539481573,-271.2863404459294
|
||||
45,2.0,10,0.5,11.80829464190141,-94.0958526790493,10598,31.307793923381773,-0.8912043997401211,-297.47872205043245
|
||||
45,2.5,10,0.5,19.14157030465441,-90.4292148476728,10763,28.96032704636254,-0.6910660598831703,-311.4102276700665
|
||||
45,3.0,10,0.5,8.655841919185013,-95.6720790404075,10963,27.091124692146312,-0.7225121606690603,-326.33298667933167
|
||||
45,3.5,10,0.5,11.91144901552033,-94.04427549223983,11138,26.08188184593284,-0.4970305469345722,-405.3189086446707
|
||||
45,4.0,10,0.5,9.249110224038603,-95.3754448879807,11280,25.407801418439718,-0.41890741502953877,-461.95310334212525
|
||||
55,1.5,10,0.5,18.500960550013694,-90.74951972499315,9480,32.07805907172996,-0.8630311046085801,-217.10439532674513
|
||||
55,2.0,10,0.5,17.84513535296389,-91.07743232351805,9674,29.0262559437668,-0.8346686137946728,-233.79233332465478
|
||||
55,2.5,10,0.5,11.28795717324628,-94.35602141337687,9829,26.899989826025028,-0.7157999288001704,-250.0470782402587
|
||||
55,3.0,10,0.5,6.758810067617017,-96.62059496619149,9991,25.3628265438895,-0.7901176121561565,-250.49463359988766
|
||||
55,3.5,10,0.5,25.48546333282715,-87.25726833358642,10108,24.39651760981401,-0.4341398096630764,-238.0657728760076
|
||||
55,4.0,10,0.5,29.947033814854976,-85.0264830925725,10226,23.714062194406416,-0.22621028615725514,-308.2508768025071
|
||||
65,1.5,10,0.5,70.01498211022908,-64.99250894488546,8797,31.41980220529726,-0.2472823034078909,-360.22920891906733
|
||||
65,2.0,10,0.5,43.99985728425265,-78.00007135787368,8982,28.635047873524826,-0.31226067485305287,-344.43297562483747
|
||||
65,2.5,10,0.5,11.141230088157057,-94.42938495592148,9139,26.326731589889484,-0.5877699195318181,-211.49453353955298
|
||||
65,3.0,10,0.5,23.243485816159232,-88.37825709192039,9249,25.14866472051033,-0.4199885865099326,-225.22292758760577
|
||||
65,3.5,10,0.5,30.046303723946345,-84.97684813802682,9351,24.371724949203294,-0.19507372955886226,-583.9077968841493
|
||||
65,4.0,10,0.5,72.17368768595833,-63.913156157020836,9438,23.924560288196652,-0.1043229443150086,-677.8833873149147
|
||||
75,1.5,10,0.5,28.878912457463993,-85.560543771268,8286,30.762732319575186,-0.712313061605688,-183.61532124127612
|
||||
75,2.0,10,0.5,14.421291378727464,-92.78935431063627,8483,27.77319344571496,-0.8044560280829893,-201.50595876109264
|
||||
75,2.5,10,0.5,4.806399583771505,-97.59680020811425,8610,26.10917537746806,-0.9313204289980628,-210.20790025893479
|
||||
75,3.0,10,0.5,25.508786019142804,-87.2456069904286,8727,24.876819067262517,-0.49409805140782975,-215.2630427100224
|
||||
75,3.5,10,0.5,16.653002578165868,-91.67349871091707,8830,23.997734994337485,-0.38357581879982244,-240.9197266621369
|
||||
75,4.0,10,0.5,66.21022764054645,-66.89488617972677,8918,23.716079838528817,-0.1250596640250747,-698.6447378168509
|
||||
85,1.5,10,0.5,14.951030134591296,-92.52448493270435,7845,29.547482472912684,-0.8953650772108298,-197.64150282305923
|
||||
85,2.0,10,0.5,3.498277467815169,-98.25086126609241,8019,26.66167851353037,-1.0458276339206454,-214.15579835858927
|
||||
85,2.5,10,0.5,1.7737078631867869,-99.1131460684066,8156,25.0,-1.0282285179369723,-213.61753481478925
|
||||
85,3.0,10,0.5,8.719403599603398,-95.6402982001983,8248,24.114936954413192,-0.8211787209745792,-211.61074718573
|
||||
85,3.5,10,0.5,8.943987615516464,-95.52800619224176,8328,23.499039385206533,-0.7549418677035037,-215.98611912681693
|
||||
85,4.0,10,0.5,23.1770265836258,-88.4114867081871,8401,23.021068920366623,-0.3729888932052693,-212.96678953288284
|
||||
95,1.5,10,0.5,24.927710059813517,-87.53614497009325,7408,29.306155507559396,-0.9520827117838521,-190.41061079110813
|
||||
95,2.0,10,0.5,16.06239432079733,-91.96880283960134,7527,26.69058057659094,-0.9398549359933428,-198.34239467123092
|
||||
95,2.5,10,0.5,21.973918801798945,-89.01304059910052,7633,25.153936853137694,-0.7146688539676412,-194.44238080585185
|
||||
95,3.0,10,0.5,45.828446580797696,-77.08577670960115,7709,24.361136334154885,-0.43326307968690586,-186.11539161963253
|
||||
95,3.5,10,0.5,60.57066438340541,-69.71466780829729,7806,23.7253394824494,-0.27195008259729253,-247.0975110088031
|
||||
95,4.0,10,0.5,143.79458015304226,-28.10270992347887,7872,23.310467479674795,-0.05263662190109353,-598.1389379467043
|
||||
105,1.5,10,0.5,16.454388894063115,-91.77280555296844,6991,28.92290087255042,-0.8170686782691946,-199.83483128223048
|
||||
105,2.0,10,0.5,17.491042243515682,-91.25447887824215,7107,26.72013507809202,-0.6527938090965348,-198.51731255242447
|
||||
105,2.5,10,0.5,13.7537652656679,-93.12311736716605,7193,25.079938829417493,-0.5618187399818152,-219.0288186814003
|
||||
105,3.0,10,0.5,26.65257798217648,-86.67371100891177,7272,24.284928492849282,-0.31235378013631904,-405.153180534651
|
||||
105,3.5,10,0.5,22.934969797555294,-88.53251510122236,7337,23.72904456862478,-0.3120317109901497,-344.1527116262127
|
||||
105,4.0,10,0.5,52.74918908477296,-73.62540545761352,7389,23.318446339152796,-0.13089661662245716,-768.1307536755826
|
||||
115,1.5,10,0.5,6.321018890365941,-96.83949055481703,6643,28.631642330272467,-1.0099053237536952,-206.58136634538567
|
||||
115,2.0,10,0.5,8.586175448038853,-95.70691227598057,6751,26.307213746111685,-0.7835254269427628,-220.54728033133756
|
||||
115,2.5,10,0.5,10.376641254511714,-94.81167937274414,6839,24.681971048398886,-0.6364432358639216,-218.41178219528035
|
||||
115,3.0,10,0.5,9.20546544012515,-95.39726727993742,6921,23.81158792082069,-0.594131818951341,-207.12155382705376
|
||||
115,3.5,10,0.5,7.630256305421915,-96.18487184728905,6966,23.16968130921619,-0.5844894984911244,-221.95436668671815
|
||||
115,4.0,10,0.5,7.8321546288246875,-96.08392268558765,7019,22.838011112694115,-0.44419049676595773,-229.18136807602502
|
||||
15,1.5,20,1.0,11.855192165034223,-94.07240391748289,19708,37.77146336513091,-0.6235222422995786,-284.85443596149724
|
||||
15,2.5,20,1.0,9.803525418208569,-95.09823729089571,20708,32.639559590496425,-0.4752350103234552,-277.4245022765702
|
||||
15,3.5,20,1.0,6.198174773117584,-96.9009126134412,21716,27.73531037023393,-0.5128705717437164,-313.48715997416474
|
||||
35,1.5,20,1.0,28.21206634200495,-85.89396682899752,12085,34.73727761688043,-0.647009511262925,-223.61914840751774
|
||||
35,2.5,20,1.0,104.49489503334085,-47.75255248332957,12520,29.249201277955272,-0.235045001015176,-230.00122971261297
|
||||
35,3.5,20,1.0,107.45577769881035,-46.272111150594824,12984,26.070548367221196,-0.11749439894681797,-338.48701280893147
|
||||
55,1.5,20,1.0,18.500960550013694,-90.74951972499315,9480,32.07805907172996,-0.8630311046085801,-217.10439532674513
|
||||
55,2.5,20,1.0,11.28795717324628,-94.35602141337687,9829,26.899989826025028,-0.7157999288001704,-250.0470782402587
|
||||
55,3.5,20,1.0,25.48546333282715,-87.25726833358642,10108,24.39651760981401,-0.4341398096630764,-238.0657728760076
|
||||
75,1.5,20,1.0,28.878912457463993,-85.560543771268,8286,30.762732319575186,-0.712313061605688,-183.61532124127612
|
||||
75,2.5,20,1.0,4.806399583771505,-97.59680020811425,8610,26.10917537746806,-0.9313204289980628,-210.20790025893479
|
||||
75,3.5,20,1.0,16.653002578165868,-91.67349871091707,8830,23.997734994337485,-0.38357581879982244,-240.9197266621369
|
||||
95,1.5,20,1.0,24.927710059813517,-87.53614497009325,7408,29.306155507559396,-0.9520827117838521,-190.41061079110813
|
||||
95,2.5,20,1.0,21.973918801798945,-89.01304059910052,7633,25.153936853137694,-0.7146688539676412,-194.44238080585185
|
||||
95,3.5,20,1.0,60.57066438340541,-69.71466780829729,7806,23.7253394824494,-0.27195008259729253,-247.0975110088031
|
||||
115,1.5,20,1.0,6.321018890365941,-96.83949055481703,6643,28.631642330272467,-1.0099053237536952,-206.58136634538567
|
||||
115,2.5,20,1.0,10.376641254511714,-94.81167937274414,6839,24.681971048398886,-0.6364432358639216,-218.41178219528035
|
||||
115,3.5,20,1.0,7.630256305421915,-96.18487184728905,6966,23.16968130921619,-0.5844894984911244,-221.95436668671815
|
||||
|
2193
strategy/results/bb_midline_5m_2020_2025_daily.csv
Normal file
2193
strategy/results/bb_midline_5m_2020_2025_daily.csv
Normal file
File diff suppressed because it is too large
Load Diff
40604
strategy/results/bb_midline_5m_2020_2025_trade_detail.csv
Normal file
40604
strategy/results/bb_midline_5m_2020_2025_trade_detail.csv
Normal file
File diff suppressed because it is too large
Load Diff
85
strategy/results/bb_midline_5m_param_sweep.csv
Normal file
85
strategy/results/bb_midline_5m_param_sweep.csv
Normal file
@@ -0,0 +1,85 @@
|
||||
period,std,period_step,std_step,final_eq,ret_pct,n_trades,win_rate,sharpe,dd
|
||||
15,1.5,10,0.5,0.00047035550350871735,-99.99976482224825,111588,34.390794709108505,-1.0318566813340773,-202.38278172487549
|
||||
15,2.0,10,0.5,0.0003682458531207367,-99.99981587707344,114983,31.99951297148274,-1.0517447664263284,-207.00926699542296
|
||||
15,2.5,10,0.5,0.00013517790996149244,-99.99993241104502,118944,28.41841538875437,-1.066843300280861,-202.97365018191613
|
||||
15,3.0,10,0.5,2.7372158257389396e-05,-99.99998631392087,123018,25.341819896275343,-1.0375855233149691,-203.97454793219083
|
||||
15,3.5,10,0.5,7.669217720507588e-06,-99.99999616539114,125514,23.555141259142406,-1.0295116405913771,-199.9999926321606
|
||||
15,4.0,10,0.5,1.3373229853368135e-06,-99.9999993313385,126581,22.765659933165324,-1.0295288560138371,-199.99999869386636
|
||||
25,1.5,10,0.5,0.0017630495668879283,-99.99911847521656,84946,32.794952087208344,-1.293729889070109,-207.35144513711467
|
||||
25,2.0,10,0.5,0.0021262699573547064,-99.99893686502132,87416,29.61471584149355,-1.0769254917914826,-207.3230697431621
|
||||
25,2.5,10,0.5,0.019232972624929533,-99.99038351368753,89753,26.640892226443686,-0.7661744780665724,-282.9426200919278
|
||||
25,3.0,10,0.5,0.008324747423078871,-99.99583762628846,92114,24.08537247323968,-0.7701299195822682,-299.3619517674745
|
||||
25,3.5,10,0.5,0.0021990833038556443,-99.99890045834807,93887,22.321514160639918,-0.8594065630854474,-249.20948309430867
|
||||
25,4.0,10,0.5,0.0006738628522136209,-99.9996630685739,95030,21.376407450278858,-0.7576562230433436,-291.98051861072224
|
||||
35,1.5,10,0.5,0.02089403178818467,-99.98955298410591,72581,31.327757953183337,-1.3309409260309297,-202.064386268866
|
||||
35,2.0,10,0.5,0.04911133191480452,-99.97544433404259,74592,27.870280995280993,-1.1788018107980864,-208.19318228650735
|
||||
35,2.5,10,0.5,0.11339157723591194,-99.94330421138204,76304,25.05897462780457,-0.9891952503585197,-207.81448051914438
|
||||
35,3.0,10,0.5,0.11968128814263472,-99.94015935592869,77841,22.939068100358423,-0.8139159656385352,-221.5376495451823
|
||||
35,3.5,10,0.5,0.01984485951274019,-99.99007757024363,79196,21.3861811202586,-1.060687386107305,-230.0395662353739
|
||||
35,4.0,10,0.5,0.012363126554740892,-99.99381843672263,80118,20.540952095658906,-0.9081750231226203,-210.33305195479676
|
||||
45,1.5,10,0.5,0.06804612639104632,-99.96597693680448,63854,30.02474394712939,-1.129416637835604,-199.9327591253644
|
||||
45,2.0,10,0.5,0.08115056060726777,-99.95942471969637,65616,26.502682272616436,-0.9579345891598869,-236.4862054858405
|
||||
45,2.5,10,0.5,0.13538296683662002,-99.93230851658168,66915,23.782410520809982,-0.7075702450197628,-271.08910187835227
|
||||
45,3.0,10,0.5,0.09969712703152057,-99.95015143648423,68156,21.86307881917953,-0.6451318177267918,-295.9747288571139
|
||||
45,3.5,10,0.5,0.09210686086215344,-99.95394656956893,69136,20.51174496644295,-0.45887396866107066,-429.20953221378915
|
||||
45,4.0,10,0.5,0.08145389297753457,-99.95927305351124,69869,19.75554251527859,-0.5082958377978372,-369.88002808773837
|
||||
55,1.5,10,0.5,0.055918483619185166,-99.9720407581904,57008,29.073112545607632,-1.135641198208353,-205.86923282780617
|
||||
55,2.0,10,0.5,0.09137017136829197,-99.95431491431586,58485,25.582628024279728,-1.0618048081366185,-210.73187077440718
|
||||
55,2.5,10,0.5,0.15140570229310388,-99.92429714885346,59613,23.10402093503095,-0.9409011616127569,-214.74837340120598
|
||||
55,3.0,10,0.5,0.19074157711726422,-99.90462921144137,60601,21.458391775713274,-0.7210538774678307,-228.38551279326268
|
||||
55,3.5,10,0.5,0.266445127868473,-99.86677743606576,61404,20.28043775649795,-0.564524044727798,-243.9096107161547
|
||||
55,4.0,10,0.5,0.26774779880824356,-99.86612610059588,62052,19.62064075291691,-0.48626128008345376,-293.3629257317168
|
||||
65,1.5,10,0.5,0.04907015568532271,-99.97546492215734,52899,28.14230892833513,-1.1576453239098663,-199.95103322806455
|
||||
65,2.0,10,0.5,0.09845537769869178,-99.95077231115066,54133,24.896089261633385,-0.9612794470061556,-201.98589389095932
|
||||
65,2.5,10,0.5,0.14242537277814582,-99.92878731361093,55056,22.54068584713746,-1.0481822765622575,-217.92289691106637
|
||||
65,3.0,10,0.5,0.21445168112609417,-99.89277415943695,55869,20.963324920796865,-0.9157350431731428,-217.07298744964024
|
||||
65,3.5,10,0.5,0.11086043832824247,-99.94456978083588,56546,19.916528136384535,-0.889029811935134,-208.98004563743567
|
||||
65,4.0,10,0.5,0.13368760731622228,-99.93315619634188,57073,19.287579065407463,-0.6873579796541707,-224.09354725742426
|
||||
75,1.5,10,0.5,0.4210843943579031,-99.78945780282105,49258,27.441227820861585,-0.8547303664345759,-251.85239328153438
|
||||
75,2.0,10,0.5,0.4517921443623139,-99.77410392781884,50455,24.164106629670005,-0.6584921622071749,-294.1643492057131
|
||||
75,2.5,10,0.5,0.6840327479120798,-99.65798362604396,51222,22.05302409121081,-0.8751293718771636,-251.58583670556357
|
||||
75,3.0,10,0.5,1.0493683175491069,-99.47531584122545,51928,20.643968571868744,-0.8506313317219855,-240.16427918824203
|
||||
75,3.5,10,0.5,0.3002907430136643,-99.84985462849316,52522,19.66604470507597,-0.9150694199211542,-228.47263285477916
|
||||
75,4.0,10,0.5,0.5645103894047913,-99.7177448052976,52944,19.082426715019643,-0.5813832054508865,-339.28451518453875
|
||||
85,1.5,10,0.5,0.02561939348725843,-99.98719030325637,46669,26.347254065868135,-1.3394559452187687,-199.97440286154722
|
||||
85,2.0,10,0.5,0.027562363422181876,-99.9862188182889,47656,23.30871243914722,-1.6035376159684314,-199.97246157942988
|
||||
85,2.5,10,0.5,0.06710236812371269,-99.96644881593815,48349,21.363420132784547,-1.3159475743389093,-200.5606978611736
|
||||
85,3.0,10,0.5,0.06029185809930138,-99.96985407095035,48950,20.036772216547497,-1.1509308662867805,-202.6717296280356
|
||||
85,3.5,10,0.5,0.054195810082062756,-99.97290209495897,49451,19.18869183636327,-0.9659646629970992,-203.09667435496505
|
||||
85,4.0,10,0.5,0.0936191651022354,-99.95319041744888,49870,18.600360938439945,-0.6387572048825219,-267.1308034697755
|
||||
95,1.5,10,0.5,0.0978095706248613,-99.95109521468757,44232,26.064839934888766,-1.6362452282909372,-203.01129606801078
|
||||
95,2.0,10,0.5,0.09155064140685701,-99.95422467929657,45102,22.967939337501665,-1.4580521919101679,-199.97896885909833
|
||||
95,2.5,10,0.5,0.13353975402701052,-99.9332301229865,45683,21.053783683208195,-1.2834053444224973,-205.97722633464866
|
||||
95,3.0,10,0.5,0.11922415974801172,-99.940387920126,46243,19.793266007828212,-1.3127594636083004,-209.93002471500728
|
||||
95,3.5,10,0.5,0.08490721133074189,-99.95754639433463,46731,19.066572510753033,-0.9476179854957475,-209.6450016389805
|
||||
95,4.0,10,0.5,0.12790328947294202,-99.93604835526352,47067,18.550151911105445,-0.751921932535252,-215.34297603401436
|
||||
105,1.5,10,0.5,0.3107871173165156,-99.84460644134174,42457,25.289116046823846,-1.4384875040917713,-207.99320092200065
|
||||
105,2.0,10,0.5,0.4348322314181436,-99.78258388429093,43239,22.33862947801753,-1.3783320940275678,-207.42263371527645
|
||||
105,2.5,10,0.5,0.6519741878688033,-99.6740129060656,43819,20.49111116182478,-1.3838762571726289,-211.58787241883724
|
||||
105,3.0,10,0.5,0.6272088870954825,-99.68639555645225,44317,19.258975111131168,-1.1669183306576214,-214.76037206815255
|
||||
105,3.5,10,0.5,0.48414610299791855,-99.75792694850104,44756,18.587451961748144,-1.097312680815389,-218.08694275448883
|
||||
105,4.0,10,0.5,0.9238007100788466,-99.53809964496058,45088,18.071327182398864,-0.766833644617431,-228.08378402449856
|
||||
115,1.5,10,0.5,0.2519762013578816,-99.87401189932106,40603,24.907026574391054,-1.2068532641982856,-203.55972685901094
|
||||
115,2.0,10,0.5,0.24640178809971616,-99.87679910595014,41362,21.938010734490597,-1.1265561819825711,-205.1211003357915
|
||||
115,2.5,10,0.5,0.5104894066647994,-99.7447552966676,41895,20.179018976011456,-1.2283831092133597,-207.03468168503625
|
||||
115,3.0,10,0.5,0.3267094948301192,-99.83664525258494,42350,19.053128689492326,-0.9353309323210536,-214.927636848525
|
||||
115,3.5,10,0.5,0.4562186733246713,-99.77189066333766,42727,18.37713857748028,-0.8387344659201758,-212.4165991865744
|
||||
115,4.0,10,0.5,0.804703304477972,-99.59764834776101,42999,17.967859717667853,-0.6328910463396727,-230.00767242563782
|
||||
15,1.5,20,1.0,0.00047035550350871735,-99.99976482224825,111588,34.390794709108505,-1.0318566813340773,-202.38278172487549
|
||||
15,2.5,20,1.0,0.00013517790996149244,-99.99993241104502,118944,28.41841538875437,-1.066843300280861,-202.97365018191613
|
||||
15,3.5,20,1.0,7.669217720507588e-06,-99.99999616539114,125514,23.555141259142406,-1.0295116405913771,-199.9999926321606
|
||||
35,1.5,20,1.0,0.02089403178818467,-99.98955298410591,72581,31.327757953183337,-1.3309409260309297,-202.064386268866
|
||||
35,2.5,20,1.0,0.11339157723591194,-99.94330421138204,76304,25.05897462780457,-0.9891952503585197,-207.81448051914438
|
||||
35,3.5,20,1.0,0.01984485951274019,-99.99007757024363,79196,21.3861811202586,-1.060687386107305,-230.0395662353739
|
||||
55,1.5,20,1.0,0.055918483619185166,-99.9720407581904,57008,29.073112545607632,-1.135641198208353,-205.86923282780617
|
||||
55,2.5,20,1.0,0.15140570229310388,-99.92429714885346,59613,23.10402093503095,-0.9409011616127569,-214.74837340120598
|
||||
55,3.5,20,1.0,0.266445127868473,-99.86677743606576,61404,20.28043775649795,-0.564524044727798,-243.9096107161547
|
||||
75,1.5,20,1.0,0.4210843943579031,-99.78945780282105,49258,27.441227820861585,-0.8547303664345759,-251.85239328153438
|
||||
75,2.5,20,1.0,0.6840327479120798,-99.65798362604396,51222,22.05302409121081,-0.8751293718771636,-251.58583670556357
|
||||
75,3.5,20,1.0,0.3002907430136643,-99.84985462849316,52522,19.66604470507597,-0.9150694199211542,-228.47263285477916
|
||||
95,1.5,20,1.0,0.0978095706248613,-99.95109521468757,44232,26.064839934888766,-1.6362452282909372,-203.01129606801078
|
||||
95,2.5,20,1.0,0.13353975402701052,-99.9332301229865,45683,21.053783683208195,-1.2834053444224973,-205.97722633464866
|
||||
95,3.5,20,1.0,0.08490721133074189,-99.95754639433463,46731,19.066572510753033,-0.9476179854957475,-209.6450016389805
|
||||
115,1.5,20,1.0,0.2519762013578816,-99.87401189932106,40603,24.907026574391054,-1.2068532641982856,-203.55972685901094
|
||||
115,2.5,20,1.0,0.5104894066647994,-99.7447552966676,41895,20.179018976011456,-1.2283831092133597,-207.03468168503625
|
||||
115,3.5,20,1.0,0.4562186733246713,-99.77189066333766,42727,18.37713857748028,-0.8387344659201758,-212.4165991865744
|
||||
|
33
strategy/results/bb_midline_param_sweep.csv
Normal file
33
strategy/results/bb_midline_param_sweep.csv
Normal file
@@ -0,0 +1,33 @@
|
||||
period,std,final_eq,ret_pct,n_trades,win_rate,sharpe,dd
|
||||
10,1.5,0.05342370290338611,-99.9732881485483,65278,36.77808756395723,-1.5827730890254355,-200.11090187995964
|
||||
10,2.0,0.01988664648055615,-99.99005667675972,69456,37.21348767565077,-1.375492398950596,-200.74729198772366
|
||||
10,2.5,0.004545923852164151,-99.99772703807392,74138,37.50033720898864,-1.2284719936927497,-201.33569201183727
|
||||
10,3.0,0.0009123838658130715,-99.99954380806709,76146,37.615895779161086,-1.6590563717126823,-202.30746831252432
|
||||
20,1.5,0.3782564097262717,-99.81087179513686,47456,37.41992582602832,-1.773963308419704,-204.25419944748978
|
||||
20,2.0,0.10116775050634881,-99.94941612474683,49854,37.58374453403939,-1.6215139967794863,-207.24649370462032
|
||||
20,2.5,0.0420847966759596,-99.97895760166202,51496,38.30588783594842,-1.8732479488082094,-202.88341805372127
|
||||
20,3.0,0.03714319731018452,-99.98142840134491,52399,39.06563102349281,-1.7117920644966065,-201.30652434882285
|
||||
30,1.5,1.4879534896660909,-99.25602325516695,39618,37.46529355343531,-1.0597237275155744,-241.7741860257891
|
||||
30,2.0,0.5206306817787774,-99.73968465911061,41418,37.77343184122845,-1.2705250571479818,-204.3989052518405
|
||||
30,2.5,0.08578933249176414,-99.95710533375411,42437,38.86938284987158,-1.4392780573843966,-208.66548353770028
|
||||
30,3.0,0.06761980742073989,-99.96619009628964,42819,39.68331815315631,-1.24928580482028,-216.1250835959552
|
||||
50,1.5,1.8088706722788732,-99.09556466386056,31443,37.334223833603666,-1.4000644569639418,-202.32460954374
|
||||
50,2.0,1.028036476208118,-99.48598176189594,32460,38.44423906346272,-1.2716921237889525,-200.83851685504973
|
||||
50,2.5,0.11541810526712795,-99.94229094736643,32939,39.5306475606424,-1.203251914380095,-200.27701570363715
|
||||
50,3.0,0.1351670804614327,-99.93241645976929,33085,40.54405319631253,-1.0704484513755306,-200.26052595255356
|
||||
80,1.5,4.150889743129027,-97.92455512843549,25302,38.02861433878745,-1.6665676083991399,-202.37237995021502
|
||||
80,2.0,5.992075618322869,-97.00396219083856,25933,39.2704276404581,-1.2873048988895401,-222.45880619181088
|
||||
80,2.5,2.3099195066108917,-98.84504024669455,26064,40.29696132596685,-1.2180479656844296,-242.45465429040132
|
||||
80,3.0,2.334754168161419,-98.83262291591929,26050,41.051823416506714,-1.0505864510447513,-269.054135429288
|
||||
100,1.5,6.04121936461079,-96.97939031769461,22786,38.181339418941455,-1.4175370742512177,-196.92102711681954
|
||||
100,2.0,5.423127145984888,-97.28843642700755,23191,39.51101720495019,-1.2153007501059072,-231.1710791247756
|
||||
100,2.5,2.610862380586256,-98.69456880970687,23301,40.483241062615335,-1.1094891363618633,-259.30276840213105
|
||||
100,3.0,5.716308119598341,-97.14184594020082,23299,41.37945834585175,-0.7610979701772258,-288.02851880803166
|
||||
150,1.5,6.121437150276749,-96.93928142486162,18407,38.88194708534797,-1.002800854613305,-241.71726284052002
|
||||
150,2.0,1.1970630383174046,-99.4014684808413,18595,40.112933584296854,-1.1681812761761492,-224.23744764512085
|
||||
150,2.5,0.5963506942019386,-99.70182465289903,18625,41.261744966442954,-0.8184845317905666,-263.25717616484644
|
||||
150,3.0,0.6302294940489122,-99.68488525297555,18578,42.00129185057595,-0.8539049301221916,-284.17449718087295
|
||||
200,1.5,11.879732518914734,-94.06013374054264,15536,39.624098867147275,-0.966813276208611,-190.0398595048643
|
||||
200,2.0,7.102255587565593,-96.4488722062172,15612,40.949269792467334,-1.0272918700545648,-195.52766791647502
|
||||
200,2.5,7.996108371386221,-96.0019458143069,15618,42.00281726213343,-0.8066524896070545,-212.59859294532936
|
||||
200,3.0,12.272570900469248,-93.86371454976538,15593,42.57038414673251,-0.6873433542160784,-197.05958687744663
|
||||
|
Reference in New Issue
Block a user