Miscellaneous
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 Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---