Navigation:Home > Content >

P_fractal_32_his_se_Alert_не_рисует.mq4

Time: 2010-06-19 | Download file:P_fractal_32_his_se_Alert_не_рисует.mq4

//+------------------------------------------------------------------+
//|                                                         jjjj.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//#property indicator_chart_window
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 18
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 LimeGreen
#property indicator_level7 8
#property indicator_level8 15

//---- input parameters
extern int       Rasrad=16;
extern double Level   = 15;
extern bool SoundAlert = TRUE;
extern bool AlertOnlySound   = false;
extern string Sound          = "alert2.wav";
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
#define SIGNAL_BAR 1
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
 IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   

//   SetIndexArrow(0,217);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexBuffer(1,ExtMapBuffer2);

   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2); //DRAW_SECTION
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2); //DRAW_SECTION
      


   //---- drawing settings
//   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
//   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
//   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
   SetIndexDrawBegin(0,34);
   SetIndexDrawBegin(1,34);

//   SetIndexArrow(1,218);
   SetIndexEmptyValue(1,0.0);
 //  SetIndexLabel(0,"UP");
 //  SetIndexLabel(1,"DW");
//SetIndexLabel(1,"oooo");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
int  symbol_kot;
  int rasr;
  int i;
  int a;
int k;
 int limit;  
 double price;
 double value;
   int    counted_bars=IndicatorCounted();
//---- TODO: add your code here
//---Proverki
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;

//----
   i=Bars-counted_bars-1;
//a=Rasrad;
rasr=Rasrad;
   while(i>=0)
////////////////////////////////////////////////////////////////////////////////////////     
     {
rasr=Rasrad;
value=0;
price=Open[i];    
//StringGetChar("hjgfdhgf",1000);

if(price>Open[i+1] && price>Open[i-1]){
k=1;
while(price>Open[i+k])/////////////////////////
{
k=k+1;
if(k==rasr+1){break;}
}
ExtMapBuffer1[i]= k-1;
}else{ExtMapBuffer1[i]= 0;}

rasr=Rasrad;        
value=0;
price=Open[i];

if(price= Level) {
          if (AlertOnlySound) {PlaySound(Sound);} else 
            {
            
            Alert(" fractal (", Symbol(), ", ", Period(),", ","Level > = ",Level, ")  ");
            
            }
         }
      
      if (ExtMapBuffer2[SIGNAL_BAR] >= Level) {
       if (AlertOnlySound) {PlaySound(Sound);} else 
       {
       
        Alert(" fractal (", Symbol(), ", ", Period(),", ","Level > = ",Level, ")  ");
         
       }
     }
      
//----
   return(0);
  }
//+------------------------------------------------------------------+

Recommend