Krishan





//+------------------------------------------------------------------+
//|                                             IchimokuAlert_v1.mq4 |
//|                                  Copyright © 2006, Forex-TSD.com |
//|                         Written by IgorAD,igorad2003@yahoo.co.uk |   
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |                                      
//+------------------------------------------------------------------+




#property copyright "Copyright © 2006, Forex-TSD.com "
#property link      "http://www.forex-tsd.com/"

#property indicator_chart_window
#property indicator_buffers 12
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 SandyBrown
#property indicator_color4 Red
#property indicator_color5 White
#property indicator_color6 SandyBrown
#property indicator_color7 Thistle
#property indicator_color8 Orange


#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1

double CrossUp[];
double CrossDown[];
double Tup[];
double Tdown[];
bool   DownTunnel = false;
bool   UpTunnel = false;
bool   Signal = true;

extern int FasterEMA = 5;
extern int SlowerEMA = 12;
extern int FasterSidusEMA = 18;
extern int SlowerSidusEMA = 28;

int upalert=false,downalert=false;


//---- input parameters
extern int Tenkan=9;
extern int Kijun=26;
extern int Senkou=52;
extern int AlertMode=1;

// sidus
extern bool Alerts = true;
extern bool Tunnel_Alerts= true;
extern bool Email_Alerts = false;

/// sidus

// SAR
extern bool   Sound.Alert    = true ;
extern bool   Show.PriceBox  = true ;
extern int    myBoxWidth     = 3;
extern double    Step=0.001;
extern int Diff=20; //ñäâèã íà÷àëà öåïî÷êè ïî âåðòèêàëè â ïîèíòàõ
extern int ilimit =144; 

//---- buffers
double SarBuffer[];
//----
int    save_lastreverse;
bool   save_dirlong;
double save_start;
double save_last_high;
double save_last_low;
double save_ep;
double save_sar;
double save_delta;

string symbol, tChartPeriod,  tShortName ;  
int    digits, period  ; 

bool Trigger ;

int OldBars = -1 ;

///sar

//---- buffers
double Tenkan_Buffer[];
double Kijun_Buffer[];
double SpanA_Buffer[];
double SpanB_Buffer[];
double Chinkou_Buffer[];
double SpanA2_Buffer[];
double SpanB2_Buffer[];
//----
int a_begin;
bool UptrendAlert1,DntrendAlert1,UptrendAlert2,DntrendAlert2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//AlertMode = 0 - no alert;
//AlertMode = 1 - Tenkan crosses Kijun;
//AlertMode = 2 - Chinkou crosses Price;
//AlertMode = 3 - both together.
//+------------------------------------------------------------------+


//// sidus

int limitsidus, isidus, counter;

double RSI, RSIp, CCI, FasterEMAnow, SlowerEMAnow, FasterEMAprevious, SlowerEMAprevious, FasterEMAafter, SlowerEMAafter, fasterSidusEMAnow, fasterSidusEMAprevious, fasterSidusEMAafter, slowerSidusEMAnow, slowerSidusEMAprevious, slowerSidusEMAafter;
   double Range, AvgRange;



/////



int init()
  {
//----

   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Tenkan_Buffer);
   SetIndexDrawBegin(0,Tenkan-1);
   SetIndexLabel(0,"Tenkan Sen");
//----
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Kijun_Buffer);
   SetIndexDrawBegin(1,Kijun-1);
   SetIndexLabel(1,"Kijun Sen");
