Please use upper and lower band of Bollinger band as trigger signal. Signal A: if close[1] && close[0] >Upper band -- sell signal Signal B: if close[1] && close[0] < Lower band -- buy signal first loss: if it is sell -- trigger buy if it is buy -- ...