|
tzutrader
A composable C++ backtesting library for trading strategies (experimental)
|
#include <strategies.h>
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) |
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.
|
inline |