//----
   a_begin=Kijun; if(a_begin<Tenkan) a_begin=Tenkan;
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(2,SpanA_Buffer);
   SetIndexDrawBegin(2,Kijun+a_begin-1);
   SetIndexShift(2,Kijun);
   SetIndexLabel(2,NULL);
   SetIndexStyle(5,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(5,SpanA2_Buffer);
   SetIndexDrawBegin(5,Kijun+a_begin-1);
   SetIndexShift(5,Kijun);
   SetIndexLabel(5,"Senkou Span A");
//----
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(3,SpanB_Buffer);
   SetIndexDrawBegin(3,Kijun+Senkou-1);
   SetIndexShift(3,Kijun);
   SetIndexLabel(3,NULL);
   SetIndexStyle(6,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(6,SpanB2_Buffer);
   SetIndexDrawBegin(6,Kijun+Senkou-1);
   SetIndexShift(6,Kijun);
   SetIndexLabel(6,"Senkou Span B");
//----
   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,Chinkou_Buffer);
   SetIndexShift(4,-Kijun);
   SetIndexLabel(4,"Chinkou Span");
//----


////// sidus
/*
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 241);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 242);
   SetIndexBuffer(1, CrossDown);
   SetIndexStyle(2, DRAW_ARROW, EMPTY);
   SetIndexArrow(2, 167);
   SetIndexBuffer(2, Tup);
   SetIndexStyle(3, DRAW_ARROW, EMPTY);
   SetIndexArrow(3, 167);
   SetIndexBuffer(3, Tdown);

*/
//// sidus


//sar
string symbol, tChartPeriod,  tShortName ;  
int    digits, period  ; 

bool Trigger ;

int OldBars = -1 ;


   period       = Period() ;     
   tChartPeriod =  TimeFrameToString(period) ;
   symbol       =  Symbol() ;
   digits       =  Digits ;   

   tShortName = "wl3"+ symbol + tChartPeriod  ;  
//---- indicators
   IndicatorDigits(Digits+1);
//----
   SetIndexStyle(7,DRAW_ARROW);
   SetIndexArrow(7,159);
   SetIndexBuffer(7,SarBuffer);


//sar


   return(0);
  }

//sar
  
  int deinit()
{
   ObjectDelete(tShortName+"01"); 
 
         
   return(0);
}


void SaveLastReverse(int last,int dir,double start,double low,double high,double ep,double sar)
  {
   save_lastreverse=last;
   save_dirlong=dir;
   save_start=start;
   save_last_low=low;
   save_last_high=high;
   save_ep=ep;
   save_sar=sar;
  }

