BW-wiseMan-1 Alert_001

Author: Copyright � 2008, MetaQuotes Software Corp.
BW-wiseMan-1 Alert_001
Indicators Used
Bill Williams Alligator
Miscellaneous
Implements a curve of type %1It plays sound alerts
0 Views
0 Downloads
0 Favorites
BW-wiseMan-1 Alert_001
//+------------------------------------------------------------------+
//|                                           BW-wiseMan-1 Alert.mq4 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Gold
#property indicator_color2 Gold

extern int updown=5; //ñìåùåíèå èíäèêàòîðà ÷òîáû íå íàëåçàëíà äðóãèå çíà÷êè
extern int back=2; // êîë-âî áàðîâ äëÿ àíàëèçà íàçàä



//---- buffers
double BWWM1Up[];
double BWWM1Down[];
extern bool SoundON=false;


int pos=0;
int i=0;
bool contup=true,contdown=true;


//+-----------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,232);
SetIndexBuffer(0,BWWM1Up);
SetIndexEmptyValue(0,0.0);

SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,232);
SetIndexBuffer(1,BWWM1Down);
SetIndexEmptyValue(1,0.0);

IndicatorDigits(6);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int cbars=IndicatorCounted();
if (cbars<0) return(-1);
if (cbars>0) cbars--;
//---- TODO: add your code here
//if (cbars == 0) return(0);
pos=cbars;
while (pos > 0)
{
BWWM1Up[pos]=NULL;
BWWM1Down[pos]=NULL;

if (
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(Low[pos]> iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&& 
(Close[pos]<((High[pos]+Low[pos])/2))
)
{
contup=true; 
for(i=1; i <= back ;i++)
{
if (High[pos]<=High[pos+i]) 
{
contup=false;
break;

} 
}
if (contup) BWWM1Up[pos]=(High[pos]+updown*Point);
PlaySound("Alert.wav");

}


if (
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, pos))
&&
(High[pos]< iAlligator(NULL,0,13,8,8,5,5,3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, pos))
&& 
(Close[pos]>((High[pos]+Low[pos])/2))
)
{
contdown=true; 
for(i=1; i <= back ;i++)
{
if (Low[pos]>=Low[pos+i]) 
{
contdown=false;
break;
PlaySound("Alert.wav");
} 
}
if (contdown) BWWM1Down[pos]=(Low[pos]-updown*Point); 
PlaySound("Alert.wav");

}
pos--;
}

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