forked from e187038/SP_GVA1
47 lines
2.9 KiB
MQL5
47 lines
2.9 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| SP_Pedro_Chapter04.mq5 |
|
|
//+------------------------------------------------------------------+
|
|
#property version "1.00"
|
|
|
|
// Pausa de 1 segundo entre cada mensaje
|
|
#define PAUSA 2000 // 1000 milisegundos = 1 segundo
|
|
|
|
long numTicks=0;
|
|
int x=0;
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Expert tick function |
|
|
//+------------------------------------------------------------------+
|
|
void OnTick()
|
|
{
|
|
//---
|
|
int resto;
|
|
uint startvalor=GetTickCount(); //se obtienen los milisegundos desde que inicio el sistema, se pone a 0 cada 49,7 días.
|
|
|
|
Print ("inicio del ontick");
|
|
numTicks++;
|
|
// Esperar durante un período de tiempo
|
|
//datetime tiempoInicio = TimeLocal();
|
|
//Print ("Acabo de asignar un datetime ",tiempoInicio);
|
|
|
|
/*while (TimeLocal() - tiempoInicio < PAUSA)
|
|
{
|
|
Print (TimeLocal()," ",tiempoInicio);
|
|
}// Pausa de 1 segundo entre cada mensaje*/
|
|
Print ("antes del if");
|
|
|
|
resto=(int) numTicks % PAUSA;
|
|
if (resto==0)
|
|
if (x<5)
|
|
x++;
|
|
else
|
|
x=0;
|
|
|
|
//DASHBOARD
|
|
|
|
Comment("© Singularity Partners 2024","\n",
|
|
"num_ticks ",numTicks,"\n",
|
|
"x: ",x, " CODE LINE:",__LINE__,"\n",
|
|
" start valor: ",startvalor);
|
|
}
|
|
//+------------------------------------------------------------------+
|