Hi
I am beginner with metatrader 4 and my english is not so good.
test mail work ..
But I must embed the code I do not know
im
subject | - | Subject text. |
some_text | - | Mail body. |
Sample:
double lastclose=Close[0]; if(lastclose<my_signal) SendMail("from your expert", "Price dropped down to "+DoubleToStr(lastclose,Digits));
show your code & we will try to help you
code :D
i have not code.. im testing bat i have not idee ;)
im found dis .. (PriceAlert.mq4)
//+------------------------------------------------------------------+ //| PriceAlert.mq4 | //| Copyright © 2009-2011, www.earnforex.com | //| Issues sound alerts when price reaches certain levels. | //| modded by Mn ------------------------ | //+------------------------------------------------------------------+ #property copyright "EarnForex.com" #property link "http://www.earnforex.com" #property indicator_chart_window extern double SoundWhenPriceGoesAbove = 0; extern double SoundWhenPriceGoesBelow = 0; extern double SoundWhenPriceIsExactly = 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 (SoundWhenPriceIsExactly > 0) { ObjectCreate("SoundWhenPriceIsExactly", OBJ_HLINE, 0, Time[0], SoundWhenPriceIsExactly); ObjectSet("SoundWhenPriceIsExactly", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("SoundWhenPriceIsExactly", OBJPROP_COLOR, Yellow); ObjectSet("SoundWhenPriceIsExactly", OBJPROP_WIDTH, 1); } if (SoundWhenPriceGoesAbove > 0) { ObjectCreate("SoundWhenPriceGoesAbove", OBJ_HLINE, 0, Time[0], SoundWhenPriceGoesAbove); ObjectSet("SoundWhenPriceGoesAbove", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("SoundWhenPriceGoesAbove", OBJPROP_COLOR, Green); ObjectSet("SoundWhenPriceGoesAbove", OBJPROP_WIDTH, 1); } if (SoundWhenPriceGoesBelow > 0) { ObjectCreate("SoundWhenPriceGoesBelow", OBJ_HLINE, 0, Time[0], SoundWhenPriceGoesBelow); ObjectSet("SoundWhenPriceGoesBelow", OBJPROP_STYLE, STYLE_SOLID); ObjectSet("SoundWhenPriceGoesBelow", OBJPROP_COLOR, Red); ObjectSet("SoundWhenPriceGoesBelow", OBJPROP_WIDTH, 1); } return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("SoundWhenPriceIsExactly"); ObjectDelete("SoundWhenPriceGoesAbove"); ObjectDelete("SoundWhenPriceGoesBelow"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { // added by Mn ----------------------------------------------------------- if (ObjectGet("SoundWhenPriceGoesAbove", 1) != SoundWhenPriceGoesAbove) SoundWhenPriceGoesAbove = ObjectGet("SoundWhenPriceGoesAbove", 1); if (ObjectGet("SoundWhenPriceGoesBelow", 1) != SoundWhenPriceGoesBelow) SoundWhenPriceGoesBelow = ObjectGet("SoundWhenPriceGoesBelow", 1); if (ObjectGet("SoundWhenPriceIsExactly", 1) != SoundWhenPriceIsExactly) SoundWhenPriceIsExactly = ObjectGet("SoundWhenPriceIsExactly", 1); // added by Mn ----------------------------------------------------------- if ((Ask > SoundWhenPriceGoesAbove) && (SoundWhenPriceGoesAbove > 0)) { Alert("Price above the alert level."); PlaySound("alert.wav"); SendMail("Price for " + Symbol() + " above the alert level " + Ask, "Price for " + Symbol() + " reached " + Ask + " level, which is above your alert level of " + SoundWhenPriceGoesAbove); ObjectDelete("SoundWhenPriceGoesAbove"); SoundWhenPriceGoesAbove = 0; } if ((Bid < SoundWhenPriceGoesBelow) && (SoundWhenPriceGoesBelow > 0)) { Alert("Price below the alert level."); PlaySound("alert.wav"); SendMail("Price for " + Symbol() + " below the alert level " + Bid, "Price for " + Symbol() + " reached " + Bid + " level, which is below your alert level of " + SoundWhenPriceGoesBelow); ObjectDelete("SoundWhenPriceGoesBelow"); SoundWhenPriceGoesBelow = 0; } if ((Bid == SoundWhenPriceIsExactly) || (Ask == SoundWhenPriceIsExactly)) { Alert("Price is exactly at the alert level."); PlaySound("alert.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 " + SoundWhenPriceIsExactly); ObjectDelete("SoundWhenPriceIsExactly"); SoundWhenPriceIsExactly = 0; } } //+------------------------------------------------------------------+
im need sound and mail alert by -50 .. parheps you can help :D
job ? hmm dis not help me
im testing and im play and mony have im not :(
parheps is dis script better..
if you can put one here if .. -50 when calling the script to send mail or something else :)
if(Equity[i] > 0) eq = "+" + eq; eq = "€" + eq; ObjectSetText(name, eq, 60, "Tahoma", _Data); ObjectSet(name, OBJPROP_CORNER, Corner);
script one 1
//+------------------------------------------------------------------+ //| i-Breakeven.mq4 | //| Copyright © 2007, RickD | //| www.fxstrategy.ca | //+------------------------------------------------------------------+ #property copyright "© 2007 RickD" #property link "www.fxstrategy.ca" //---- #define major 1 #define minor 0 //---- #property indicator_chart_window #property indicator_buffers 0 //---- extern int Corner = 0; extern int dy = 20; extern color _Header = OrangeRed; extern color _Text = RoyalBlue; extern color _Data = CadetBlue; extern color _Separator = MediumPurple; //---- string prefix = "capital_"; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void init() { Comment(""); clear(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void deinit() { Comment(""); clear(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void clear() { string name; int obj_total = ObjectsTotal(); //---- for(int i = obj_total - 1; i >= 0; i--) { name = ObjectName(i); if(StringFind(name, prefix) == 0) ObjectDelete(name); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void start() { clear(); string Sym[]; double Equity[]; double Lots[]; ArrayResize(Sym, 0); ArrayResize(Equity, 0); ArrayResize(Lots, 0); int cnt = OrdersTotal(); //---- for(int i = 0; i < cnt; i++) { //---- if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue; int type = OrderType(); //---- if(type != OP_BUY && type != OP_SELL) continue; bool found = false; int size = ArraySize(Sym); //---- for(int k = 0; k < size; k++) { //---- if(Sym[k] == OrderSymbol()) { Equity[k] += OrderProfit() + OrderCommission() + OrderSwap(); //---- if(type == OP_BUY) Lots[k] += OrderLots(); //---- if(type == OP_SELL) Lots[k] -= OrderLots(); found = true; break; } } //---- if(found) continue; int ind = ArraySize(Sym); ArrayResize(Sym, ind + 1); Sym[ind] = OrderSymbol(); ArrayResize(Equity, ind + 1); Equity[ind] = OrderProfit() + OrderCommission() + OrderSwap(); ArrayResize(Lots, ind + 1); //---- if(type == OP_BUY) Lots[k] = OrderLots(); //---- if(type == OP_SELL) Lots[k] = -OrderLots(); } string name = prefix + "symbols"; //---- if(ObjectFind(name) == -1) { ObjectCreate(name, OBJ_LABEL, 0, 0, 0); } ObjectSet(name, OBJPROP_XDISTANCE, 30); ObjectSet(name, OBJPROP_YDISTANCE, 35); ObjectSetText(name, "Symbol", 10, "Tahoma", _Header); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "equity"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 130); ObjectSet(name, OBJPROP_YDISTANCE, 35); ObjectSetText(name, "Equity", 10, "Tahoma", _Header); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "breakeven"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 220); ObjectSet(name, OBJPROP_YDISTANCE, 35); ObjectSetText(name, "Breakeven", 10, "Tahoma", _Header); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "tmp1"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 20); ObjectSet(name, OBJPROP_YDISTANCE, 35+dy); ObjectSetText(name, "-----------------------------------------------------", 10, "Tahoma", _Separator); ObjectSet(name, OBJPROP_CORNER, Corner); double sum = 0; string level0 = ""; size = ArraySize(Sym); //---- for(i = 0; i < size; i++) { //---- if(Lots[i] == 0) { level0 = "Lock"; } else { int dig = MarketInfo(Sym[i], MODE_DIGITS); double point = MarketInfo(Sym[i], MODE_POINT); double COP = Lots[i]*MarketInfo(Sym[i], MODE_TICKVALUE); double val = MarketInfo(Sym[i], MODE_BID) - point*Equity[i] / COP; level0 = DoubleToStr(val, dig); } name = prefix + "symbol"+i; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 30); ObjectSet(name, OBJPROP_YDISTANCE, 35 + dy*(i + 2)); ObjectSetText(name, Sym[i], 10, "Tahoma", _Text); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "equity" + i; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 120); ObjectSet(name, OBJPROP_YDISTANCE, 35 + dy*(i + 2)); string eq = DoubleToStr(Equity[i], 2); //---- if(Equity[i] > 0) eq = "+" + eq; eq = "€" + eq; ObjectSetText(name, eq, 20, "Tahoma", _Data); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "breakeven"+i; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 230); ObjectSet(name, OBJPROP_YDISTANCE, 35 + dy*(i + 2)); ObjectSetText(name, level0, 10, "Tahoma", _Data); ObjectSet(name, OBJPROP_CORNER, Corner); sum += Equity[i]; } name = prefix + "tmp2"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 20); ObjectSet(name, OBJPROP_YDISTANCE, 35 + dy*(i + 2)); ObjectSetText(name, "-----------------------------------------------------", 10, "Tahoma", _Separator); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "total"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 380); ObjectSet(name, OBJPROP_YDISTANCE, 1+dy*(i+3)); ObjectSetText(name, "Total", 10, "Tahoma", _Text); ObjectSet(name, OBJPROP_CORNER, Corner); name = prefix + "equity_total"; //---- if(ObjectFind(name) == -1) ObjectCreate(name, OBJ_LABEL, 0, 0, 0); ObjectSet(name, OBJPROP_XDISTANCE, 390); ObjectSet(name, OBJPROP_YDISTANCE, 1+dy*(i+3)); eq = DoubleToStr(sum, 2); //---- if(Equity[i] > 0) eq = "+" + eq; eq = "€" + eq; ObjectSetText(name, eq, 60, "Tahoma", _Data); ObjectSet(name, OBJPROP_CORNER, Corner); } //+------------------------------------------------------------------+
wolfoo:
better start learning to code then . . . Start Here
job ? hmm dis not help me
im testing and im play and mony have im not :(
wow... why you spik ? wenn you not help me ?
;) giv me dis tutorial in german or polish ;) my english ist not good for dis
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
HI
HI
how do you do when it comes to certain profit to get a mail or sms?
I've tried it but I do I come on.
http://www.xpworx.com/download-free/mt4-tools/xpmail-metatrader-send-mail.php
Thanks