So there are two branches. Exit after bars with loss, Exit after bars with profit. Just add one flag for with loss of profit.
position profit / loss points, Exit after X bars
How to make a custom block for this function, Could you make a sample in codebase or documentation. Sincere thanks.
Exit after X bars if the price is less than entry price 1.5 *ATR when in long, or greater than entry price 1.5*ATR when in short postion.