How to create new expert adviser in pi with following conditions? Conditions - Buy when XEMA and MACD Histogram is higher than previous candle and vice versa for Sell

How to create new expert adviser in pi with following conditions? Conditions - Buy when XEMA and MACD Histogram is higher than previous candle and vice versa for Sell.

1 Like

As per above MACD and EMA Conditions

Buy Script

 EMA(CLOSE,20) AND MACD(13, 26, 9, SIMPLE) > REF(CLOSE,1)

Sell Script

EMA(CLOSE,20) AND MACD(13, 26, 9, SIMPLE) < REF(CLOSE,1)