I am developing an ATR trailing stop-loss trading system. The main difficulty is that I have to do calculations successively for each interval between buy signals. When a se