the entryprice is the latest buyprice of the raw signal and what I would like is to recall the buyprice of the trade (open position)
Yep, very similar to what I'm trying to do. You'd think they'd have a function built in to Amibroker to do this, as it should be a very common thing that people would want to do in their code. I'm sure there'd be a way to do it, but there doesn't appear to be any easy solution by the sounds of it.