- main.py: add IBKR-style tiered fee schedule (fee_base + fee_per_share), PIT universe support, and open-to-close execution improvements - metrics.py: add raw_summary helper for JSON-safe metric export - Misc strategy fixes: deprecation warnings, NaN handling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 lines
416 B
Python
16 lines
416 B
Python
import pandas as pd
|
|
from strategies.base import Strategy
|
|
|
|
class BuyAndHoldStrategy(Strategy):
|
|
"""
|
|
A simple buy and hold strategy.
|
|
"""
|
|
|
|
def generate_signals(self, data):
|
|
"""
|
|
Generates equal weights for all assets.
|
|
"""
|
|
tickers = data.columns
|
|
weights = pd.DataFrame(1 / len(tickers), index=data.index, columns=tickers)
|
|
return weights.shift(1).fillna(0.0)
|