Spread Alert_v1

Author: Jo�o Barbosa
Spread Alert_v1
Miscellaneous
It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
Spread Alert_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                 Spread Alert.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,LastSpread,LastStopLevel;

int init()
  {
   NormalSpread=MarketInfo(Symbol(),MODE_SPREAD);
   NormalStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   LastSpread=NormalSpread;LastStopLevel=NormalStopLevel;
   return(0);
  }

int start()
  { 
   RefreshRates();Sleep(500);
   int ActualSpread=MathMax((Ask-Bid)/Point,NormalSpread);
   int ActualStopLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   if (ActualSpread!=LastSpread) {
     Alert(Symbol()," - Spread has change to ",ActualSpread," pips. Normal is ",NormalSpread," pips.");Sleep(500);
     LastSpread=ActualSpread; }
   if (ActualStopLevel!=NormalStopLevel) {
     Alert(Symbol()," - Stop Level has change to ",ActualStopLevel," pips. Normal is ",NormalStopLevel," pips.");Sleep(500);
     LastSpread=ActualSpread; }
   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 ---