EW Easy Counter Script-Corrective Waves-V2

Author: � 2011 TRADERTOOLS-FX.COM
EW Easy Counter Script-Corrective Waves-V2
0 Views
0 Downloads
0 Favorites
EW Easy Counter Script-Corrective Waves-V2
//+------------------------------------------------------------------+
//|                                  EW Labeler-Corrective Waves.mq4 |
//|                                                                  |
//|   This tool allows you to quickly drag n' drop to count waves    |
//|   More free tools @ tradertools-fx.com                           |
//|                                    Paul Nordin                   |
//|                                    http://www.tradertools-fx.com |
//+------------------------------------------------------------------+
#property copyright "© 2011 TRADERTOOLS-FX.COM"
#property link      "http://www.tradertools-fx.com"

//User Parameters
color textColor = Red;
string font = "Arial";
int fontSize = 14;
int numCycles = 100;

string wavePrefix = "Counter Wave";
string waveName, wavePostfix;
int    cycle, breakTest;

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start() {

   Comment( "TRADERTOOLS-FX.COM" );
   
   cycle = 0;
   breakTest = 0;
   for ( int j = 0; j < numCycles; j++ ) {//To control cycles
      for ( int i = 0; i < 3; i++ ) {//To control waves within cycle
         switch ( i ) {
            case 0: wavePostfix = "A";
                    break; 
            case 1: wavePostfix = "B";
                    break;
            case 2: wavePostfix = "C"; 
        }    
        waveName = StringConcatenate( wavePrefix, i, cycle );
        if ( ObjectFind( waveName ) < 0 ) {
          ObjectCreate( waveName, OBJ_TEXT, 0, WindowTimeOnDropped(), WindowPriceOnDropped() );
          ObjectSetText( waveName, wavePostfix, fontSize, font, textColor );
          breakTest += 1;
          break;
       } 
    } 
    if ( breakTest > 0 )
      break;
    else 
      cycle += 1;  
  }
  return(0);
}
//+------------------------------------------------------------------+

Comments