alpheast.strategy.common.buy_and_hold_strategy module

class alpheast.strategy.common.buy_and_hold_strategy.BuyAndHoldStrategy(symbol, **kwargs)[source]

Bases: BaseStrategy

A simple Buy and Hold trading strategy.

This strategy buys the specified symbol once at the first available market event and holds it for the duration of the backtest.

Parameters:
  • symbol (str) – The financial instrument symbol this strategy will trade.

  • kwargs (Any) – Arbitrary keyword arguments passed to the base strategy.

on_market_event(event)[source]

Called when a new MarketEvent (e.g. a new bar of data) is received. Strategies should implement their trading logic here.