Compute trading signals based on a spread strategy.The function generates long and short entry/exit signals based on two
opposite indicators. It checks the conditions where one asset is up and the other is down
at the same time for initiating positions.Parameters:
Name
Type
Default
Description
model_output
ndarray
--
A 2d array representing model predictions for two assets.
long_entries
float
--
Threshold values for initiating long positions.
long_exits
float
--
Threshold values for exiting long positions.
short_entries
float
--
Threshold values for initiating short positions.
short_exits
float
--
Threshold values for exiting short positions.
clean
bool
to
True Clean signals. Defaults to True.
Returns:
Type
Description
Signals
A Signals object containing boolean arrays for long entries, long exits, short entries, and short exits.