From what I have discovered you cannot create another Event - So how do I tell the indicator to look in the Sounds folder for the wav ?how do I create a new event in the Events folder
From what I have discovered you cannot create another Event - So how do I tell the indicator to look in the Sounds folder for the wav ?how do I create a new event in the Events folder
//-----Are you suggesting I replace ALL instances of 0 in the code with 0.0
//-----Any suggestions about pointing the indicator in the direction of my wav files (in Sounds)
What's that NewBar() function?
I would like to suggest adding the input for call or put somehow. Not sure how that could be done but it'd be nice if the alert could say: AUDUSD Put etc.hi Enivid
i've found one (futurespec) from forexfactory.com and he changed something in the code... so now the lines can be moved and the alert comes at the new price!
coool
here is the new indi!
regards raffi
//-----5 available
//+------------------------------------------------------------------+ //| PriceAudioAlert.mq4 | //| Copyright © 2009-2011, www.earnforex.com | //| Issues sound alerts when price reaches certain levels. | //| Modded by Mn | //| Extra levels added by Maverick 02.03.2017 | //+------------------------------------------------------------------+ #property copyright "EarnForex.com" #property link "http://www.earnforex.com" #property indicator_chart_window extern double PriceAbove_3 = 0; extern double PriceAbove_2 = 0; extern double PriceAbove_1 = 0; extern double PriceExact_0 = 0; extern double PriceBelow_1 = 0; extern double PriceBelow_2 = 0; extern double PriceBelow_3 = 0; extern bool SendEmail = false; //If true e-mail is sent to the e-mail address set in your MT4. E-mail SMTP Server settings should also be configured in your MT4 //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { if (PriceAbove_3 > 0) { ObjectCreate("PriceAbove_3", OBJ_HLINE, 0, Time[0], PriceAbove_3); ObjectSet("PriceAbove_3", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_3", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_3", OBJPROP_WIDTH, 1); } if (PriceAbove_2 > 0) { ObjectCreate("PriceAbove_2", OBJ_HLINE, 0, Time[0], PriceAbove_2); ObjectSet("PriceAbove_2", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_2", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_2", OBJPROP_WIDTH, 1); } if (PriceAbove_1 > 0) { ObjectCreate("PriceAbove_1", OBJ_HLINE, 0, Time[0], PriceAbove_1); ObjectSet("PriceAbove_1", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_1", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_1", OBJPROP_WIDTH, 1); } if (PriceExact_0 > 0) { ObjectCreate("PriceExact_0", OBJ_HLINE, 0, Time[0], PriceExact_0); ObjectSet("PriceExact_0", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceExact_0", OBJPROP_COLOR, Aqua); ObjectSet("PriceExact_0", OBJPROP_WIDTH, 1); } if (PriceBelow_1 > 0) { ObjectCreate("PriceBelow_1 ", OBJ_HLINE, 0, Time[0], PriceBelow_1); ObjectSet("PriceBelow_1 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_1 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_1 ", OBJPROP_WIDTH, 1); } if (PriceBelow_2 > 0) { ObjectCreate("PriceBelow_2 ", OBJ_HLINE, 0, Time[0], PriceBelow_2); ObjectSet("PriceBelow_2 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_2 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_2 ", OBJPROP_WIDTH, 1); } if (PriceBelow_3 > 0) { ObjectCreate("PriceBelow_3 ", OBJ_HLINE, 0, Time[0], PriceBelow_3); ObjectSet("PriceBelow_3 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_3 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_3 ", OBJPROP_WIDTH, 1); } return(0); //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() ObjectDelete("PriceAbove_3"); ObjectDelete("PriceAbove_2"); ObjectDelete("PriceAbove_1"); { ObjectDelete("PriceExact_0"); ObjectDelete("PriceBelow_1"); ObjectDelete("PriceBelow_2"); ObjectDelete("PriceBelow_3"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { // added by Mn ----------------------------------------------------------- if (ObjectGet("PriceAbove_3", 1) != PriceAbove_3) PriceAbove_3= ObjectGet("PriceAbove_3", 1); if (ObjectGet("PriceAbove_2", 1) != PriceAbove_2) PriceAbove_2= ObjectGet("PriceAbove_2", 1); if (ObjectGet("PriceAbove_1", 1) != PriceAbove_1) PriceAbove_1= ObjectGet("PriceAbove_1", 1); if (ObjectGet("PriceExact_0", 1) != PriceExact_0) PriceExact_0 = ObjectGet("PriceExact_0", 1); if (ObjectGet("PriceBelow_1", 1) != PriceBelow_1) PriceBelow_1 = ObjectGet("PriceBelow_1", 1); if (ObjectGet("PriceBelow_2", 1) != PriceBelow_2) PriceBelow_2 = ObjectGet("PriceBelow_2", 1); if (ObjectGet("PriceBelow_3", 1) != PriceBelow_3) PriceBelow_3 = ObjectGet("PriceBelow_3", 1); // added by Mn ----------------------------------------------------------- if ((Ask > PriceAbove_3) && (PriceAbove_3 > 0)) { Alert("Price above the alert level 3."); PlaySound("ring-ring-ring.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_3); ObjectDelete("PriceAbove_3"); PriceAbove_3 = 0 if ((Ask > PriceAbove_2) && (PriceAbove_2 > 0)) { Alert("Price above the alert level 2."); PlaySound("ring-ring.wav"); SendMail("Price for " + Symbol() + " above the alert level 2 " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of " + PriceAbove_2); ObjectDelete("PriceAbove_2"); PriceAbove_2 = 0 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 if ((Bid == PriceExact_0) || (Ask == PriceExact_0)) { Alert("Price is exactly at the alert level."); PlaySound("glass-ping.wav"); SendMail("Price for " + Symbol() + " exactly at the alert level " + Ask, "Price for " + Symbol() + " reached " + Ask + "/" + Bid + " level, which is exactly your alert level of " + PriceExact_0); ObjectDelete("PriceExact_0"); PriceExact_0 = 0; if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_1"); PlaySound("phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_1); ObjectDelete("PriceBelow_1"); PriceBelow_1 = 0; if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_2"); PlaySound("phone-phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_1); ObjectDelete("PriceBelow_2"); PriceBelow_2 = 0; if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_3"); PlaySound("phone-phone-phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_3); ObjectDelete("PriceBelow_3"); PriceBelow_3 = 0; } } return(0); } //+------------------------------------------------------------------+
//----However, I have a couple of errors in the code which I can't seen to figure out
//+------------------------------------------------------------------+ //| PriceAudioAlert.mq4 | //| Copyright © 2009-2011, www.earnforex.com | //| Issues sound alerts when price reaches certain levels. | //| Modded by Mn | //| Extra levels added by Maverick 02.03.2017 | //+------------------------------------------------------------------+ #property copyright "EarnForex.com" #property link "http://www.earnforex.com" #property indicator_chart_window extern double PriceAbove_3 = 0; extern double PriceAbove_2 = 0; extern double PriceAbove_1 = 0; extern double PriceExact_0 = 0; extern double PriceBelow_1 = 0; extern double PriceBelow_2 = 0; extern double PriceBelow_3 = 0; extern int linewidth = 1; extern bool SendEmail = false; //If true e-mail is sent to the e-mail address set in your MT4. E-mail SMTP Server settings should also be configured in your MT4 //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { if (PriceAbove_3 > 0) { ObjectCreate("PriceAbove_3", OBJ_HLINE, 0, Time[0], PriceAbove_3); ObjectSet("PriceAbove_3", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_3", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_3", OBJPROP_WIDTH, linewidth); } if (PriceAbove_2 > 0) { ObjectCreate("PriceAbove_2", OBJ_HLINE, 0, Time[0], PriceAbove_2); ObjectSet("PriceAbove_2", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_2", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_2", OBJPROP_WIDTH, linewidth); } if (PriceAbove_1 > 0) { ObjectCreate("PriceAbove_1", OBJ_HLINE, 0, Time[0], PriceAbove_1); ObjectSet("PriceAbove_1", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceAbove_1", OBJPROP_COLOR, Green); ObjectSet("PriceAbove_1", OBJPROP_WIDTH, linewidth); } if (PriceExact_0 > 0) { ObjectCreate("PriceExact_0", OBJ_HLINE, 0, Time[0], PriceExact_0); ObjectSet("PriceExact_0", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceExact_0", OBJPROP_COLOR, Aqua); ObjectSet("PriceExact_0", OBJPROP_WIDTH, linewidth); } if (PriceBelow_1 > 0) { ObjectCreate("PriceBelow_1 ", OBJ_HLINE, 0, Time[0], PriceBelow_1); ObjectSet("PriceBelow_1 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_1 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_1 ", OBJPROP_WIDTH, linewidth); } if (PriceBelow_2 > 0) { ObjectCreate("PriceBelow_2 ", OBJ_HLINE, 0, Time[0], PriceBelow_2); ObjectSet("PriceBelow_2 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_2 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_2 ", OBJPROP_WIDTH, linewidth); } if (PriceBelow_3 > 0) { ObjectCreate("PriceBelow_3 ", OBJ_HLINE, 0, Time[0], PriceBelow_3); ObjectSet("PriceBelow_3 ", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("PriceBelow_3 ", OBJPROP_COLOR, Red); ObjectSet("PriceBelow_3 ", OBJPROP_WIDTH, linewidth); } return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("PriceAbove_3"); ObjectDelete("PriceAbove_2"); ObjectDelete("PriceAbove_1"); ObjectDelete("PriceExact_0"); ObjectDelete("PriceBelow_1"); ObjectDelete("PriceBelow_2"); ObjectDelete("PriceBelow_3"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { // added by Mn ----------------------------------------------------------- if (ObjectGet("PriceAbove_3", 1) != PriceAbove_3) PriceAbove_3= ObjectGet("PriceAbove_3", 1); if (ObjectGet("PriceAbove_2", 1) != PriceAbove_2) PriceAbove_2= ObjectGet("PriceAbove_2", 1); if (ObjectGet("PriceAbove_1", 1) != PriceAbove_1) PriceAbove_1= ObjectGet("PriceAbove_1", 1); if (ObjectGet("PriceExact_0", 1) != PriceExact_0) PriceExact_0 = ObjectGet("PriceExact_0", 1); if (ObjectGet("PriceBelow_1", 1) != PriceBelow_1) PriceBelow_1 = ObjectGet("PriceBelow_1", 1); if (ObjectGet("PriceBelow_2", 1) != PriceBelow_2) PriceBelow_2 = ObjectGet("PriceBelow_2", 1); if (ObjectGet("PriceBelow_3", 1) != PriceBelow_3) PriceBelow_3 = ObjectGet("PriceBelow_3", 1); // added by Mn ----------------------------------------------------------- if ((Ask > PriceAbove_3) && (PriceAbove_3 > 0)) { Alert("Price above the alert level 3."); PlaySound("ring-ring-ring.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_3); ObjectDelete("PriceAbove_3"); PriceAbove_3 = 0; } //---- if ((Ask > PriceAbove_2) && (PriceAbove_2 > 0)) { Alert("Price above the alert level 2."); PlaySound("ring-ring.wav"); SendMail("Price for " + Symbol() + " above the alert level 2 " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of " + PriceAbove_2); ObjectDelete("PriceAbove_2"); PriceAbove_2 = 0; } //--- 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; } //---- if ((Bid == PriceExact_0) || (Ask == PriceExact_0)) { Alert("Price is exactly at the alert level."); PlaySound("glass-ping.wav"); SendMail("Price for " + Symbol() + " exactly at the alert level " + Ask, "Price for " + Symbol() + " reached " + Ask + "/" + Bid + " level, which is exactly your alert level of " + PriceExact_0); ObjectDelete("PriceExact_0"); PriceExact_0 = 0; } //---- if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_1"); PlaySound("phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_1); ObjectDelete("PriceBelow_1"); PriceBelow_1 = 0; } //---- if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_2"); PlaySound("phone-phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_1); ObjectDelete("PriceBelow_2"); PriceBelow_2 = 0; } //---- if ((Bid < PriceBelow_1) && (PriceBelow_1 > 0)) { Alert("PriceBelow_3"); PlaySound("phone-phone-phone.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + PriceBelow_3); ObjectDelete("PriceBelow_3"); PriceBelow_3 = 0; } //---- return(0); } //+------------------------------------------------------------------+
extern int linestyle = 1;
//-----You never actually indicated where I had gone wrong - for future coding