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
AudioPriceAlert
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: 124117, member: 5898"] //----- hey maverick...... there could be several reasons why the lines disappeared..... remember, spreads are fictitiously wide on weekends so put the ask line on the chart to assure your lines are outside it....... to test your wav file and lines while the market is closed, apply your indicator to a chart making sure the lines are outside the spread..... then drag one line past the point where it should alarm...... then click [I][B]ctrl[/B][/I] and[I][B] i[/B][/I] at the same time..... this brings up the indicators on that chart.... just x out of that..... the line should vanish and playsound should sound off the correct wav file....... below is partial but working code..... expand as needed..... but don't forget, a couple traffic lights are ok..... a hundred is a traffic jam......h //----- [code=mql4]#property version "1.00" #property strict #property indicator_chart_window //-------- enum wavs { a=0, // alert.wav b=1, // alert2.wav c=2, // connect.wav d=3, // disconect.wav e=4, // ok.wav f=5, // stops.wav g=6, // news.wav }; //--- input parameters input wavs PriceAbove_3_wav = c; extern double PriceAbove_3 = 0.0; extern int PriceAbove_3size = 5; extern color PriceAbove_3clr = Blue; input wavs PriceAbove_2_wav = b; extern double PriceAbove_2 = 0.0; extern int PriceAbove_2size = 2; extern color PriceAbove_2clr = Lime; input wavs PriceAbove_1_wav = a; extern double PriceAbove_1 = 0.0; extern int PriceAbove_1size = 3; extern color PriceAbove_1clr = Red; 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 string wavarray[7] = {"alert.wav","alert2.wav","connect.wav","disconnect.wav" }; // list your wav choices in an array like this int init() { //---- if (PriceAbove_3 > 0) { ObjectCreate("PriceAbove_3", OBJ_HLINE, 0, Time[0], PriceAbove_3); ObjectSet("PriceAbove_3", OBJPROP_STYLE, STYLE_DOT); ObjectSet("PriceAbove_3", OBJPROP_COLOR, PriceAbove_3clr); ObjectSet("PriceAbove_3", OBJPROP_WIDTH, PriceAbove_3size); } //---- //---- if (PriceAbove_2 > 0) { ObjectCreate("PriceAbove_2", OBJ_HLINE, 0, Time[0], PriceAbove_2); ObjectSet("PriceAbove_2", OBJPROP_STYLE, STYLE_DOT); ObjectSet("PriceAbove_2", OBJPROP_COLOR, PriceAbove_2clr); ObjectSet("PriceAbove_2", OBJPROP_WIDTH, PriceAbove_2size); } //---- if (PriceAbove_1 > 0) { ObjectCreate("PriceAbove_1", OBJ_HLINE, 0, Time[0], PriceAbove_1); ObjectSet("PriceAbove_1", OBJPROP_STYLE, STYLE_DOT); ObjectSet("PriceAbove_1", OBJPROP_COLOR, PriceAbove_1clr); ObjectSet("PriceAbove_1", OBJPROP_WIDTH, PriceAbove_1size); } //---- return(0); } int deinit() { ObjectDelete("PriceAbove_3"); ObjectDelete("PriceAbove_2"); ObjectDelete("PriceAbove_1"); //----- return(0); } //------ int start() { //--- 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 ((Ask > PriceAbove_3) && (PriceAbove_3 > 0)) { PlaySound(wavarray[PriceAbove_3_wav]); SendMail("Price for " + Symbol() + " above the alert level 3 " + DoubleToStr(Ask,Digits-1), "Price for " + Symbol() + " reached " + DoubleToStr(Ask,Digits-1) + " level, which is above your alert level of " + DoubleToStr(PriceAbove_3,Digits-1)); ObjectDelete("PriceAbove_3"); PriceAbove_3 = 0; } //---- if ((Ask > PriceAbove_2) && (PriceAbove_2 > 0)) { PlaySound(wavarray[PriceAbove_2_wav]); SendMail("Price for " + Symbol() + " above the alert level 2 " + DoubleToStr(Ask,Digits-1), "Price for " + Symbol() + " reached " + DoubleToStr(Ask,Digits-1) + " level, which is above your alert level of " + DoubleToStr(PriceAbove_2,Digits-1)); ObjectDelete("PriceAbove_2"); PriceAbove_2 = 0; } //---- if ((Ask > PriceAbove_1) && (PriceAbove_1 > 0)) { PlaySound(wavarray[PriceAbove_1_wav]); SendMail("Price for " + Symbol() + " above the alert level 1 " + DoubleToStr(Ask,Digits-1), "Price for " + Symbol() + " reached " + DoubleToStr(Ask,Digits-1) + " level, which is above your alert level of 1 " + DoubleToStr(PriceAbove_1,Digits-1)); ObjectDelete("PriceAbove_1"); PriceAbove_1= 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…