contains_cross_over#
- contains_cross_over(series1, series2, lookback_period=2, must_return_index=False)[source]#
Detect if the first series has crossed over the second. To be used in decide_trades()
- Parameters:
- Lookback_period:
The number of periods to look back to detect a crossover.
- Returns:
bool. True if the series has crossed over the other series in the latest iteration, False otherwise. If must_return_index is True, also returns the index of the crossover. Note the index is a negative index e.g. -1 is the latest index, -2 is the second latest etc.
- Return type: