Miscellaneous
0
Views
0
Downloads
0
Favorites
SoundAtOpenNewBar
//+------------------------------------------------------------------+
//| SoundAtOpenNewBar.mq4 |
//| Copyright © 2008, Serega Lykov |
//| http://mtexperts.narod.ru/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Serega Lykov"
#property link "http://mtexperts.narod.ru/"
//---- property of indicator ----------------------------------------+
#property indicator_chart_window
//---- external parameters ------------------------------------------+
extern string SoundFile = "alert.wav";
//---- global variables ---------------------------------------------+
static datetime bartime;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- initialization of parameters
bartime = Time[0];
//---- finish of initialization
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- finish of deinitialization
return(0);
}
//+------------------------------------------------------------------+
//| Sound At Open New Bar |
//+------------------------------------------------------------------+
int start()
{
if(bartime == Time[0]) return(0);
bartime = Time[0];
PlaySound(SoundFile);
// finish of iteration
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
---