is_crossover_constant#

is_crossover_constant(series, value)[source]#

Detect if a series has crossed over a constant value. To be used in decide_trades()

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

  • value (float) – A constant value to compare against.

Returns:

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

Return type:

bool

E.g.

decide_trades(…)

… if is_crossover_constant(fast_ema_series, 3300):

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