[MT4指标]atr区间指示
在主图上显示上atr指标,这样会更加直观的显示出来
主图指标
mt4指标类型:震荡指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| ATR Levels2.mq4 |
//| Sergey Iljukhin & TOPpoint|
//| [email protected] & [email protected]|
//+------------------------------------------------------------------+
#property copyright "Sergey Iljukhin"
#property link "mailto:[email protected]"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightSkyBlue
#property indicator_color2 LightSkyBlue
#property indicator_color3 LightSkyBlue
#property indicator_color4 LightSkyBlue
#define LevelMaxDeep 2000
extern int ATRPeriod = 10;
datetime PrevTime;
string ShortName="ATR Levels";
double OHLC_D1[6];
//---- buffers
double UpLine1,UpLine2,DnLine1,DnLine2;
ArraySetAsSeries(UpLine1,true);
ArraySetAsSeries(UpLine2,true);
ArraySetAsSeries(DnLine1,true);
ArraySetAsSeries(DnLine2,true);
//+------------------------------------------------------------------+
//| 软桷栲腓玎鲨? 爨耨桠钼 |
//+------------------------------------------------------------------+
int InitChart()
{
//---- indicator line
SetIndexStyle(0,DRAW_LINE,EMPTY,2);
SetIndexStyle(1,DRAW_LINE,2);
SetIndexStyle(2,DRAW_LINE,EMPTY,2);
SetIndexStyle(3,DRAW_LINE,2);
SetIndexBuffer(0,UpLine1);
SetIndexBuffer(1,UpLine2);
SetIndexBuffer(2,DnLine1);
SetIndexBuffer(3,DnLine2);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName(ShortName+" ("+ATRPeriod+")");
SetIndexLabel(0,"Up Channel 1");
SetIndexLabel(1,"Up Channel 2");
SetIndexLabel(2,"Down Channel 1");
SetIndexLabel(3,"Down Channel 2");
//----
SetIndexEmptyValue(0,0);
SetIndexEmptyValue(1,0);
SetIndexEmptyValue(2,0);
SetIndexEmptyValue(3,0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| 泽黻鲨? 桧桷栲腓玎鲨? - 箐嚯?屐 镳邃 簌桢 腓龛? |
//+------------------------------------------------------------------+
int init()
{
InitChart();
return(0);
}
//+------------------------------------------------------------------+
//| 泽黻鲨? 溴桧桷栲腓玎鲨? - 箐嚯?屐 镳邃 簌桢 腓龛? |
//+------------------------------------------------------------------+
int deinit()
{
InitChart();
return(0);
}
//+------------------------------------------------------------------+
//| 务眍忄? 趔黻鲨? 疣聍弪? 箴钼礤? |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int lastday=0, i, j, daybar=0, chartbar=0;
double LowYesterday, HighYesterday, LowToday, HighToday, fullatr1, fullatr2;
if (PrevTime==Time[0]) return(-1);
if(Period() > PERIOD_H4)
{
Comment("ATR Levels - 铠栳赅: 镥痂钿 沭圄桕? 犷脲? ?4 !");
return(-1); // then exit
}
ArrayCopyRates(OHLC_D1, Symbol(), PERIOD_D1);
lastday=TimeDay(Time[0]);
for (i=0; iATR%20Levels4.jpg
发表于:2015-06-17 10:06只看该作者
2楼
谢谢楼主,辛苦了
韬客社区www.talkfx.co
发表于:2015-06-17 14:38只看该作者
3楼
谢谢楼主,辛苦了
韬客社区www.talkfx.co