Miscellaneous
0
Views
0
Downloads
0
Favorites
Cycle_KROUFR_version_MTF
//+------------------------------------------------------------------+
//| MTF_Cycle_KROUFR_version.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008 | Grayman77, zIG, akadex"
#property link "ForexResearch"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 White
#property indicator_color3 Aqua
#property indicator_level1 80
#property indicator_level2 20
#property indicator_level3 50
#property indicator_levelcolor SlateGray
extern int Period2=240;
extern int Period3=1440;
extern int FastMA=12;
extern int SlowMA=24;
extern int Crosses=50;
extern bool Comments=false;
int Period1=0;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//ObjectsDeleteAll();
Comment("");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i,limit,tm;
int p1,p2;
double vtmp1,vtmp2;
double pr1,pr2;
//---- ïðîâåðêà íà âîçìîæíûå îøèáêè
if(counted_bars<0) return(-1);
//---- ïîñëåäíèé ïîñ÷èòàííûé áàð áóäåò ïåðåñ÷èòàí
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
if(limit>Bars-2) limit=Bars-2;
//----
p1=0;
p2=0;
pr1=0;
pr2=0;
//for(i=Bars-2;i>0;i--)
for(i=limit;i>0;i--)
{
datetime _TimeBar=Time[i];
// ñìåùåíèå òåêóùåé ñâå÷è ÒÔ íà 2 ñòàðøå
int Shift=iBarShift(Symbol(),Period1,_TimeBar,false);
int Shift2=iBarShift(Symbol(),Period2,_TimeBar,false)+1;
int Shift3=iBarShift(Symbol(),Period3,_TimeBar,false)+1;
double v1=iCustom(Symbol(),Period1,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift);
double v2=iCustom(Symbol(),Period2,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift2);
double v3=iCustom(Symbol(),Period3,"Cycle_KROUFR_version_",FastMA,SlowMA,Crosses,Comments,0,Shift3);
ExtMapBuffer1[i]=v1;
ExtMapBuffer2[i]=v2;
ExtMapBuffer3[i]=v3;
}
//----
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
---