Commentator





//+------------------------------------------------------------------+
//|  Àíäðåé Îïåéäà                                 Êîììåíòàòîð       |
//+------------------------------------------------------------------+
#property copyright "Îïåéäà Àíäðåé"
#property link      "itrytobenotlinked"


#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("Comentator");           
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   int i = 0;
//   Demarker
      double valDem=iDeMarker(NULL, 0, 13, 0);
      string commentDem = "DeMarker:    ";
      string commentDemAdd = "   No data";
     
      if (valDem < 0.30)
         commentDemAdd =  "   Possible reverse to uptrend";
      
      if (valDem > 0.70)
         commentDemAdd =   "   Possible reverse to downtrend";
      commentDem = commentDem + commentDemAdd;

//ATR
      double valATR=iATR(NULL, 0, 12, 0);
      string commentATR = "ATR:           ";
        commentATR = commentATR + "   Possible trend changing " + valATR;
            
//AÑ
      string commentAC = "AC:            ";
      string commentACAdd = "No data ";
      string commentACAdd0 = "No data ";
      string commentACAdd1 = "No data ";
      string commentACAdd2 = "No data ";
      double valAC0=iAC(NULL, 0, 0);
      double valAC1=iAC(NULL, 0, 1);
      if (valAC1 < valAC0)
         commentACAdd = "Sell not advisable";
      
      if (valAC1 > valAC0)
         commentACAdd = "Buy not advisable";
      
      bool theeRedUpper = true;
      for(i=2; i>=0; i--)
      {
         if ( iAC(NULL, 0, i) < iAC(NULL, 0, i+1))
         {
            if ( iAC(NULL, 0, i) <= 0)
               theeRedUpper = false;
         }
         else
            theeRedUpper = false;
      }
      
      if (theeRedUpper == true)
         commentACAdd0 = "Short position";


      bool theeGreenDown = true;
      for(i=2; i>=0; i--)
      {
         if ( iAC(NULL, 0, i) > iAC(NULL, 0, i+1))
         {
            if ( iAC(NULL, 0, i) >= 0)         
              theeGreenDown = false;
         }
         else
            theeGreenDown = false;
      }
      
      if (theeGreenDown == true)
         commentACAdd0 = "Long position";


      bool twoRedUpper = true;
      for(i=1; i>=0; i--)
      {
         if ( iAC(NULL, 0, i) > iAC(NULL, 0, i+1))
            twoRedUpper = false;
      }
      
      if (twoRedUpper == true)
         commentACAdd2 = "Short position";



      bool twoGreenDown = true;
      for(i=2; i>=0; i--)
      {
         if ( iAC(NULL, 0, i) < iAC(NULL, 0, i+1))
            twoGreenDown = false;
      }
      
      if (twoGreenDown == true)
         commentACAdd2 = "Long position";



      
      
      if (iAC(NULL, 0, 0) < 0)
      {         
         if (theeRedUpper == true)
            commentACAdd1 = "Possible buy, ";  
            
         if (theeGreenDown == true)
            commentACAdd1 = "Possible buy, ";  
                  
         if (twoRedUpper == true)
           commentACAdd2 = "Possible sell, ";         
      }
      
      if (iAC(NULL, 0, 0) > 0)
      {
         if (theeRedUpper == true)
            commentACAdd1 = "Possible sell, ";
            
         if (theeGreenDown == true)
            commentACAdd1 = "Possible sell, ";
                  
         if (twoGreenDown == true)
            commentACAdd2 = "Possible buy, ";
      }
      
            
        commentAC = commentAC 
        + "\n" + "   " +commentACAdd
        + "\n" + "   " + commentACAdd1+ commentACAdd0
        + "\n" + "   " + commentACAdd2
        ;

     
     
//CCI
      double valCCI=iCCI(NULL,0,12,PRICE_MEDIAN,0);
      string commentCCI = "CCI:            ";
      string commentCCIAdd = "   No data ";
      if (valCCI > 100)
        commentCCIAdd =  "   Overboughted condition (possibility to corrected recession) ";

      if (valCCI < -100)
        commentCCIAdd =  "   Oversolded condition (possibility to corrected raising) ";
        
      commentCCI =  commentCCI + commentCCIAdd + valCCI;



//MFI
      double valMFI=iMFI(NULL,0,14,0);
      string commentMFI = "MFI:            ";
      string commentMFIAdd = "   No data ";
      if (valMFI > 80)
        commentMFIAdd =  "    potential high ";

      if (valMFI < 20)
        commentMFIAdd =  "    potential low ";
        
        commentMFI =  commentMFI + commentMFIAdd + valMFI;
        
        
//WPR
      double valWPR=iWPR(NULL,0,14,0);
      string commentWPR = "R%:             ";
      string commentWPRAdd = "   No data ";
      if (valWPR < -80)
        commentWPRAdd =  "    Oversolded condition (waiting for long reversal is desirable) ";

      if (valWPR > -20)
        commentWPRAdd =  "    Overboughted condition (waiting for short reversal is desirable) ";
        
      commentWPR =  commentWPR + commentWPRAdd + valWPR;
        
        
//STOCH

      double valSTOCH=0; 
      string commentSTOCH = "Stoch:         ";
      string commentSTOCHAdd = "   No data ";
      if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0))
        commentSTOCHAdd =  "    Possible buy";
               
      if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)<iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0))
        commentSTOCHAdd =  "    Possible sell";   
        
      commentSTOCH =  commentSTOCH + commentSTOCHAdd;


//Momentum

      double valMom=0;
      string commentMom = "Momentum:  ";
      string commentMomAdd = "   No data ";
      if((iMomentum(NULL,0,14,PRICE_CLOSE,1) < 100) && (iMomentum(NULL,0,14,PRICE_CLOSE,0) > 100))
        commentMomAdd =  "    Signal to buy";
        
      if((iMomentum(NULL,0,14,PRICE_CLOSE,1) > 100) && (iMomentum(NULL,0,14,PRICE_CLOSE,0) < 100))
        commentMomAdd =  "    Signal to sell";   
        
      commentMom =  commentMom + commentMomAdd;
      
      Comment(
      commentSTOCH + "\n"
      +commentWPR + "\n"
      +commentMFI + "\n"
      +commentDem + "\n"
      +commentCCI + "\n"
      +commentATR + "\n"
      +commentMom + "\n"      
      +commentAC + "\n"
      );      
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:

DeMarker indicator
Indicator of the average true range
Bill Williams Accelerator/Decelerator oscillator
Commodity channel index
Money flow index
Larry William percent range indicator
Stochastic oscillator
Momentum indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: