CCI_arrow
Indicators Used
Commodity channel index
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
CCI_arrow
#property indicator_chart_window

#property indicator_buffers 2 

#property indicator_color1 Aqua
#property indicator_color2 Yellow


//---- input parameters

extern int period_cci1=5;
extern int period_cci2=50;
extern int Control=80;


extern double DI=30;// Ñêîëüêî ïîèíòîâ îòñòóïàòü äëÿ îòðèñîâóêè
//---- buffers


double UP[];
double DN[];




//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  //---- 2 additional buffers are used for counting.
   IndicatorBuffers(2);
 
//---- indicator lines
   SetIndexStyle(0,DRAW_ARROW,EMPTY,1);
   SetIndexBuffer(0,UP);
   SetIndexArrow(0,225); 

   SetIndexStyle(1,DRAW_ARROW,EMPTY,1);
   SetIndexBuffer(1,DN);
   SetIndexArrow(1,226);
      
 

   
//---- name for DataWindow and indicator subwindow label
//----

   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Stochastic oscillator                                            |
//+------------------------------------------------------------------+
int start()
{  double cci1,cci2;
    for(int i=MathMax(Bars-1-IndicatorCounted(),1); i>=0; i--){    
      DN[i]=EMPTY_VALUE;
      UP[i]=EMPTY_VALUE;
      cci1=iCCI(Symbol(),0,period_cci1,0,i);
      cci2=iCCI(Symbol(),0,period_cci2,0,i);
      if(cci1>Control && cci2<0)DN[i]=High[i]+DI*Point;
      if(cci1<((-1)*Control) && cci2>0)UP[i]=Low[i]-DI*Point;
      
                                                              }    
}



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