I am not a coder and this is likely completely wrong. I've taken bits and pieces from different things and am trying get it to make an alert. (trying to learn mt coding)
The problem is I have no idea how to do it (play sound and pop alert) only one time for buy and for sell.
Basically when buffer 6 is equal to or greater than 7 (or vice versa) a simple cross or touch of one line over or under another one.
Ignore every trigger after that unless it's a reverse signal.
Can someone take a look at tell me what I did wrong. I deal with code quite a but have limited coding abilities. It seems I need to tell it to look back or hold alert in array so it knows it already gave one but have no idea how to do it.
I was working on the code and pasted my last attempt so it's likely totally mucked up beyond just the alert issue. I just want it to play alert on first occurence of buffer 6 being = or greater 7 or vice versa and ignore any additional triggers forever unless it's an opposite signal at which the process starts again.
If anyone can help me and let me know what I did wrong I would appreciate it.
The problem is I have no idea how to do it (play sound and pop alert) only one time for buy and for sell.
Basically when buffer 6 is equal to or greater than 7 (or vice versa) a simple cross or touch of one line over or under another one.
Ignore every trigger after that unless it's a reverse signal.
Can someone take a look at tell me what I did wrong. I deal with code quite a but have limited coding abilities. It seems I need to tell it to look back or hold alert in array so it knows it already gave one but have no idea how to do it.
Inserted Code
// check for buy or sell signal bool buy = false; bool sell = false; // If Buy Signal if(((ExtMapBuffer6[0]>= ExtMapBuffer7[0]&&ExtMapBuffer6[1]< ExtMapBuffer7[1]))) buy = true; else if(((ExtMapBuffer6[0]>= ExtMapBuffer7[0]&&ExtMapBuffer6[1]< ExtMapBuffer7[1]))) buy = false; // If Sell Signal if(((ExtMapBuffer6[0] <= ExtMapBuffer7[0]))) sell = true; // If We Have A Buy Signal Alert Us if(buy) { // Play a little sound if (SoundON == TRUE) PlaySound(SoundFile_UP); if (AlertON == TRUE) Alert("Long Signal on ", Symbol() + " @ " + DoubleToStr(Bid, Digits)) ; // Indicate the Alert on the charts ObjectCreate("DNA Long Signal"+Time[1],OBJ_ARROW,0,Time[1],Low[1]-2*Point); } // If We Have A Sell Signal Alert Us if(sell) { // Play a little sound if (SoundON == TRUE) PlaySound(SoundFile_DN); if (AlertON == TRUE) Alert("Short Signal on ", Symbol() + " @ " + DoubleToStr(Bid, Digits)) ; // Indicate the Alert on the charts ObjectCreate("DNA Short Signal"+Time[1],OBJ_ARROW,0,Time[1],Low[1]-2*Point); }
I was working on the code and pasted my last attempt so it's likely totally mucked up beyond just the alert issue. I just want it to play alert on first occurence of buffer 6 being = or greater 7 or vice versa and ignore any additional triggers forever unless it's an opposite signal at which the process starts again.
If anyone can help me and let me know what I did wrong I would appreciate it.
The trend always ends.