//sar
  
  
//+------------------------------------------------------------------+
//| Ichimoku Kinko Hyo                                               |
//+------------------------------------------------------------------+
int start()
  {
///// sidus
   int siduscounted_bars=IndicatorCounted();
//---- check for possible errors
   if(siduscounted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(siduscounted_bars>0) siduscounted_bars--;

   limitsidus=Bars-siduscounted_bars;
   
   for(isidus = 0; isidus <= limitsidus; isidus++) {

      counter=isidus;
      Range=0;
      AvgRange=0;
   
      for (counter=isidus ;counter<=isidus+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      }

      Range=AvgRange/10;
       
      FasterEMAnow = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, isidus);
      FasterEMAprevious = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, isidus+1);
      FasterEMAafter = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, isidus-1);

      SlowerEMAnow = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, isidus);
      SlowerEMAprevious = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, isidus+1);
      SlowerEMAafter = iMA(NULL, 0, SlowerEMA, 0, FasterEMA, PRICE_CLOSE, isidus-1);

      fasterSidusEMAnow = iMA(NULL, 0, FasterSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus);
      fasterSidusEMAprevious = iMA(NULL, 0, FasterSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus+1);
      fasterSidusEMAafter = iMA(NULL, 0, FasterSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus-1);

      slowerSidusEMAnow = iMA(NULL, 0, SlowerSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus);
      slowerSidusEMAprevious = iMA(NULL, 0, SlowerSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus+1);
      slowerSidusEMAafter = iMA(NULL, 0, SlowerSidusEMA, 0, MODE_EMA, PRICE_CLOSE, isidus-1);
      
      RSI=iRSI(NULL,0,21,PRICE_CLOSE,isidus);
      RSIp=iRSI(NULL,0,21,PRICE_CLOSE,isidus+1);
      
      CCI=iCCI(NULL,0,50,PRICE_CLOSE,isidus);


      if (   fasterSidusEMAnow > slowerSidusEMAnow &&
             fasterSidusEMAprevious <= slowerSidusEMAprevious &&
             fasterSidusEMAafter > slowerSidusEMAafter )
      { 
         UpTunnel=true; DownTunnel=false; Tup[isidus] = Low[isidus] - Range*1;
         if( isidus<=2 && Alerts && !upalert && Tunnel_Alerts )
         {
            upalert=true; downalert=false;
            Alert (Symbol()," ",Period(),"M  Sidus Tunnel UP ");
            if ( Email_Alerts ) { SendMail("Sidus Tunnel UP "+Symbol(),""); }
         }
      }


      if ( fasterSidusEMAnow < slowerSidusEMAnow &&
           fasterSidusEMAprevious >= slowerSidusEMAprevious &&
           fasterSidusEMAafter < slowerSidusEMAafter )
      {
         DownTunnel=true; UpTunnel=false; Tdown[isidus] = High[isidus] + Range*1.2;
         if( isidus<=2 && Alerts && !downalert && Tunnel_Alerts )
         {
            upalert=false; downalert=true;
            Alert (Symbol()," ",Period(),"M  Sidus Tunnel DOWN ");
            if ( Email_Alerts ) { SendMail("Sidus Tunnel DOWN "+Symbol(),""); }
         }
      }
      
      if (  
           ( // Conditions for up signal for EMA-Sidus crosses
             (( FasterEMAnow > fasterSidusEMAnow && FasterEMAnow > slowerSidusEMAnow ) ||
              ( SlowerEMAnow > fasterSidusEMAnow && SlowerEMAnow > slowerSidusEMAnow )) &&
             ( FasterEMAprevious <= fasterSidusEMAprevious || FasterEMAprevious <= slowerSidusEMAprevious ) &&
             ( SlowerEMAprevious <= fasterSidusEMAprevious || SlowerEMAprevious <= slowerSidusEMAprevious ) &&
             RSI > 50 &&
             CCI > 0 &&
             UpTunnel
           )
         )
         {   // IF all that above is correct, then do this:
             UpTunnel=false;
             DownTunnel=false;
             Signal=true;
             CrossUp[isidus] = Low[isidus] - Range*1.6;
             if(isidus<=2 && Alerts && !upalert)
               {
                  Alert (Symbol()," ",Period(),"M  Sidus BUY ");
                  if ( Email_Alerts ) { SendMail("Sidus BUY "+Symbol(),""); }
                  upalert=true;
                  downalert=false;
               }
         }
      
      if (  
           ( // Conditions for down signal for EMA-Sidus crosses too
             (( FasterEMAnow < fasterSidusEMAnow && FasterEMAnow < slowerSidusEMAnow ) ||
              ( SlowerEMAnow < fasterSidusEMAnow && SlowerEMAnow < slowerSidusEMAnow )) &&
             ( FasterEMAprevious >= fasterSidusEMAprevious || FasterEMAprevious >= slowerSidusEMAprevious ) &&
             ( SlowerEMAprevious >= fasterSidusEMAprevious || SlowerEMAprevious >= slowerSidusEMAprevious ) &&
             RSI < 50 &&
             CCI < 0 &&
             DownTunnel
           )
         )
         {   // IF all that above is correct, then do this:
             UpTunnel=false;
             DownTunnel=false;
             Signal=true;
             CrossDown[isidus] = High[isidus] + Range*1.2;
             if(isidus<=2 && Alerts && !downalert)
               {
                  Alert (Symbol()," ",Period(),"M  Sidus SELL ");
                  if ( Email_Alerts ) { SendMail("Sidus SELL "+Symbol(),""); }
                  downalert=true;
                  upalert=false;
               }
         }



/// last bracket
   }

/// sidus


   int    i,ii,k;
   int    counted_bars=IndicatorCounted();
   double high,low,price;
