Cleaned up code. The chart shows the Signal in the pane below the chart, with only the entry signals being transmitted by the signal plot (see this indicator's Inputs).
The signal is also connected to the Backtesting-Trading Engine appearing on the chart. The Engine has been configured so that:
1. The entry strat is set to "External indicator", and
2. This indicator's Signal plot has been selected in the Engine's "Connect your indicator here" field at the very bottom of the Engine's Inputs.
Since only the entries are sent to the Engine through the signal in this particular instance, the trades are exited using the Engine's active stop and exit strats.