Get profit percentage of trade during backtest, then adjust sell criteria

Dear Amibroker experts,

I would like to find out the profit percentage of a trade taken during backtest, then adjust the sell criteria accordingly. When profit is below 10%, I have this use function sell_below10(). When profit is >10%, then use function sell_abv10().

How can the profit percentage of a trade be detected during backtest so that I can use the right sell function accordingly?

Thank you.