Kindly create a Tradescript for BUY when MACD crossover happens above zero line and SELL when MACD crossover below zero line, and code for exit BUY and SELL trades

As per the above query 

Buy Script:

SET A = MACDSignal(13, 26, 9, SIMPLE)
SET B = MACD(13, 26, 9, SIMPLE)
CROSSOVER(A, B) >0

Sell Script:

SET A = MACDSignal(13, 26, 9, SIMPLE)
SET B = MACD(13, 26, 9, SIMPLE)
CROSSOVER(B, A) <0
1 Like

This script generating error

Generated error. .pls provide correct algo

have u figured it out?

sir
i want to create scanner

  1. EMA 6 crossover EMA 30 = BUY signal (EMA 6 above EMA 30)
  2. EMA 30 crossover EMA 6 = SELL signal (EMA30 above EMA 6)
    and
  3. macd ( AVG period 6 crossover short period 10 and long period 30) = buy signal
  4. macd ( long period 30 and short period 10 crossover to avg period 6)= sell signal
    [ all avg and short and long period should be in exponential avg]

all above make in one scanner ,means EMA buy and macd buy should be create alert at a time and ema sell and macd sell create alert at a same time ( plz dont make it in 3 or 4 scanner make it all these in only one scanner system)