ADX_Trend_and_Alert

ADX_Trend_and_Alert
Indicators Used
Movement directional index
Miscellaneous
It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
ADX_Trend_and_Alert
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

int start()
{   
   double lastsignal=0, signal;   
   
   double Adx=iADX(NULL,0,14,PRICE_HIGH,MODE_MAIN,0);
   double PlusDi=iADX(NULL,0,14,PRICE_HIGH,MODE_PLUSDI,0);
   double MinusDi=iADX(NULL,0,14,PRICE_HIGH,MODE_MINUSDI,0);
 
   if     (Adx >= 25 && PlusDi  >= 25 && MinusDi <= 15) { 	signal = +1; }
   else if(Adx >= 25 && MinusDi >= 25 && PlusDi  <= 15) {   		signal = -1; }
   else {                                               	signal =  0; }
		    

   if (signal!=0) {
      if (signal!=lastsignal) {
         Alert("ADX signal on ", Symbol(),"/",Period());
         lastsignal= signal;   
      }
   } else { lastsignal= 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 ---