Mira cómo descargar robots gratis
¡Búscanos en Twitter!
Pon "Me gusta" y sigue las noticias
¿Es interesante este script?
Deje un enlace a él, ¡qué los demás también lo valoren!
¿Le ha gustado el script?
Evalúe su trabajo en el terminal MetaTrader 5
Librerías

New Bar Detector - librería para MetaTrader 4

Visualizaciones:
679
Publicado:
2020.05.31 18:27
\MQL4\Include\ \MQL4\Experts\
¿Necesita un robot o indicador basado en este código? Solicítelo en la bolsa freelance Pasar a la bolsa

This library simplifies the task of detecting when a new bar is created.


Basic Usage

//+------------------------------------------------------------------+
//| Include required files                                           |
//+------------------------------------------------------------------+
#include <NewBarDetector.mqh>
//+------------------------------------------------------------------+
//| Define expert variables                                          |
//+------------------------------------------------------------------+
CNewBarDetector new_bar_detector;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//--- Check if is a new bar is created
   if(new_bar_detector.IsNewBar())
     {
      Print("Is a new bar!");
     }
  }
//+------------------------------------------------------------------+

Please see the MQL4\Experts\NewBarDetector_DemoEA.mq4 file to see an example more detailed of use in a basic expert advisor.

Basic check-up of Experts for MQL4 Basic check-up of Experts for MQL4

This is a simple function for the initial control of an expert.

Script to close all negative trades first and then followed by positive trades Script to close all negative trades first and then followed by positive trades

A modified close all script by me.

All In One Mirror All In One Mirror

Mirror indicator with a dropdown list of base indicators to choose from with optional alerts, email, and push notifications.

Independent Chart Independent Chart

Independent Chart Indicator for MT4