I suppose somewhere the code needs to know what #'s 0 - 1 - 2 - 3 - 4 refer to in linestyle ... H'mmm
you were missing ; and } in about a dozen places...... errors we all make......h
Looks like it'sI suppose somewhere the code needs to know what #'s 0 - 1 - 2 - 3 - 4 refer to in linestyle
//-----
missing ; and } in about a dozen places
//----Errors only came up with 2 - 1 at the top somewhere and 1 at the bottom ... should have copied them for reference
if ((Ask > PriceAbove_1) && (PriceAbove_1 > 0)) { Alert("Price above the alert level 1."); PlaySound("ring.wav"); SendMail("Price for " + Symbol() + " above the alert level 1 " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of 1 " + PriceAbove_1); ObjectDelete("PriceAbove_1"); PriceAbove_1= 0 [COLOR=#ff4d4d]//---- missing ; //---- missing }[/COLOR]
if ((Ask > PriceAbove_1) && (PriceAbove_1 > 0))
{
Alert("Price above the alert level 1.");
PlaySound("ring.wav");
SendMail("Price for " + Symbol() + " above the alert level 1 " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of 1 " + PriceAbove_1);
ObjectDelete("PriceAbove_1");
PriceAbove_1= 0
extern SoundList Above_5 = s11; enum SoundList { s11=11, //Above_5.wav s10=10, //Above_4.wav s9=9, //Above_3.wav etc etc };
PlaySound("ring.wav");
How do i tie it all together
extern double above1 = 0.0; extern string above1wav = "email.wav"; // keep sounds less than 2 seconds long extern double below1 = 0.0; extern string below1wav = "timeout.wav"; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //--- indicator buffers mapping //--- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { if((Ask > above1) && (above1 > 0.0)) {PlaySound(above1wav);} // keep your sounds short if((Ask < below1) && (below1 > 0.0)) {PlaySound(below1wav);} //----------- expand to as many lines as needed //----------- be sure to limit the number of times the PlaySound() works otherwise they never stop till untrue return(0); } //------
anything longer than 1 second is too long
//---- if ((Ask > PriceAbove_5) && (PriceAbove_5 > 0)) { Alert("Price above the alert level 5."); PlaySound("alert.wav"); SendMail("Price for " + Symbol() + " above the alert level 3 " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of " + PriceAbove_5); ObjectDelete("PriceAbove_5"); PriceAbove_5 = 0; } //----
PlaySound("alert.wav");
if((Ask > above1) && (above1 > 0.0)) {[URL='https://docs.mql4.com/common/PlaySound']PlaySound[/URL](above1wav);}
H'mmm
Where has that URL come from in my quote
H'mmm
So I need to watch out for it and delete BEFORE posting - never seen it before thoughIt came from the automatic code highlighting engine, which also adds URLs to the relevant function description pages.
So what you are saying is to leave well aloneNo, you just need to be careful when editing formatted code quotes and when editing your own code posts. When you insert new code snippets, it should not appear in such a broken manner.
and not to start removing bits in [brackets]if((Ask > above1) && (above1 > 0.0)) {[URL='https://docs.mql4.com/common/PlaySound']PlaySound[/URL](above1wav);}