//+------------------------------------------------------------------+
//|                                             Price Action_PPR.mq4 |
//+------------------------------------------------------------------+

#property copyright "Dmitry Zhebrak aka Necron,© 2010"
#property link      "http://www.fxgeneral.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 MediumSlateBlue
#property indicator_color2 MediumSlateBlue
//---- input parameters
extern bool show_pattern=true;
extern int Size = 1;       // ????????? ??????? ??????.
extern double multiplier=1;
extern int Bars_ATR=233;//?????? ??? ATR
extern int Code_Arrow=159;

//---- buffers
double ExtUpFractalsBuffer[];
double ExtDownFractalsBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
 {
  // indicator buffers mapping  
 if (show_pattern == true) SetIndexBuffer(0, ExtUpFractalsBuffer);
 if (show_pattern == true) SetIndexBuffer(1, ExtDownFractalsBuffer);
  //  drawing settings
  SetIndexStyle (0, DRAW_ARROW, EMPTY, Size);
  SetIndexArrow (0, Code_Arrow);
  SetIndexStyle (1, DRAW_ARROW, EMPTY, Size);
  SetIndexArrow (1, Code_Arrow);
  //----
  SetIndexEmptyValue (0, 0.0);
  SetIndexEmptyValue (1, 0.0);
  // name for DataWindow
  SetIndexLabel (0,  "PPR_Dn");
  SetIndexLabel (1,  "PPR_Up");
  // initialization done   
  return(0);
 }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
 {

  int    i,nCountedBars;
  bool   bFound;
  bool   AlertUP, AlertDOWN;
  double dCurrent,range;
  nCountedBars=IndicatorCounted();
  range=iATR(NULL,0,Bars_ATR,0);

  // last counted bar will be recounted    
  if (nCountedBars <= 2) i = Bars - nCountedBars + 8;
  if (nCountedBars > 2)
   {
    nCountedBars--;
    i = Bars - nCountedBars + 8;
    
    
   }
  // Up and Down Fractals
  while (i >= 1)
   {
    // Fractals up
    bFound = false;
    dCurrent = High[i];
    if (High[i]>High[i+1] && Close[i-1]<Low[i])
     {
      bFound = true;
      AlertUP = true;
      ExtUpFractalsBuffer[i] = dCurrent +range*multiplier/10;
     }
                               
    // Fractals down
    bFound = false;
    dCurrent = Low[i];
    if (Low[i]<Low[i+1] && Close[i-1]>High[i])
     {
      bFound = true;
      AlertDOWN = true;
      ExtDownFractalsBuffer[i] = dCurrent -range*multiplier/10;
     }
                               
    i--;
   }
  return(0);
 }
//+------------------------------------------------------------------+
??????????? ? ????????? ???? ?????? ?????????? Price Action_PPR.mq4
? ????? ???????????? ? ?????? ?? ?????? ? ?????? ???????????? ????????? ????????? html-???? ? ??????. ?????????? ?? ?????????.

???/??? *

??? ??? ???
E-mail

???? (???????? 10??)
Scegli fileX
????? ??????????? * ???????? 2000 ????.

????? ?? 2000 ????????
 ???????? ???????????

« ?