3

I want to draw MACD and EMA in one script . i implement like below :

//@version=3
study("Example of alertcondition")
fast = 12, slow = 26
fastMA = ema(close, fast)
slowMA = ema(close, slow)
macd = fastMA - slowMA
src = input(close)
ma_2 = ema(src, 36)
plot(ma_2, color=red)
plot(macd, color=blue)

But it don't draw anything. If i remove

plot(ma_2, color=red)

so script will draw MACD.if i remove

plot(macd, color=blue)

so script draw EMA. Why can not draw two indicators in this case ?

Can anyone help me .

Thanks

PineCoders-LucF
  • 8,288
  • 2
  • 12
  • 21
ledien
  • 529
  • 2
  • 8
  • 19
  • 3
    Actually, it does draw both, but the scale of the two indicators are way off. You need to normalize them to be able to see them on the same level. – not2qubit Dec 05 '17 at 20:17

1 Answers1

0

Your code is ok.
But your two values can be really different so that you can't see both on screen

G.Lebret
  • 2,826
  • 2
  • 16
  • 27