How can I coding higher low value of MACD?

Hi expert

When MACD cross the first time I will not buy.

I will buy if MACD cross again and higher low than last time.

Pls help,

Untitled

sig = Signal();
crss = Cross( MACD(), sig);
prev_macd = ValueWhen(crss, MACD(), 2);
Buy = crss AND MACD() > prev_macd;
PlotShapes( Buy * shapeUpArrow, colorGreen, layer = 0, y = sig );

11

4 Likes

Dear fxshrat,

thanks a lot. It work and great with me.