Miscellaneous
0
Views
0
Downloads
0
Favorites
CanadosIndicator
//+------------------------------------------------------------------+
//| CanadosIndicator.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
extern int N1=10;
extern double N2=0.004;
//---- buffers
double HHV1_N2[];
double LLV1_N2[];
int i;
int init()
{
IndicatorBuffers(2);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE,EMPTY,2);
SetIndexBuffer(0, HHV1_N2);
SetIndexStyle(1,DRAW_LINE,EMPTY,2);
SetIndexBuffer(1, LLV1_N2);
return(0);
}
int start()
{
int counted_bars=IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int i=Bars-counted_bars;
while(i>=0)
{
HHV1_N2[i]=High[Highest(NULL,0,MODE_HIGH,N1,i)]-N2;
LLV1_N2[i]=Low[Lowest(NULL,0,MODE_LOW,N1,i)]+N2;
i--;
}
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
---