//----
   if(Bars<=Tenkan || Bars<=Kijun || Bars<=Senkou) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=Tenkan;i++)    Tenkan_Buffer[Bars-i]=0;
      for(i=1;i<=Kijun;i++)     Kijun_Buffer[Bars-i]=0;
      for(i=1;i<=a_begin;i++) { SpanA_Buffer[Bars-i]=0; SpanA2_Buffer[Bars-i]=0; }
      for(i=1;i<=Senkou;i++)  { SpanB_Buffer[Bars-i]=0; SpanB2_Buffer[Bars-i]=0; }
     }
//---- Tenkan Sen
   i=Bars-Tenkan;
   if(counted_bars>Tenkan) i=Bars-counted_bars-1;
   while(i>=0)
     {
      high=High[i]; low=Low[i]; k=i-1+Tenkan;
      while(k>=i)
        {
         price=High[k];
         if(high<price) high=price;
         price=Low[k];
         if(low>price)  low=price;
         k--;
        }
      Tenkan_Buffer[i]=(high+low)/2;
      i--;
     }
//---- Kijun Sen
   i=Bars-Kijun;
   if(counted_bars>Kijun) i=Bars-counted_bars-1;
   while(i>=0)
     {
      high=High[i]; low=Low[i]; k=i-1+Kijun;
      while(k>=i)
        {
         price=High[k];
         if(high<price) high=price;
         price=Low[k];
         if(low>price)  low=price;
         k--;
        }
      Kijun_Buffer[i]=(high+low)/2;
      i--;
     }
//---- Senkou Span A
   i=Bars-a_begin+1;
   if(counted_bars>a_begin-1) i=Bars-counted_bars-1;
   while(i>=0)
     {
      price=(Kijun_Buffer[i]+Tenkan_Buffer[i])/2;
      SpanA_Buffer[i]=price;
      SpanA2_Buffer[i]=price;
      i--;
     }
//---- Senkou Span B
   i=Bars-Senkou;
   if(counted_bars>Senkou) i=Bars-counted_bars-1;
   while(i>=0)
     {
      high=High[i]; low=Low[i]; k=i-1+Senkou;
      while(k>=i)
        {
         price=High[k];
         if(high<price) high=price;
         price=Low[k];
         if(low>price)  low=price;
         k--;
        }
      price=(high+low)/2;
      SpanB_Buffer[i]=price;
      SpanB2_Buffer[i]=price;
      i--;
     }
//---- Chinkou Span
   i=Bars-1;
   if(counted_bars>1) i=Bars-counted_bars-1;
   while(i>=0) { Chinkou_Buffer[i]=Close[i]; i--; }
//----

/// sidus



/// sidus



   
   if (AlertMode == 1 || AlertMode == 3)
   {
   string Message1 = Symbol()+" M"+Period()+":Tenkan crosses Kijun";
   
   if ( Tenkan_Buffer[0]>Kijun_Buffer[0] && Tenkan_Buffer[1]<Kijun_Buffer[1])
   PlaySound("alert.wav");
   
   if ( Tenkan_Buffer[0]<Kijun_Buffer[0] && Tenkan_Buffer[1]>Kijun_Buffer[1])
   PlaySound("alert.wav");
   if ( Tenkan_Buffer[1]>Kijun_Buffer[1] && Tenkan_Buffer[2]<Kijun_Buffer[2] && !UptrendAlert1)
   {Alert(Message1+"Signal for BUY"); UptrendAlert1 = true; DntrendAlert1 = false;} 
   if ( Tenkan_Buffer[1]<Kijun_Buffer[1] && Tenkan_Buffer[2]>Kijun_Buffer[2] && !DntrendAlert1)
   {Alert(Message1+"Signal for SELL"); UptrendAlert1 = false; DntrendAlert1 = true;} 
   }
   if (AlertMode == 2 || AlertMode == 3)
   {
   string Message2 = Symbol()+" M"+Period()+":Chinkou (White) crosses Price";
   if ( Close[0]>Close[0+Kijun] && Close[1]<Close[1+Kijun])
   PlaySound("alert2.wav");
   if ( Close[0]<Close[0+Kijun] && Close[1]>Close[1+Kijun])
   PlaySound("alert2.wav");
   if ( Close[1]>Close[1+Kijun] && Close[2]<Close[2+Kijun] && !UptrendAlert2)
   {Alert(Message2+":Signal for BUY"); DntrendAlert2 = false; UptrendAlert2 = true;} 
   if ( Close[1]<Close[1+Kijun] && Close[2]>Close[2+Kijun] && !DntrendAlert2)
   {Alert(Message2+":Signal for SELL"); DntrendAlert2 = true; UptrendAlert2 = false;} 
   }
   
   
      if( Bars != OldBars ) { Trigger = True ; }

   static bool first=false;
   bool   dirlong;
   double start,last_high,last_low;
   double ep,sar,price_low,price_high,pricesar;
  // int    counted_bars=IndicatorCounted();
      int limit=ilimit;
