Hi, I'm seeking help here. While I'm understanding Kalman Filter and trying to apply this algorithm in real trades, there are something I don't quite understand.

In the sample algorithm, the kalman filter takes one price for each symbol, and get hedge ratio, mean, standard deviation etc. So that it further decides if we can enter long/short at a moment. However, in real trades, for every tick/bar, there are bid price and short price for every symbol, so they are two values of each symbol, four values for pair trading. Then how should we use the four values to calculate trading signal?

Actually this question is not only about Kalman Filter, but general to any backtest program. Back test data has only one value for each time (which might be OPEN or CLOSE), but in real trades, there are lowest ask, highest bid and other order prices. Which values should we use to decide trading signal?

Appreciate any help!