Results 1 to 10 of 10
 6 Attachment(s)    

Thread: Add a pop-up alert to an indicator

  1. #1
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default Add a pop-up alert to an indicator

    Where the signal is supposed to appear, you have simply to add this line code at the next line :

    For buy alert :

    Code:
    Alert ("Name of the indicator: ",Symbol()+" "+Period()+": Buy Alert @ "+DoubleToStr(Ask,Digits));
    For sell alert :

    Code:
    Alert ("Name of the indicator: ",Symbol()+" "+Period()+": Sell Alert @ "+DoubleToStr(Bid,Digits));
    The function ALERT is used to generate a pop up box.

  2. #2

    Default help me

    Hi Mr Funyoo
    I want ask you to add a pup-up alert to TREND_alexcud.mq4 indicator when this indicator gives sell signal and buy signal
    Last edited by mike1982; 12-18-2008 at 05:13.

  3. #3
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by mike1982 View Post
    Hi Mr Funyoo
    I want ask you to add a pup-up alert to TREND_alexcud_v_2MEn.mq4 indicator when this indicator gives sell signal and buy signal like the below picture.
    Hi Mr mike1982,

    Here it is. That should work.
    Attached Files Attached Files

  4. #4
    Junior Member
    Join Date
    Feb 2009
    Posts
    1

    Default

    Hi funyo,

    Could you please add an alert in this indicator.

    Thanks
    Attached Files Attached Files

  5. #5
    Junior Member
    Join Date
    May 2009
    Posts
    3

    Default can you add an alert to this one?

    not one it prints buy or sell.. but when the line is drawn.

    Quote Originally Posted by colton1237 View Post
    I Am Currently Using It To Trade Manually.
    I Have Been Missing The Entry And Exit, And I Think An Alert System Will Greatly Help.
    I Hope To Post The Result Next Week.
    May Be In Furture It Can Be Coded Into An Ea.

    --------------------------------------------------
    Gift Ideas
    Gifts
    Attached Files Attached Files

  6. #6
    Junior Member
    Join Date
    Apr 2011
    Posts
    1

    Cool a little help

    hello, could you please assist me in adding an alert to this indicator, when ever there is a change in color a pop up window alert me saying (blue color)buy, (red color)sell and if it could display which currency pair would be great, thank you in advance.
    regards
    doorgah
    Attached Files Attached Files

  7. #7
    Junior Member
    Join Date
    Dec 2009
    Posts
    1

    Default

    Thank you for the information about how to add an alert. That is very useful to someone who is trying to test ideas and be alerted when the idea comes true. I wonder if you could help me add a external variable to this code that would allow me to position the alerts a little further above and below the price. I tried to modfiy this from another indicator, but I cannot figure out the code to reposition the alerts. I want to move them higher/lower so that the alert wingding does not touvh the price chart.
    Attached Files Attached Files

  8. #8
    Junior Member
    Join Date
    May 2015
    Posts
    5

    Default not work email popup..

    hi
    i need your help.... i have new vierson mt4 950 but it is not work show up email pop up... anyone can update on my file.. i give you my file
    pls re fix it...
    thank
    Attached Files Attached Files

  9. #9
    Junior Member
    Join Date
    May 2015
    Posts
    5

    Exclamation

    anyone i have not hear from all of are no answer my question.. i need your help...

  10. #10
    Junior Member
    Join Date
    Jul 2017
    Posts
    1

    Default

    Hi, thanks for the useful info but unfortunately i am still not able to fix the problem for myself. Could you help me with the following code? i can see that alert is already there but its not working. and when i tried with it, it is bombing alerts and are not in the right time. actually it will send an alert with every single price change. please if you could do it for me



    #property indicator_chart_window
    #property indicator_buffers 2
    #property indicator_color1 Lime
    #property indicator_color2 Red
    #define SH_BUY 1
    #define SH_SELL -1

    //---- Входные параметры
    extern int AllBars=0;//How many bars should be counted. 0 - all the bars.
    extern int Otstup=17;//Step back.
    extern double Per=13;//Period.
    extern string
    Alert_Setting = "---------- Alert Setting";
    extern bool
    EnableNativeAlerts = true;
    extern string
    SoundFilename = "alert.wav";

    int SH,NB,i,UD,x=0,y=0,a=0,b=0;
    double R,SHMax,SHMin;
    double BufD[];
    double BufU[];
    //+------------------------------------------------------------------+
    //| Функция инициализации |
    //+------------------------------------------------------------------+
    int init()
    {
    //We will write the number of the bars for which we are counting to the NB
    if (Bars<AllBars+Per || AllBars==0) NB=Bars-Per; else NB=AllBars;
    IndicatorBuffers(2);
    IndicatorShortName("SHI_SilverTrendSig");
    SetIndexStyle(0,DRAW_ARROW,0,2);
    SetIndexStyle(1,DRAW_ARROW,0,2);
    SetIndexArrow(0,159);
    SetIndexArrow(1,159);
    SetIndexBuffer(0,BufU);
    SetIndexBuffer(1,BufD);
    SetIndexDrawBegin(0,Bars-NB);//This indicator will be shown for NB bar only
    SetIndexDrawBegin(1,Bars-NB);
    ArrayInitialize(BufD,0.0);//Give a lot of "zero" to the buffe. Otherwise it will be garbage during the changing of time frame.
    ArrayInitialize(BufU,0.0);
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Функция деинициализации |
    //+------------------------------------------------------------------+
    int deinit()
    {
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Собсна индикатор |
    //+------------------------------------------------------------------+
    int start()
    {
    int CB=IndicatorCounted();
    /* It is the optimization option. We have the function here which restore/return the number of counted bars in very special way.
    During the first indicator's call we have 0: it is normal because it was not counted anything,
    and then we receive the number of bars minus 1. For example, if the number of bars equal 100,
    we will have 99. I did it especially, you may see that NB is the number of bars whioch should be counted.
    You know we may throw out this parameter. But for the people who understand we may keep it. So, during the first call
    of indicator this NB is the same one but during the 2dn etc calls - reducing the value up to the last bar,
    That is 1 or 2 for example*/
    if(CB<0) return(-1); else if(NB>Bars-CB) NB=Bars-CB;
    for (SH=1;SH<NB;SH++)//comb out the chart from 1 to NB
    {
    for (R=0,i=SH;i<SH+10;i++) {R+=(10+SH-i)*(High[i]-Low[i]);} R/=55;



    SHMax = High[Highest(NULL,0,MODE_HIGH,Per,SH)];
    SHMin = Low[Lowest(NULL,0,MODE_LOW,Per,SH)];


    if (Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) { BufD[SH]=High[SH]+R*0.5;
    if (Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) UD=SH_BUY;
    if (Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) y=0;//x=x+1;



    }
    else


    if (Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL) { BufU[SH]=Low[SH]-R*0.5;
    if (Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL)UD=SH_SELL;
    if (Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL) x=0;//y=y+1;

    }
    }

    //----------------------- ALERT ON UP / DOWN DOT

    if(EnableNativeAlerts)
    {
    string AlertComment;

    if(UD==SH_BUY && x==1) Alert(Symbol(), " - ", "BUY - UP DIRECTION !");
    if(UD==SH_BUY && x==1) Alert(AlertComment);
    if(UD==SH_BUY && x==1) PlaySound(SoundFilename);
    if(UD==SH_BUY && x==1) x=x+1;

    if(UD==SH_SELL && y==1) Alert(Symbol(), " - ", "SELL - DOWN DIRECTION !");
    if(UD==SH_SELL && y==1) Alert(AlertComment);
    if(UD==SH_SELL && y==1) PlaySound(SoundFilename);
    if(UD==SH_SELL && y==1) y=y+1;


    }

    //----------------------- END FUNCTION
    return(0);
    }

Similar Threads

  1. Add alert to indicator
    By thesias in forum MQL programming
    Replies: 0
    Last Post: 11-03-2015, 09:37
  2. BB Alert Arrows - From Indicator to EA - HELP!!
    By syahrilcsm in forum Ideas for expert advisors
    Replies: 2
    Last Post: 05-21-2015, 18:07
  3. MA alert indicator into EA
    By Trint in forum Ideas for expert advisors
    Replies: 0
    Last Post: 03-30-2010, 10:21
  4. Adding alert to to the indicator
    By yasir9757 in forum Ideas for expert advisors
    Replies: 2
    Last Post: 01-16-2010, 15:46
  5. Alert in Indicator
    By tattoo-angel in forum Indicators
    Replies: 0
    Last Post: 05-01-2009, 08:12

Tags for this Thread

add, change, color, how to, indicator, mq4, signal, system, test, thank you, trend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •