
	#property	version			"0.10"
	#property	copyright		"BrainTheBoss"

  //-----------------------------------------------
  // CLASE
  //-----------------------------------------------

	class Bar {

	  //-----------------------------------------------
	  // VARIABLES
	  //-----------------------------------------------

	  //public
		public:		static			datetime														time;
		public:		static			uint															bars;

	  //-----------------------------------------------
	  // CONSTRUCTORES ( PUBLIC )
	  //-----------------------------------------------

	   /**
		*  @method	: Bar
		*  @ver		: 0.1
		*/
		private: Bar() {};

	  //-----------------------------------------------
	  // OPERADORES ( PUBLIC )
	  //-----------------------------------------------

	   /**
		*  @method	: tick
		*  @ver		: 0.1
		*/
		public: static uint tick() {

			int out;
			int counted_bars=IndicatorCounted();

		  //-- @CODE@ --

			if(counted_bars<0) return(-1);

			out = MathMin(Bars-bars,Bars-1);

			if ( ::Time[0] > time ){

				bars += Bars - bars;
//				Print(bars+":"+limit);
				time = ::Time[0];

			}

			return( out + 1 );

		};

	};

static datetime Bar::time = 0;
static uint Bar::bars = 0;
