Miscellaneous
0
Views
0
Downloads
0
Favorites
Intensivnost_Tikov
//+------------------------------------------------------------------+
//| Intensivnost_Tikov.mq4 |
//| Copyright © 2007, DRKNN |
//| drknn@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, DRKNN"
#property link "drknn@mail.ru"
#property indicator_separate_window
#property indicator_buffers 3
//Öâåò èíäèêàòîðíûõ ëèíèé
#property indicator_color1 ForestGreen
#property indicator_color2 Crimson
#property indicator_color3 Gray
//Òîëùèíà èíäèêàòîðíûõ ëèíèé
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
// --- Âñïîìîãàòåëüíûå ïåðåìåííûå ----------
int TickCounter=0;//ñ÷¸ò÷èê òèêîâ
int myBars;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(2,ExtMapBuffer3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start(){
if(isNewBar()==true){//Ïîÿâèëñÿ íîâûé áàð
if(Open[1]<Close[1]){//åñëè áû÷üÿ
ExtMapBuffer1[1]=TickCounter;
TickCounter=0;
}
if(Open[1]>Close[1]){//åñëè ìåäâåæüÿ
ExtMapBuffer2[1]=TickCounter;
TickCounter=0;
}
if(Open[1]==Close[1]){//åñëè äîäæ
ExtMapBuffer3[1]=TickCounter;
TickCounter=0;
}
}
TickCounter++;//íà êàæäîì òèêå óâåëè÷èâàåì ñ÷¸ò÷èê òèêîâ
return(0);
}
//+------------------------------------------------------------------+
// ------- Ïîëüçîâàòåëüñêèå ïîäïðîãðàììû -------------------
//+------------------------------------------------------------------+
//| ôóíêöèÿ isNewBar() - âîçâðàùàåò ïðèçíàê íîâîãî áàðà |
//+------------------------------------------------------------------+
bool isNewBar(){
bool res=false;
if(myBars!=Bars){
res=true;
myBars=Bars;
}
//----
return(res);
}
//---------------------------------------------------------------
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
---