We consider an optimal control problem, where a Brownian motion with drift is sequentially observed, and the sign of the drift coefficient changes at jump times of a symmetric two-state Markov process. The Markov process itself is not observable, and the problem consist in finding a {−1, 1}-valued process that tracks the unobservable process as close as possible. We present an explicit construction of such a process.