Indicators Used
0
Views
0
Downloads
0
Favorites
Stochastic_DL_ybMTF1
//+------------------------------------------------------------------+
//| MTF_Stochastic.mq4 |
//| Copyright © 2006, Keris2112 |
//+------------------------------------------------------------------+
//2008fxtsd ki
#property copyright "Copyright © 2006, Keris2112"
#property link "http://www.forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 DeepSkyBlue
#property indicator_color4 Yellow
//#property indicator_style2 2
#property indicator_level1 80
#property indicator_level2 50
#property indicator_level3 20
#property indicator_levelcolor DarkSlateGray
//----
extern int TimeFrame=60;
extern int KPeriod=8;
extern int DPeriod=3;
extern int Slowing=3;
extern int MAMethod=0;
extern int PriceField=1;
extern bool ShowDots =true;
extern bool Zer0BarYellow =true;
extern string PriceField_ = "0=Hi/Low 1=Close/Close";
extern string MA_Method_ = "SMA0 EMA1 SMMA2 LWMA3";
extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN;0-currentTF";
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+-------------------
int init()
{
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle (0,DRAW_SECTION);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle (1,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle (3,DRAW_LINE);
if (ShowDots)
{
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle (2,DRAW_ARROW);
SetIndexArrow (2,158); // 250 177 251
SetIndexEmptyValue(2,EMPTY_VALUE);
}
TimeFrame =MathMax(TimeFrame,Period());
switch(TimeFrame)
{
case 1 : string TimeFrameStr="M1"; break;
case 5 : TimeFrameStr="M5"; break;
case 15 : TimeFrameStr="M15"; break;
case 30 : TimeFrameStr="M30"; break;
case 60 : TimeFrameStr="H1"; break;
case 240 : TimeFrameStr="H4"; break;
case 1440 : TimeFrameStr="D1"; break;
case 10080 : TimeFrameStr="W1"; break;
case 43200 : TimeFrameStr="MN"; break;
default : TimeFrameStr="TF0";
}
IndicatorShortName("Stochastic ("+KPeriod+","+DPeriod+","+Slowing+") "+TimeFrameStr);
SetIndexShift (2,TimeFrame/Period()-1);
}
return(0);
//+------------------------
int start()
{
datetime TimeArray[];
int i,y,limit,counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
limit=MathMax(limit,TimeFrame/Period());
for(i=0,y=0;i<limit;i++)
{
if (Time[i]<TimeArray[y]) y++;
ExtMapBuffer1[i]=iStochastic(NULL,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField,0,y);
ExtMapBuffer2[i]=iStochastic(NULL,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField,1,y);
ExtMapBuffer4[i]=EMPTY_VALUE;
if(Zer0BarYellow && i<=1) ExtMapBuffer4[i]=ExtMapBuffer1[i];
if(ShowDots && Time[i]==TimeArray[y]) ExtMapBuffer3[i]=ExtMapBuffer1[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
---