//      SetIndexDrawBegin(0,Bars-limit); 
//      SetIndexDrawBegin(1,Bars-limit); 
//----
   if(Bars<3) return(0);
   dirlong=true;
   start=Step;
//--------------------------------------------+
   ii=Bars-2;
   while(ii>=0)
     {
      price_low=Low[ii];
      price_high=High[ii];
      pricesar=SarBuffer[ii+1];//òåêóùàÿ öåíà ðàâíà SarBuffer ïðåäûäóùåãî áàðà
      //sar ðàâåí öåíà ïðåäûäóùåãî áàðà ïëþñ øàã óìíîæèòü íà 
      //(ñòàðàÿ öåíà ìèíóñ çíà÷åíèå SarBuffer ïðåäûäóùåãî áàðà)
      sar=pricesar+start*(ep-pricesar);
//----
      if(dirlong)
        {
         start+=Step;
         if(sar>price_low)
           {
            SaveLastReverse(ii,true,start,price_low,last_high,ep,sar);
            start=Step; 
            dirlong=false; 
            ep=price_low;
            last_low=price_low;
            SarBuffer[ii]=last_high-Diff*Point;
            if (SarBuffer[ii]<High[ii]&&SarBuffer[ii]>=Low[ii]) 
                SarBuffer[ii]=High[ii]+Point;
            if (SarBuffer[ii]<Low[i]) SarBuffer[ii]=Low[ii]-Point;
            ii--;
            continue;
           }
         if(ep<price_high) { last_high=price_high; ep=price_high; }
        }
//----
      else
        {
         start+=Step;
         if(sar<price_high)
           {
            SaveLastReverse(ii,false,start,last_low,price_high,ep,sar);
            start=Step; 
            dirlong=true; 
            ep=price_high;
            last_high=price_high;
            SarBuffer[ii]=last_low+Diff*Point;
            if (SarBuffer[ii]>Low[i]&&SarBuffer[ii]<=High[ii]) 
                SarBuffer[ii]=Low[ii]-Point;
            if (SarBuffer[ii]>High[ii]) SarBuffer[ii]=High[ii]+Point;
            ii--;
            continue;
           }
         if(ep>price_low) { last_low=price_low; ep=price_low; }
        }
      SarBuffer[ii]=sar;
      ii--;
     }
     
    
//----
//+--------- TRO MODIFICATION ---------------------------------------+  

 //  Print ("Buffer 0 : " + Tenkan_Buffer[0]) ;
 //  Print ("Buffer 1 : " + Kijun_Buffer[1]);
 // Print ("Price is : " + Close[0]);      
 //  Print (SarBuffer[0]);
   
   /// for BUY

