Menu
Brokers
MT4 Forex Brokers
MT5 Forex brokers
PayPal Brokers
Skrill Brokers
Oil Trading Brokers
Gold Trading Brokers
Web Browser Platform
Brokers with CFD Trading
ECN Brokers
Bitcoin FX Brokers
PAMM Forex Brokers
With Cent Accounts
With High Leverage
Cryptocurrency Brokers
Forums
All threads
New threads
New posts
Trending
Search forums
What's new
New threads
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Forums
Trading Platforms
MetaTrader Indicators
Price Alert
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
[QUOTE="hayseed, post: 122886, member: 5898"] //---- hey maverick..... yes there were a few..... added linewidth to the inputs so you can see what i meant about unlimited sizes..... now sky's the limit......h //------ [code=mql4] //+------------------------------------------------------------------+ //| 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); } //+------------------------------------------------------------------+ [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…