IMACD with playsound alert (programming help)

 

Hi Programmers,

I've attempt to program an indicator that would run in the background on main window that would use the IMACD as the alert signal and playsound as the alert. I need help since I haven't figured it out yet.

Indicator criteria:

IMACD (...) crosses (up) 0.00010 (for example) then playsound.

like wise:

IMACD (...) crosses (down) -0.00010 (for example) then play sound.

Problems:

When I've tried to program this or something similar I get the playsound alert each tick above the level.

I've uses the previous bar (ie. IMACD( , , , , 1) but this just gives me the previous bars MACD and not the tick (i.e. using a 15m chart it just gives me the previous 15m bars macd). I need the signal to refresh each tick but only sound once while the condition is true (i.e. IMACD>0.0001) etc.

Thanks for your help.

 

Please post the IMACD indicator.

 
moldem:
Please post the IMACD indicator.

It is MACD indicator. Standard indicator in MetaTrader. Everybody is having it.