//+------------------------------------------------------------------+ // MAE_NoiseDetect.mq4| //| Copyright (c) 2011, Curry_FX | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright (c) 2011, Curry_FX " #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 DarkRed #property indicator_width1 1 #property indicator_color2 DarkBlue #property indicator_width2 1 #property indicator_color3 Orange #property indicator_width3 2 #property indicator_color4 Turquoise #property indicator_width4 2 #property indicator_level1 0 //---- buffers double MAESM[]; double MAE[]; double ProfitSM[]; double Profit[]; extern int SMPriod = 12;//平滑化期間 extern int Label1 = 100;//インデックスラベル設定 int init() { IndicatorBuffers(4); SetIndexBuffer(0, MAE); SetIndexBuffer(1, Profit); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2, MAESM); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(3, ProfitSM); SetIndexStyle(3,DRAW_LINE); string label = "MAE_NoiseDetect("+SMPriod+")"; IndicatorShortName(label); SetLevelStyle(2,1,DimGray); SetIndexLabel(0, label); SetLevelValue(1,Label1); // SetLevelValue(2,100); return(0); } //---- Loop int start() { double spread = Ask-Bid; int limit = Bars-IndicatorCounted(); double dHigh , dLow , dResult; for(int i=limit-1; i>=0; i--) { if (Open[i]=0; i--) { MAESM[i] = iMAOnArray(MAE, 0, SMPriod, 0, MODE_EMA, i); ProfitSM[i] = iMAOnArray(Profit, 0, SMPriod, 0, MODE_EMA, i); } return(0); }