First it is AFL (AmiBroker Formula Language), not ALF
Second, before making claims that something does not work, you should READ THE FINE MANUAL
https://www.amibroker.com/guide/h_ranking.html
and
https://www.amibroker.com/guide/h_portfolio.html
In short: YOU DID NOT define ranking at all (your code is missing PositionScore variable) and SetSortColumns function is for EXPLORATION, not backtest.
Third thing:
When posting the formula, please make sure that you use Code Tags (using </>
code button) as explained here: How to use this site.
Code tags are required so formulas can be properly displayed and copied without errors.