Results 1 to 1 of 1
 1 Attachment(s)    

Thread: How can I add alert to this indi???

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

    Default How can I add alert to this indi???

    Hi
    I have a problem with addind an alert to the "trend magic" indicator.
    Can anybody give me some hint how to do it?



    Code:
    #property indicator_chart_window
    #property indicator_buffers 4
    #property indicator_color1 Blue
    #property indicator_color2 Red
    #property indicator_color3 Black
    #property indicator_color4 Black
    
    double g_ibuf_76[];
    double g_ibuf_80[];
    int gi_84 = 0;
    
    int init() {
       SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
       SetIndexBuffer(0, g_ibuf_76);
       SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
       SetIndexBuffer(1, g_ibuf_80);
       return (0);
    }
    
    int deinit() {
       return (0);
    }
    
    int start() {
       int li_8;
       double ld_12;
       double ld_20;
       double l_icci_28;
       double l_icci_36;
       int li_52 = IndicatorCounted();
       if (li_52 < 0) return (-1);
       if (li_52 > 0) li_52--;
       int li_0 = Bars - li_52;
       
       for (int li_4 = li_0; li_4 >= 0; li_4--) {
          l_icci_28 = iCCI(NULL, 0, 50, PRICE_TYPICAL, li_4);
          l_icci_36 = iCCI(NULL, 0, 50, PRICE_TYPICAL, li_4 + 1);
          li_8 = li_4;
          ld_12 = 0;
          ld_20 = 0;
          
          
          for (li_8 = li_4; li_8 >= li_4 - 9; li_8--) 
               ld_20 += MathAbs(High[li_8] - Low[li_8]);
               ld_12 = ld_20 / 10.0;
          
          if (l_icci_28 >= gi_84 && l_icci_36 < gi_84) 
              g_ibuf_76[li_4 + 1] = g_ibuf_80[li_4 + 1];
          
          if (l_icci_28 <= gi_84 && l_icci_36 > gi_84) 
              g_ibuf_80[li_4 + 1] = g_ibuf_76[li_4 + 1];
          
          if (l_icci_28 >= gi_84) {
              g_ibuf_76[li_4] = Low[li_4] - iATR(NULL, 0, 5, li_4);
             
             if (g_ibuf_76[li_4] < g_ibuf_76[li_4 + 1]) 
                 g_ibuf_76[li_4] = g_ibuf_76[li_4 + 1];
                
          } 
          else 
          {
             if (l_icci_28 <= gi_84) {
                g_ibuf_80[li_4] = High[li_4] + iATR(NULL, 0, 5, li_4);
                
                if (g_ibuf_80[li_4] > g_ibuf_80[li_4 + 1]) 
                    g_ibuf_80[li_4] = g_ibuf_80[li_4 + 1];
                    
             }
          }
       }
       return (0);
    }
    Attached Files Attached Files

Similar Threads

  1. C4 scalping indi
    By 274275025 in forum Expert advisors live statements
    Replies: 0
    Last Post: 05-09-2013, 11:17
  2. Help to add popup alert and arrow to this indi
    By MrHumble in forum Indicators
    Replies: 0
    Last Post: 04-30-2013, 03:41
  3. 0_BV - Indi + EA Needed
    By blueocean in forum Ideas for expert advisors
    Replies: 1
    Last Post: 06-08-2009, 19:50
  4. 5_34_5 indi
    By przem81621 in forum Ideas for expert advisors
    Replies: 2
    Last Post: 05-19-2009, 19:48

Tags for this Thread

add, color, high, how to, indicator, low, magic, 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
  •