thanks. I use a cost averaging effect in the current version to achieve similar result. The advantage is that it is nearly stateless and like your bot after the price retraces, it will be in profit. The reason is that if its theoretical price is above the current market, the buy side fills immediately and the sell side sits on the books at the theoretical value. Similarly, if the theoretical price is below the current market, the sell side fills immediate and the buy side sits on the books at the theoretical value.
So when the price reaches the theoretical value, the difference is locked in. Since it is maket making in a derivative market I dont think it matters so much even if the current price is the alltime high (I highly doubt that!) as the premiums fluctuation to positive and negative against the theoretical values.
Granted this might be a special situation, but I like to keep things as simple as possible that gets the job done