Using ATR and open price of new bar to determine exit signal

 
Looking for some assistance implementing an idea via meta editor. I am attempting to generate an exit signal on trades placed that compares the open price of a trade + the ATR value for the time that the trade was initiated with the opening price of a new bar. The idea is that when during a buy trade the open price + ATR is < the open price of a new bar, the trade will close itself. If it is a sell trade, the opposite is true; open price of trade - ATR > open price of new bar, trade closes. I’m not looking for a take profit or stop loss that corresponds to the ATR value; this should only close the trade if a bar opens at a higher or lower value than the open price + ATR value. I have some code written that takes into account the spread costs and other factors. Please PM me and I will share screen shots of the code I currently have to work with. 
Thanks all, happy trading