is_crossover#

is_crossover(series1, series2)[source]#

Detect if two series have cross over. To be used in decide_trades()

Parameters:
  • series1 (Series) – A pandas.Series object.

  • series2 (Series) – A pandas.Series object.

Returns:

bool. True if the series has crossed over the other series in the latest iteration, False otherwise.

Return type:

bool

E.g.

decide_trades(…)

… if is_crossover(fast_ema_series, slow_ema_series):

visualisation.plot_indicator(timestamp, “Crossover 1”, PlotKind.technical_indicator_overlay_on_detached, fast_ema_latest, colour=”blue”, detached_overlay_name=”Fast EMA”, plot_shape=PlotShape.marker)