Skip to content

SmaCrossover


class backtide.strategies.SmaCrossover(fast_period=20, slow_period=50)

Simple Moving Average crossover strategy using fast and slow periods.

Generates buy and sell signals based on moving-average crossovers. A golden cross (fast MA crosses above slow MA) triggers a buy; a death cross (fast MA crosses below slow MA) triggers a sell. More robust than the naive SMA strategy because it requires confirmation from two different time horizons.

Parameters

fast_period : int, default=20

Fast moving average period.

slow_period : int, default=50
Slow moving average period.

Attributes

name : str

Human-readable strategy name.

is_multi_asset : bool
Whether this is a multi-asset strategy.


See Also

Macd

Moving Average Convergence Divergence crossover strategy.

Momentum

Trend-following strategy driven by short-term price momentum.

SmaNaive

Naive single Simple Moving Average trend-following strategy.


Methods

description Short explanation of what the strategy does.
required_indicators Indicators that must be computed up-front for this


method backtide.strategiesdescription()

Short explanation of what the strategy does.

Returns

str

The description.



method backtide.strategiesrequired_indicators()

Indicators that must be computed up-front for this

strategy.

Returns a list of indicator instances, already parameterised with this strategy's current settings, that the engine will auto-include before the simulation starts.

Returns

list

The required indicator instances.