Alert For ZZ SuperTrend's_v1

Author: Copyright � 2006, MetaQuotes Software Corp.
Alert For ZZ SuperTrend's_v1
Miscellaneous
It plays sound alertsIt issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
Alert For ZZ SuperTrend's_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                    Alert For ZZ SuperTrend's.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window

extern string SoundName = "email.wav";
extern int ShowDays   = 100;

int AlertIsAGo = 10;
double prevtime = 0, top = 8500000000, bot = 7700;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
   int ShowBars = ((1440/Period())*ShowDays);
   if (ShowBars >= Bars) ShowBars = Bars - 50;

//---- indicator calculation

    for(int i=ShowBars; i>=0; i--)
     {
      if (prevtime != Time[0])
       { RefreshRates(); prevtime = Time[0]; AlertIsAGo = 0;
       }
       
       double AlwaysLookingUp = 0, AlwaysLookingDn = 0;
       
       double first2 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 5 MIN", 1,i);
       double secon2 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 15 MIN",1,i);
       double third2 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 30 MIN",1,i);
       double fourt2 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 60 MIN",1,i);
       
       double first21 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 5 MIN", 1,i+1);
       double secon21 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 15 MIN",1,i+1);
       double third21 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 30 MIN",1,i+1);
       double fourt21 = iCustom(Symbol(),0,"ZZ MTF Super_Trend 60 MIN",1,i+1);
      
      if (first2 > top && secon2 > top && third2 > top && fourt2 > top && fourt21 < top) AlwaysLookingUp = 10;
      if (first2 > top && secon2 > top && third2 > top && third21 < top && fourt2 > top) AlwaysLookingUp = 10;
      if (first2 > top && secon2 > top && secon21 < top && third2 > top && fourt2 > top) AlwaysLookingUp = 10;
      if (first2 > top && first21 < top && secon2 > top && fourt2 > top && fourt2 > top) AlwaysLookingUp = 10;
      
      if (first2 < bot && secon2 < bot && third2 < bot && fourt2 < bot && fourt21 > bot) AlwaysLookingDn = 10;
      if (first2 < bot && secon2 < bot && third2 < bot && third21 > bot && fourt2 < bot) AlwaysLookingDn = 10;
      if (first2 < bot && secon2 < bot && secon21 > bot && third2 < bot && fourt2 < bot) AlwaysLookingDn = 10;
      if (first2 < bot && first21 > bot && secon2 < bot && fourt2 < bot && fourt2 < bot) AlwaysLookingDn = 10;
      
     }
    
    if ( (AlertIsAGo <= 0) && (AlwaysLookingUp > 0) )
     { PlaySound(SoundName); AlertIsAGo = 10;
       Alert(" Up Up Up Up  ",Symbol());
     }
    if ( (AlertIsAGo <= 0) && (AlwaysLookingDn > 0) )
     { PlaySound(SoundName); AlertIsAGo = 10;
       Alert(" Dn Dn Dn Dn  ",Symbol());
     }
    
    
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---