ALLIGATOR_IND

Author: more
Indicators Used
Bill Williams Alligator
0 Views
0 Downloads
0 Favorites
ALLIGATOR_IND
//+------------------------------------------------------------------+
//|                                                ALLIGATOR_IND.mq4 |
//|                                             tradertobe@gmail.com |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "more"
#property link      "more"
//---
#include <stderror.mqh>
#include <stdlib.mqh>
#include <WinUser32.mqh>
//----
string Indicator_Name = "ALLIGATOR_IND: ";
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_level1  0
#property indicator_levelcolor Red

#property indicator_color1  White
//---
extern int   Style      = DRAW_HISTOGRAM; // DRAW_HISTOGRAM, DRAW_LINE
extern color IndColor = White;
extern int   Line_Thickness = 1;

extern int   History    = 1000; // â ìèíóòàõ ýòî ñóòêè
//----
double IndBuffer[];

//---
int i,j,k,Counted_bars;
double dv;
string sv;
string Sym;
int    last_error;
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
//--------------------------------------------------------------------
int start()                          
  {
//--------------------------------------------------------------------
   Counted_bars = IndicatorCounted(); // Êîëè÷åñòâî ïðîñ÷èòàííûõ áàðîâ 
   i = Bars - Counted_bars - 1;       // Èíäåêñ ïåðâîãî íåïîñ÷èòàííîãî
   if (i > History-1)                 // Åñëè ìíîãî áàðîâ òî ..
      i = History-1;                  // ..ðàññ÷èòûâàòü çàäàííîå êîëè÷.
//-----------------------------------------------------------------------  
   while(i >= 0)                      // Öèêë ïî íåïîñ÷èòàííûì áàðàì
   {
    double jaw_val   =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW  , i);
    double teeth_val =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, i);
    double lips_val  =iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS , i);
//---   
    double bar = NormalizeDouble( (lips_val - teeth_val) + (teeth_val-jaw_val),Digits);
//---   
//---     
     IndBuffer[i] = bar*1000000;        
//---           
      i--;                          // Ðàñ÷¸ò èíäåêñà ñëåäóþùåãî áàðà
   }  // end of while(i >= 0) 
//--------------------------------------------------------------------
   return;                          
  } // end of int start()
//--------------------------------------------------------------------
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
    Sym = Symbol();
//---- indicator
   IndicatorShortName(Indicator_Name);
   IndicatorDigits(0);
   SetIndexStyle (0, Style, DRAW_LINE, Line_Thickness, IndColor); // DRAW_HISTOGRAM
   SetIndexBuffer(0, IndBuffer);
   SetIndexLabel (0,"(lips-teeth) + (teeth-jaw)"); 
   return(0);
  } // end ofint init() 
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   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 ---