How do I fix this indi so the alarm will work?
Results 1 to 5 of 35

Thread: How do I fix this indi so the alarm will work?

  1. #1
    Can somebody please help me to find the alarm to function? It has the feature, but it does not seem to work.

    Thank you

    Here is the code (and I'll attach the indior):


    #property copyright Copyright © 2006, Eli hayun
    #property link
    #property indior_chart_window
    #property indior_buffers 2
    #property indior_color1 Blue
    #property indior_color2 Crimson
    //-- enter parameters
    extern int fastEma=38;
    extern int slowEma=120;
    extern int macdSma=20;
    extern bool UseAlert=false;
    //-- buffers
    double ExtMapBuffer1[];
    double ExtMapBuffer2[];
    // ------------------------------------------------------------------
    //| Custom indior initialization function |
    // ------------------------------------------------------------------
    int init()

    //-- indiors
    SetIndexStyle(0,DRAW_ARROW);
    SetIndexArrow(0,233);
    SetIndexBuffer(0,ExtMapBuffer1);
    SetIndexEmptyValue(0,0.0);
    SetIndexStyle(1,DRAW_ARROW);
    SetIndexArrow(1,234);
    SetIndexBuffer(1,ExtMapBuffer2);
    SetIndexEmptyValue(1,0.0);
    //--
    return(0);

    // ------------------------------------------------------------------
    //| Custom indior deinitialization function |
    // ------------------------------------------------------------------
    int deinit()

    //--

    //--
    return(0);

    // ------------------------------------------------------------------
    //| Custom indior iteration function |
    // ------------------------------------------------------------------
    int begin()

    int limit;
    int counted_bars=IndiorCounted();
    //-- check for possible mistakes
    if(counted_barslt;0) return(-1);
    //-- last counted pub will be recounted
    if(counted_barsgt;0) counted_bars--
    limit=Bars-counted_bars;
    //-- main loop
    for(int I=0; ilt;limitation; I )

    ExtMapBuffer1[I] = 0; ExtMapBuffer2[I] = 0;
    double macdMain0 = iMACD(NULL, 0, fastEma, slowEma, macdSma, PRICE_CLOSE, MODE_MAIN, I);
    double macdMain2 = iMACD(NULL, 0, fastEma, slowEma, macdSma, PRICE_CLOSE, MODE_MAIN, I 1);
    double macdSignal0 = iMACD(NULL, 0, fastEma, slowEma, macdSma, PRICE_CLOSE, MODE_SIGNAL, I);
    double macdSignal2 = iMACD(NULL, 0, fastEma, slowEma, macdSma, PRICE_CLOSE, MODE_SIGNAL, I 1);

    if (macdMain0 gt; macdSignal0 macdMain2 lt; macdSignal2)
    ExtMapBuffer1[I] = iLow(NULL, 0, I 1);
    if (macdMain0 lt; macdSignal0 macdMain2 gt; macdSignal2)
    ExtMapBuffer2[I] = iHigh(NULL, 0, I 1);

    return(0);

    // ------------------------------------------------------------------
    https://www.forexsoutheast.asia/atta...6588651794.mq4

  2. #2
    Quote Originally Posted by ;
    Can someone please assist me to find the alarm to function? It's the attribute, but it doesn't seem to work.
    Seems it is missing the Alert command which needs to be written after each condition, together with the parameters and eventual text chosen to the Alert pop-up window. In addition, as Alerts can be switched off or on, you should incorporate an earlier if UseAlert illness.

    If (macdMain0 gt; macdSignal0 macdMain2 lt; macdSignal2)
    ExtMapBuffer1[I] = iLow(NULL, 0, I 1);
    Alert (parameters)

    if (macdMain0 lt; macdSignal0 macdMain2 gt; macdSignal2)
    ExtMapBuffer2[I] = iHigh(NULL, 0, I 1);
    Alert (parameters)

  3. #3
    Quote Originally Posted by ;
    Sounds it's overlooking the Alert command which should be written after each condition, with the parameters and eventual text chosen for your Alert pop-up window. As Alerts could be turned on or off, you need to include a previous should UseAlert illness.

    If (macdMain0 gt; macdSignal0 macdMain2 lt; macdSignal2)
    ExtMapBuffer1[I] = iLow(NULL, 0, I 1);
    Alert (parameters here)

    if (macdMain0 lt; macdSignal0 macdMain2 gt; macdSignal2)
    ExtMapBuffer2[I] = iHigh(NULL, 0, I 1);
    Alert (parameters here)
    Thanks for your assistance. Is it possible that you please code it in for me? I can not code, and I am useless though I understand a tiny bit of the code.

  4. #4
    Hi Jnita

    Please do try this modifiion by Radatats.

    Hope that this helps

    ~profi~
    https://www.forexsoutheast.asia/atta...8649321028.mq4

  5. #5
    Quote Originally Posted by ;
    Hi

    Please do Attempt this modifiion by Radatats.

    Hope that this helps

    ~profi~
    Thanks profi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.