News Alert 2_v1

Author: Jo�o Barbosa
News Alert 2_v1
Miscellaneous
It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
News Alert 2_v1
//+------------------------------------------------------------------+
//|                                                 News Alert 2.mq4 |
//|                                                     João Barbosa |
//|                                        obarbosa2001@yahoo.com.br |
//+------------------------------------------------------------------+
#property copyright "João Barbosa"
#property link      "obarbosa2001@yahoo.com.br"

#property indicator_chart_window

int NormalSpread, NormalStopLevel;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   NormalSpread=MarketInfo(Symbol(),MODE_SPREAD);
   NormalStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   start();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  { 
   RefreshRates();
   int ActualSpread=(Ask-Bid)/Point;
   int ActualStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   if (ActualSpread>NormalSpread) { Alert("News or High Volatility !!! Spread has change.");
                                    Print("Actual Spread: ",ActualSpread," Pips, Normal Spread: ",NormalSpread," Pips"); 
                                    Sleep(50000);}
   if (ActualStopLevel>NormalStopLevel) { Alert("News or High Volatility !!! Stop Level has change.");
                                          Print("Actual Stop Level: ",ActualStopLevel," Pips, Normal Stop Level: ",NormalStopLevel," Pips");
                                          Sleep(50000); }

   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 ---