Need afl for first candle which has open and close above 200ema

need afl for first candle which has open and close above 200ema look back for 10 candles.
and 90 day average volume is 30000
buy=open and close is above 200 ema (the first candle in last 10 previous candle)
sell=open and close is below 200 ema (the first candle in last 10 previous candle)