notification from (mt4 Pc) to (android mt4 ) - page 2

To add comments, please log in or register
Marco vd Heijden
Moderator
12459
Marco vd Heijden  

no not necessary.

you can also put a test message in OnInit()

int OnInit()
  {
//--- test message
  SendNotification("TEST");
   
   return(INIT_SUCCEEDED);
  }
Then it sends a test message when you load the expert/
paradisein
34
paradisein  

thx marco,

it is working fine

very thx,


i tried to repeat the condition to let the expert send alert for another indicator called $uperArrowIndicator


but i got notification 2 times from the first indicator (binaryarrow) only

is it possible to let the expert send notification for both ? and the notification has the name of the indicator ?

Regards

Paradise.

//--- listen for sell arrow
   if(iCustom(Symbol(),PERIOD_CURRENT,"$uperArrowIndicator",1,0)!=EMPTY_VALUE)
     {
      if(arrow!=0)
        {
         SendNotification("SELL SIGNAL!"+Symbol());arrow=0;
        }
     }
Marco vd Heijden
Moderator
12459
Marco vd Heijden  
//+------------------------------------------------------------------+
//|                                             BinaryArrowAlert.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

int arrow=2;
int superarrow=2;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//--- listen for sell arrow
   if(iCustom(Symbol(),PERIOD_CURRENT,"BinaryArrow",1,0)!=EMPTY_VALUE)
     {
      if(arrow!=0)
        {
         SendNotification("BinaryArrow SELL SIGNAL!"+Symbol());arrow=0;
        }
     }
//--- listen for buy arrow   
   if(iCustom(Symbol(),PERIOD_CURRENT,"BinaryArrow",0,0)!=EMPTY_VALUE)
     {
      if(arrow!=1)
        {
         SendNotification("BinaryArrow BUY SIGNAL!"+Symbol());arrow=1;
        }
     }   
//--- listen for sell arrow
   if(iCustom(Symbol(),PERIOD_CURRENT,"$uperArrowIndicator",1,0)!=EMPTY_VALUE)
     {
      if(superarrow!=0)
        {
         SendNotification("$uperArrowIndicator SELL SIGNAL!"+Symbol());superarrow=0;
        }
     }
//--- listen for buy arrow   
   if(iCustom(Symbol(),PERIOD_CURRENT,"$uperArrowIndicator",0,0)!=EMPTY_VALUE)
     {
      if(superarrow!=1)
        {
         SendNotification("$uperArrowIndicator BUY SIGNAL!"+Symbol());superarrow=1;
        }
     }     
  }
//+------------------------------------------------------------------+

Yes but it will only work if the indicator buffers transmit equal values as the arrow indicator.

If the signals are reversed you can swap indicator buffers to switch them around.(the Yellow marked 1 and zero in the code)

I have not seen this $uperarrow indicator so i do not know it's output if it doesn't work please explain what it shows.

12
To add comments, please log in or register