The following is my short straddle setup for my short straddle strategy how do I convert it into code?

If Implied volatility is lower than 50:

SELL 1 share when Nth candle(Close,5min,2) higher than 0.0 at 5min candle interval using candlestick chart. Enter trade between 09:00 to 23:59 and BUY 1 share when Nth candle(Close,5min,72) higher than 0.0 or at stop loss % of 25 or target profit % of 45 at 5min candle interval using candlestick chart.

If Implied volatility is higher than 50:

BUY 1 share when Nth candle(Close,5min,2) higher than 0.0 at 5min candle interval using candlestick chart. Enter trade between 09:00 to 23:59 and SELL 1 share when Nth candle(Close,5min,72) higher than 0.0 or at stop loss % of 25 or target profit % of 45 at 5min candle interval using candlestick chart.

Author