tzutrader
A composable C++ backtesting library for trading strategies (experimental)
Loading...
Searching...
No Matches
tzu::RSIStrat Class Reference

#include <strategies.h>

Inheritance diagram for tzu::RSIStrat:
tzu::Strategy< RSIStrat, Ohlcv >

Public Member Functions

 RSIStrat (size_t window_size=14, double oversold=30.0, double overbought=70.0)
Signal update (const Ohlcv &data)
Public Member Functions inherited from tzu::Strategy< RSIStrat, Ohlcv >
Signal update (const Ohlcv &data)

Detailed Description

The RSI strategy generates buy signals when the RSI value falls below the oversold threshold and sell signals when it rises above the overbought threshold. The strategy keeps track of the last signal to avoid generating multiple buy or sell signals in a row without an intervening signal of the opposite type. The field parameter allows the strategy to be applied to different price fields (e.g., close, high, low) in the OHLCV data. The default period for the RSI is set to 14, which is a common choice for this indicator.

Constructor & Destructor Documentation

◆ RSIStrat()

tzu::RSIStrat::RSIStrat ( size_t window_size = 14,
double oversold = 30.0,
double overbought = 70.0 )
inline

Member Function Documentation

◆ update()

Signal tzu::RSIStrat::update ( const Ohlcv & data)
inline

The documentation for this class was generated from the following file: