Require Code for Multiple Moving average crossover

Buy when Simple moving averages 5,8,10 all are above(cross) all the Simple moving averages 15,30,40

As per the above condition

SMA(CLOSE,5)>SMA(CLOSE,15) AND SMA(CLOSE,8)>SMA(CLOSE,30) AND SMA(CLOSE,10)>SMA(CLOSE,40)