This is a profit exit strategy.
It is 2 different types in one strategy.
The first one is based when the price brakes out of the Keltner channel
The second one is based when it breaks out of the x-bars highest high or lowest lows.
Each types has also some other requirements that must be met ( min/max time/profit market order type price/ trigger offset..
Study the attached files in detail to understand the coding requirements.