is possible to insert alert on Alerts tab list from code?

 

Hi Support

There is a function to insert directly from code an Alert, just like the image here in the bottom?

Thanks for reply

 
It's not possible for now.
 

This way 5 years ago.

Is this possible to do now from a code?

If not, is there any workaround? I can pay for solution. Please give me some info

 
Igor Grgic:

This way 5 years ago.

Is this possible to do now from a code?

If not, is there any workaround? I can pay for solution. Please give me some info

If you have codes running, why not let the code do the alerting directly? Is there some special reasons I don't know of? (just curious... LOL)

 

Hi Seng,

well I don't know, I have a working EA that is opening market orders and it sets TP and SL for each order. Now I need to automatically create Alerts in "Alerts tab" for each new opened position - one alert to notify me via Email(+ run .bat file) when the TP price is reached, and the other alert when SL is reached.


See images:

1


Note that I need actual price values in alerts below, based on TP and SL prices above

2

 
Igor Grgic:

well I don't know, I have a working EA that is opening market orders and it sets TP and SL for each order. Now I need to automatically create Alerts in "Alerts tab" for each new opened position - one alert to notify me via Email(+ run .bat file) when the TP price is reached, and the other alert when SL is reached.

Note that I need actual price values in alerts below, based on TP and SL prices above

Right... I believe emails/batch files can all be triggered via code, directly, without going through the alert tab.

But let's see what the experts say about this :).

 
Igor Grgic:

Hi Seng,

well I don't know, I have a working EA that is opening market orders and it sets TP and SL for each order. Now I need to automatically create Alerts in "Alerts tab" for each new opened position - one alert to notify me via Email(+ run .bat file) when the TP price is reached, and the other alert when SL is reached.

If you have source code of EA you can modify it to add alerts and call external programs. If you don't have the source you can write simple indicator that will do this job. In either case integration with alerts tab in MT4 is not required. 

 
Marcin, yes I have. But I don't know how to code. Do you code? I can pay.
 
eugenio:

Hi Support

There is a function to insert directly from code an Alert, just like the image here in the bottom?

Thanks for reply

https://www.mql5.com/en/forum/308961

send CellPhone for SMS

//+------------------------------------------------------------------+
//|                                    HaskayafxDayiSMSKontrolEA.mq4 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
bool start = true;
int ToplamOrder=0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   ToplamOrder=OrdersTotal();
  //OnSMSKontrol();
  // OnSMSGonder("MT4 MESAJ");
//--- create timer
 //  EventSetTimer(60);
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   //EventKillTimer();
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  string Mesaj="";
   if(ToplamOrder!=OrdersTotal())
   {
    Mesaj="Old Order Count:"+ToplamOrder+" New Order Total:"+OrdersTotal(); 
    ToplamOrder=OrdersTotal();
    OnSMSGonder(" Total Orders Changed!."+Mesaj);
   
    }
 
  }
                                                   
//+------------------------------------------------------------------+
void OnTimer()
  {
//---

  // Print("sds");
  }
//+------------------------------------------------------------------+
void OnSMSGonder(string GlnMesaj)
  {
   string cookie=NULL,headers;
   char post[],result[];
   int res;
 // Please Change Your SMS company. this example Turkish SMS companty vatanss.com
string google_url="http://panel.vatansms.com/panel/smsgonder1N.php?kno=XXXXXX&kul_ad=0xxxxxxxx&sifre=xxxxxxxx&gonderen=abcbadba&mesaj="+GlnMesaj+"&numaralar=444444444&tur=Normal";
 
   ResetLastError();

   int timeout=5000; 
   res=WebRequest("GET",google_url,cookie,NULL,timeout,post,0,result,headers);
//--- Checking errors
   if(res==-1)
     {
      Print("Error in WebRequest. Error code  =",GetLastError());
      //--- Perhaps the URL is not listed, display a message about the necessity to add the address
      MessageBox("Add the address '"+google_url+"' in the list of allowed URLs on tab 'Expert Advisors'","Error",MB_ICONINFORMATION);
     }
   
  }
  
Receive by SMS the trading signals of my subscription to an MT4 trader ?
Receive by SMS the trading signals of my subscription to an MT4 trader ?
  • 2019.03.30
  • www.mql5.com
I am following a trader on MT4. Is it possible to receive an SMS as soon as a position is open related to the trader to which I am subscribed...
 
Igor Grgic:
Marcin, yes I have. But I don't know how to code. Do you code? I can pay.

Using WebRequest 

 
  1. Igor Grgic I can pay.
    Top of every page is the link Freelance.

  2. int OnInit(){
       ToplamOrder=OrdersTotal();
    Don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:
    1. Terminal starts.
    2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
    3. OnInit is called.
    4. For indicators OnCalculate is called with any existing history.
    5. Human may have to enter password, connection to server begins.
    6. New history is received, OnCalculate called again.
    7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.