Trailing Moving Average

To maximize profit I would like to shift my strike once certain profit reached (50% of the option value reached), but new strike should be below SMA. How to choose this in select strike price. I have tried my maximum but could not find out a way



Use find strike with number as the criteria