hi
you would have to use variables to record the matched amount and price and selection index, then use the pw_1_sel_index to see if the selection has won, if so you use the variables that recorded the bet amount and price to calculate the profit.
mcbee