Miscellaneous
0
Views
0
Downloads
0
Favorites
SpeedTick
//+------------------------------------------------------------------+
//| SpeedTick.mq4 |
//| Copyright © 2006, XEON |
//| xeon@nm.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, XEON"
#property link "xeon@nm.ru"
//Èíäèêàòîð íàðîñòàíèÿ äâèæåíèÿ öåí çà ïðîìåæóòîê âðåìåíè
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
//---- indicator buffers
double BUYBuffer[];
double SELLBuffer[];
//------------------------------
int NewBar;
double OldBid, NewBid;
int BUYTick, SELLTick;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle(0,DRAW_HISTOGRAM,0);
SetIndexBuffer(0,BUYBuffer);
SetIndexStyle(1,DRAW_HISTOGRAM,0);
SetIndexBuffer(1,SELLBuffer);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
OldBid = NewBid;
NewBid = Bid;
if(NewBid>OldBid){BUYTick++;}
else if(NewBid<OldBid){SELLTick++;}
else {BUYBuffer[0]=0; SELLBuffer[0]=0;}
BUYBuffer[0] =BUYTick;
SELLBuffer[0]=-SELLTick;
if(NewBar!=Bars){
NewBar=Bars;
BUYTick = 0;
SELLTick = 0;
}
//----
return(0);
}
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
---