After running portfolio-level backtest, AmiBroker writes the values of portfolio equity to special symbol “~~~EQUITY”. This allows you to access portfolio-level equity of last backtest inside your formula.
The key words are “after running”. The symbol is available after you run backtest.
@zaxxon You have not given any information or the code you ran your backtest on. You ask what you are doing wrong but without any important information how can anyone help you? You may have done a dozen things “wrong” but we are left to gaze into our crystal ball and find an answer.