Class MacdStrategy
java.lang.Object
com.quantfinlib.backtest.strategies.MacdStrategy
- All Implemented Interfaces:
TradingStrategy
MACD signal-line crossover: buy when MACD crosses above its signal line, sell on the reverse.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.quantfinlib.backtest.TradingStrategy
stopLossPct, takeProfitPct
-
Constructor Details
-
MacdStrategy
public MacdStrategy(int fast, int slow, int signalPeriod) -
MacdStrategy
public MacdStrategy()
-
-
Method Details
-
name
- Specified by:
namein interfaceTradingStrategy
-
init
- Specified by:
initin interfaceTradingStrategy
-
onBar
- Specified by:
onBarin interfaceTradingStrategy
-