Miscellaneous
0
Views
0
Downloads
0
Favorites
MI_Fractal
//+------------------------------------------------------------------+
//| MI_Fractal.mq4 |
//| Îðåøêèí À.Â. |
//| http://www.vk.com/mtforex |
//+------------------------------------------------------------------+
#property copyright "Îðåøêèí À.Â."
#property link "http://www.vk.com/mtforex"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Yellow
#property indicator_width1 2
#property indicator_width2 2
//--- input parameters
extern int Ñâå÷åé_ñëåâà=10;
extern int Ñâå÷åé_ñïðàâà=2;
extern int Ðàçíèöà=10;
//extern int Áàðîâ_Èñïîëüçîâàòü=1000;
extern bool Ïîêàçàòü_Âåðõíèé=true;
extern bool Ïîêàçàòü_Íèæíèé=true;
bool UP_Fractal,DOWN_Fractal;
double DEF,up[],down[];
int init()
{
DEF=NormalizeDouble(Ðàçíèöà*Point,Digits);
SetIndexBuffer(0,up);
SetIndexBuffer(1,down);
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(0,217);
SetIndexArrow(1,218);
return(0);
}
int deinit(){return(0);}
int start()
{
//for (int i=Áàðîâ_Èñïîëüçîâàòü;i>Ñâå÷åé_ñïðàâà;i--)
for (int i=Bars-IndicatorCounted()-Ñâå÷åé_ñëåâà-1;i>Ñâå÷åé_ñïðàâà;i--)
{//3
UP_Fractal=true;DOWN_Fractal=true;
for (int x=i+Ñâå÷åé_ñëåâà;x>=i-Ñâå÷åé_ñïðàâà;x--)
{//0
if (x==i) continue;
if (High[i]-High[x]<DEF) UP_Fractal=false;
if (Low[x]-Low[i]<DEF) DOWN_Fractal=false;
}//0
up[i]=EMPTY;
down[i]=EMPTY;
if (Ïîêàçàòü_Âåðõíèé)
if (UP_Fractal && !DOWN_Fractal) up[i]=High[i];
if (Ïîêàçàòü_Íèæíèé)
if (!UP_Fractal && DOWN_Fractal) down[i]=Low[i];
}//3
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
---