//Print (DownTunnel);
//Print (UpTunnel);
//Print ("Chinkou is " + Chinkou_Buffer[0]);
//Print ("Span A is " + SpanA_Buffer[i]);
//Print ("Span B is " + SpanB_Buffer[i]);
//Print ("Span A2 is " + SpanA2_Buffer[i]);
//Print ("Span B2 is " + SpanB2_Buffer[i]);

      if ( Trigger &&  Sound.Alert ) 
{
   
// if tenkan is more than kijuan & chinkou is above price & kumo and price is above SAR

   if (Tenkan_Buffer[0] > Kijun_Buffer[1] && Chinkou_Buffer[0] > Close[0]  && Close[0] > SarBuffer[0])
   {
   Trigger = False ;
  Alert(Symbol(), " ", TimeFrameToString(Period()), " Buy at ",Close[0], " with stop-loss at ", DoubleToStr(SarBuffer[0] ,5)); 
   }
   
   /// now book profit
   
   if(Close[0] < SarBuffer[0] || Chinkou_Buffer[0]<Close[0])
   {
   Trigger = False ;
   Alert(Symbol(), " ", TimeFrameToString(Period()), " Close Long Position at ",DoubleToStr(Close[0],6)); 
   }
   

 // for short position
 
   if (Tenkan_Buffer[0] < Kijun_Buffer[1] && Close[0] < SarBuffer[0])
   {
Trigger = False ;
  Alert(Symbol(), " ", TimeFrameToString(Period()), " Short Sell at ",Close[0], " with stop-loss at ", DoubleToStr(SarBuffer[0] ,5)); 
   }
   
   /// now book profit
   
   if(Close[0] > SarBuffer[0] )
   {
Trigger = False ;
   Alert(Symbol(), " ", TimeFrameToString(Period()), " Close Short Position at ",Close[0]); 
   } 


}
   
/*      
      if ( Trigger &&  Sound.Alert ) 
      {
        if( Close[0] > SarBuffer[0] && Close[1] < SarBuffer[1] ) 
        {

         Trigger = False ; Alert(symbol,"  ", tChartPeriod, " Price above PSAR "+ DoubleToStr(SarBuffer[0] ,digits)); 
         }
        if( Close[0] < SarBuffer[0] && Close[1] > SarBuffer[1] ) { Trigger = False ; Alert(symbol,"  ", tChartPeriod, " Price below PSAR "+ DoubleToStr(SarBuffer[0] ,digits)); }     
      }
      
      
 */     
   if(Show.PriceBox) { DoBox() ; }
   OldBars = Bars ;   
   

   
   
   return(0);
  }
//+------------------------------------------------------------------+

void DoBox()    
{


       if (ObjectFind(tShortName+"01") != 0)
      {
          ObjectCreate(tShortName+"01",OBJ_ARROW,0,Time[0],SarBuffer[0]);
          ObjectSet(tShortName+"01",OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);
          ObjectSet(tShortName+"01",OBJPROP_COLOR,indicator_color8);  
          ObjectSet(tShortName+"01",OBJPROP_WIDTH,myBoxWidth);  
      } 
      else
      {
         ObjectMove(tShortName+"01",0,Time[0],SarBuffer[0]);
         ObjectSet(tShortName+"01",OBJPROP_COLOR,indicator_color8);  
      }
 


      

                
   return(0);
}


//+--------- TRO MODIFICATION ---------------------------------------+  

string TimeFrameToString(int tf)
{
   string tfs;
   switch(tf) {
      case PERIOD_M1:  tfs="M1"  ; break;
      case PERIOD_M5:  tfs="M5"  ; break;
      case PERIOD_M15: tfs="M15" ; break;
      case PERIOD_M30: tfs="M30" ; break;
      case PERIOD_H1:  tfs="H1"  ; break;
      case PERIOD_H4:  tfs="H4"  ; break;
      case PERIOD_D1:  tfs="D1"  ; break;
      case PERIOD_W1:  tfs="W1"  ; break;
      case PERIOD_MN1: tfs="MN";
   }
   return(tfs);
}





Sample



image not available


Analysis



Market Information Used:

Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Series array that contains close prices for each bar
Series array that contains open time of each bar


Indicator Curves created:

Implements a curve of type DRAW_ARROW

Implements a curve of type DRAW_LINE
Implements a curve of type DRAW_HISTOGRAM
Implements a curve of type DRAW_ARROW

Indicators Used:

Moving average indicator
Relative strength index
Commodity channel index


Custom Indicators Used:

Order Management characteristics:

Other Features:

It sends emails
It plays sound alerts
It issuies visual alerts to the screen