Please code this strategy

Buy :

Heiken Ashi candle colour is green (close is higher than the open), Candle bottom is flat ( Low of the candle is higher than previous candle’s median) and candle closes above 10 SMA.and 10 SMA is above 50 SMA.

Sell :

Heiken Ashi candle colour is red, Candle top is flat ( high of the candle is lower than previous candle’s median) and candle closes below 10 SMA.and 10 SMA is below 50 SMA.

coding the above heikin ashi candles based on tradescript is not possible to code exactly,