This script is necessary for training, but not for trade. It isn't recommended to trade using this strategy.
The line 1 - SMA , 20 periods
If the candle red and low of a candle is higher than the line - to open a long position
If the candle green and high of a candle is lower than the line - to open a short position
The line 1 - SMA , 20 periods
If the candle red and low of a candle is higher than the line - to open a long position
If the candle green and high of a candle is lower than the line - to open a short position