Getting volume profile of a previous candle

Hello guys,

I am new to coding and trying to get the volume profile of a prior candle with

map(d,index, history) {
const p = history.prior().profile();

}

but it doesn´t to work. Is this even possible?