Compound strategies combine multiple strategies together to generate signals.
The AllStrategies function takes one or more StrategyFunction and provides a StrategyFunction that will return a BUY or SELL action if all strategies are returning the same action, otherwise it will return a HOLD action.
strategy := indicator.AllStrategies(indicator.MacdStrategy, indicator.DefaultRsiStrategy)
actions := strategy(asset)
The RunStrategies function takes one or more StrategyFunction and returns the actions for each.
actions := indicator.RunStrategies(asset, indicator.MacdStrategy, indicator.DefaultRsiStrategy)
The SeparateStrategies function takes a buy strategy and a sell strategy.
It returns a BUY action if the buy strategy returns a BUY action and the the sell strategy returns a HOLD action.
It returns a SELL action if the sell strategy returns a SELL action and the buy strategy returns a HOLD action.
It returns HOLD otherwise.
strategy := indicator.SeparateStrategies(indicator.MacdStrategy, indicator.DefaultRsiStrategy)
actions := strategy(asset)
The MacdAndRsiStrategy function is a compound strategy that combines the MacdStrategy and the DefaultRsiStrategy. It will return a BUY or SELL action if both strategies are turning the same action, otherwise, it will return a HOLD action.
actions := indicator.MacdAndRsiStrategy(asset)
The information provided on this project is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.
Copyright (c) 2021 Onur Cinar. All Rights Reserved.
The source code is provided under MIT License.