www.pudn.com > RedbinaryoptionsDL.zip > FractalsTrend_BO.mq4, change:2011-06-08,size:3311b


//+------------------------------------------------------------------+ 
//|                                                FractalsTrend.mq4 | 
//|                      Copyright ゥ 2011, MetaQuotes Software Corp. | 
//|                             http://www.mql4.com/ru/users/rustein | 
//+------------------------------------------------------------------+ 
#property indicator_chart_window 
//+------------------------------------------------------------------+ 
extern int IndicatorWidth = 0; 
extern int IndicatorStyle = 1; 
extern int IndicatorTF = 0; 
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
{ 
//----- 
  ObjectCreate("iResistance",OBJ_TREND,0,0,0,0,0); 
  ObjectSet("iResistance",OBJPROP_STYLE,IndicatorStyle); 
  ObjectSet("iResistance",OBJPROP_COLOR,Green); 
  ObjectSet("iResistance",OBJPROP_WIDTH,IndicatorWidth); 
//----- 
  ObjectCreate("iSupport",OBJ_TREND,0,0,0,0,0); 
  ObjectSet("iSupport",OBJPROP_STYLE,IndicatorStyle); 
  ObjectSet("iSupport",OBJPROP_COLOR,Red); 
  ObjectSet("iSupport",OBJPROP_WIDTH,IndicatorWidth); 
//----- 
  return(0); 
} 
//+------------------------------------------------------------------+ 
//| Custom indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit() 
{ 
//----- 
  ObjectDelete("iResistance"); 
  ObjectDelete("iSupport");   
//----- 
  return(0); 
} 
//+------------------------------------------------------------------+ 
//| Custom indicator iteration function                              | 
//+------------------------------------------------------------------+ 
int start() 
{ 
//----- 
  double A1=0, A3=0, A5; 
  int    C1, C3, RS=2; 
//-----   
  while(A3==0) 
  { 
    A5=iFractals(NULL,IndicatorTF,MODE_UPPER,RS); 
    if (A5!=0) 
    { 
      if (A1==0) 
      { 
      C1=RS; A1=A5; 
      } 
      else if (A3==0) 
      { 
      C3=RS; A3=A5; 
      } 
    } 
    RS++; 
  } 
  ObjectSet("iResistance",OBJPROP_TIME1,iTime(NULL,IndicatorTF,C3)); 
  ObjectSet("iResistance",OBJPROP_TIME2,iTime(NULL,IndicatorTF,C1)); 
  ObjectSet("iResistance",OBJPROP_PRICE1,iHigh(NULL,IndicatorTF,C3)); 
  ObjectSet("iResistance",OBJPROP_PRICE2,iHigh(NULL,IndicatorTF,C1)); 
  ObjectSet("iResistance",OBJPROP_RAY,True); 
//----- 
  double B1=0, B3=0, B5; 
  int    D1, D3, SR=2; 
//-----   
  while(B3==0) 
  { 
    B5=iFractals(NULL,IndicatorTF,MODE_LOWER,SR); 
    if (B5!=0) 
    { 
      if (B1==0) 
      { 
      D1=SR; B1=B5; 
      } 
      else if (B3==0) 
      { 
      D3=SR; B3=B5; 
      } 
    } 
    SR++;  
  } 
  ObjectSet("iSupport",OBJPROP_TIME1,iTime(NULL,IndicatorTF,D3)); 
  ObjectSet("iSupport",OBJPROP_TIME2,iTime(NULL,IndicatorTF,D1)); 
  ObjectSet("iSupport",OBJPROP_PRICE1,iLow(NULL,IndicatorTF,D3)); 
  ObjectSet("iSupport",OBJPROP_PRICE2,iLow(NULL,IndicatorTF,D1)); 
  ObjectSet("iSupport",OBJPROP_RAY,True); 
//----- 
  return(0); 
} 
//+------------------------------------------------------------------+ 
//|---------------------------// END //------------------------------| 
//+------------------------------------------------------------------+

2018无需申请注册送58体验金