|
tzutrader
A composable C++ backtesting library for trading strategies (experimental)
|
#include <strategies.h>
Public Member Functions | |
| SMACrossover (size_t short_period, size_t long_period, double threshold=0.0) | |
| Signal | update (const SingleValue &data) |
| Public Member Functions inherited from tzu::Strategy< SMACrossover, SingleValue > | |
| Signal | update (const SingleValue &data) |
The cross-over strategy using two Simple Moving Averages (SMA). Generates a buy signal when the short SMA crosses above the long SMA, and a sell signal when the short SMA crosses below the long SMA. The threshold parameter allows for a percentage-based buffer to avoid false signals in choppy markets.
|
inline |
|
inline |