Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
MTF_Smart
//+------------------------------------------------------------------+
//| Copyright 2019, Trading Bots Pro |
//| https://tradingbots.pro |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Trading Bots Pro"
#property link "https://tradingbots.pro"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
#property indicator_label1 "Red"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_width1 2
#property indicator_label2 "Blue"
#property indicator_type2 DRAW_LINE
#property indicator_color2 clrBlue
#property indicator_width2 2
//#property indicator_label3 "White"
//#property indicator_type3 DRAW_SECTION
//#property indicator_color3 clrWhite
//#property indicator_style3 STYLE_SOLID
//#property indicator_width3 1
//--- input parameters
input ENUM_TIMEFRAMES TimeFrame=0;
int MfiHigh= 70;
int MfiLow = 30;
int RsiHigh= 60;
int RsiLow = 40;
int StochHigh= 70;
int StochLow = 30;
//--- indicator buffers
double Buffer1[];
double Buffer2[];
int n=0;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit()
{
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
SetIndexEmptyValue(0,-1);
SetIndexEmptyValue(1,-1);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
for(i=0,y=0;i<limit;i++)
{
if(Time[i]<TimeArray[y]) y++;
double mfi = iMFI(NULL, TimeFrame, 14, y);
double rsi = iRSI(NULL, TimeFrame,14,PRICE_CLOSE, y);
double stoch=iStochastic(NULL,TimeFrame,14,1,1,MODE_SMA,0,MODE_MAIN,y);
if(mfi>=MfiHigh && rsi>=RsiHigh && stoch>=StochHigh)
{
Buffer1[i]=High[i];
}
else Buffer1[i]=-1;
if(mfi<=MfiLow && rsi<=RsiLow && stoch<=StochLow)
{
Buffer2[i]=Low[i];
}
else Buffer2[i]=-1;
}
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
---