Price Data Components
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
FractalChannelh
//+------------------------------------------------------------------+
//| Fractal Channel.mq4 |
//| Copyright © 2005 Chris Battles |
//| cbattles@neo.rr.com |
//+------------------------------------------------------------------+
#property copyright "Chris Battles"
#property link "mailto:cbattles@neo.rr.com"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 DodgerBlue
#property indicator_color4 Crimson
#property indicator_minimum -0.1
#property indicator_maximum 1.0
//---- buffers
double v1[];
double v2[];
double v3[];
double v4[];
//----
double val1;
double val2;
int i, b = 0, s = 0;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
//----
SetIndexStyle(0, 12);
SetIndexDrawBegin(0, i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "Resistance");
//----
SetIndexStyle(1, 12);
SetIndexDrawBegin(1, i-1);
SetIndexBuffer(1, v2);
SetIndexLabel(1, "Support");
SetIndexStyle(2, 2, 0, 4);
SetIndexBuffer(2, v3);
SetIndexStyle(3, 2, 0, 4);
SetIndexBuffer(3, v4);
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
i = Bars;
while(i >= 0)
{
val1 = iFractals(NULL, 0, MODE_UPPER, i);
//----
if(val1 > 0)
v1[i] = High[i];
else
v1[i] = v1[i+1];
val2 = iFractals(NULL, 0, MODE_LOWER, i);
//----
if(val2 > 0)
v2[i] = Low[i];
else
v2[i] = v2[i+1];
if(iClose(NULL,0,i) > v1[i]){
v3[i] = 1;
v4[i] = 0;
}
if(iClose(NULL,0,i) < v2[i]){
v3[i] = 0;
v4[i] = 1;
}
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
---