Cross
Last modified: 20 February 2025Cross checks if two features cross each other or not. The inputs of this function are:
Timeframes: The timeframes in which the function is applied
First Indicator: First feature used in analysis.
Second Indicator: Second feature used in analysis
Output Column Name(s): The column in which the result is stored.
First Indicator and Second Indicator are the features that the function observes to detect crosses. Note that only numeric columns could be inputs of this function. The result column contains three labels:
not cross: lines dont cross each other.
cross over: the first line becomes larger than the second one.
cross under: the second line becomes larger than the first one.
Example
MA Cross is one of the popular strategies in financial markets. It is based on buying and selling at points where two moving averages cross each other. In this strategy, you need two moving averages; one with a window size of 10 and another with a window size of 20. The first one is called fast, and the second is called slow. The buying signal of this strategy is the fast moving average crosses the slow one and gets above it. The selling signal is fast moving average crossing the slow one and getting under it. The key point of deploying this strategy is finding crossing points. To find crosses, we use Cross function the way shown in the figure below:

