a. does not open an order when it is overbought, until the falls below a certain threshold, and then open a position
b. There are already many positions. If the is overbought, it will be profitable. When the falls below a certain threshold, open a long position again until the moving average crossover signal turns short.
a. does not open an order when it is oversold, and then opens a position after rises to a certain threshold
b. There are already short positions. If the is oversold, it will be profitable to close the short position. When the rises above a certain threshold, open the short position again until there is a reversal of the moving average crossing signal.