Indicators Used
Miscellaneous
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 Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---