I use filters and if they pass, the strategy buys the coin, but I want to sell the position as soon as the filters stop passing my conditions again, how do I implement this?

: Strategy settings

To solve your problem, use the SellByFilters parameter in the strategy settings, in which you can specify the time in seconds after the coin purchase, after which you can sell the position if the filters no longer meet the specified conditions. If you write zero in the parameter, this parameter will not be used in the strategy.