Miscellaneous
0
Views
0
Downloads
0
Favorites
Z_MTF_3c_JRSX_H
//+------------------------------------------------------------------+
//| Z_MTF_3c_JRSX_H.mq4
//+------------------------------------------------------------------+
#property copyright "AHGduP"
#property link "Z_MTF_3c_JRSX_H"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 DeepSkyBlue
#property indicator_width1 2
#property indicator_color2 Magenta
#property indicator_width2 2
#property indicator_color3 Yellow
#property indicator_width3 2
#property indicator_maximum 1
#property indicator_minimum -1
//========================================================
#property indicator_level1 0.5
#property indicator_level2 -0.5
#property indicator_level3 0.0
#property indicator_levelcolor C'160,160,160' //DarkGray
#property indicator_levelstyle STYLE_DOT
#property indicator_levelwidth 0
//=========================================================
extern int Length = 7;//14
extern int TF = 0 ;
extern int BarSize = 3 ;
extern int CountBars = 500 ;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int init()
{ IndicatorDigits(Digits+1);
SetIndexStyle(0,DRAW_HISTOGRAM, STYLE_SOLID,BarSize);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM, STYLE_SOLID,BarSize);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID,BarSize);
SetIndexBuffer(2,ExtMapBuffer3);
//===================================================================
switch(TF)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
string ThisName = "Z_MTF_3c_JRSX_H";
string Text=ThisName;
Text=Text+"("+TF;
Text=Text+")";
Text=Text+"(";
Text=Text+" "+DoubleToStr(Length,0);
Text=Text+") ";
IndicatorShortName(Text);
}
return(0);
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TF);
// limit=Bars-counted_bars+TF/Period();
limit=Bars-counted_bars;
// if(counted_bars>0) limit++; else if (limit>100) limit=CountBars;
for(i=0,y=0;i<limit;i++)
{
if (Time[i]<TimeArray[y]) y++;
ExtMapBuffer1[i]=iCustom(NULL,TF,"3c_JRSX_H",Length,0,y);
ExtMapBuffer2[i]=iCustom(NULL,TF,"3c_JRSX_H",Length,1,y);
ExtMapBuffer3[i]=iCustom(NULL,TF,"3c_JRSX_H",Length,2,y);
}
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
---