ang_AZad_vCg

0 Views
0 Downloads
0 Favorites
ang_AZad_vCg
//+------------------------------------------------------------------+
//|                                                   ang_AZad(C).mq4 |
//|                           Copyright © 2006, ANG3110@latchess.com |
//+------------------------------------------------------------------+

#property  copyright "ANG3110@latchess.com"
//----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//----
extern double ki=4;
//--------------------
double za[],z,za2[],z2,aza[],a0[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(4);
   SetIndexBuffer(0,aza);
   SetIndexBuffer(1,a0);
   SetIndexBuffer(2,za);
   SetIndexBuffer(3,za2);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator start function                                  |
//+------------------------------------------------------------------+
int start()
  {
   int i,cbi;
   int n,ai,bi,f,ai2,bi2,f2;
   cbi=Bars-IndicatorCounted()-1;
   if(IndicatorCounted()==0) cbi--;
//----
   for(i=cbi; i>=0; i--)
     {
      if(Close[i]>z && Close[i]>Close[i+1])
         z=za[i+1]+(Close[i]-za[i+1])/ki;
      if(Close[i]<z && Close[i]<Close[i+1])
         z=za[i+1]+(Close[i]-za[i+1])/ki;
      if(Close[i]>z2 && Close[i]<Close[i+1])
         z2=za2[i+1]+(Close[i]-za2[i+1])/ki;
      if(Close[i]<z2 && Close[i]>Close[i+1])
         z2=za2[i+1]+(Close[i]-za2[i+1])/ki;
      if(i>Bars-5)
        {
         z=Close[i];
         z2=z;
        }
      za[i]=z;
      za2[i] = z2;
      aza[i] = (za[i] - za2[i]) / Point;
      a0[i]=0.00000001;
     }
//----
   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 ---