long numTicks=0; void OnStart() { //--- int i,veces=0; do { //hago este if para que no se haga para todos los ticks, sino uno de cada 100 for (i=1;i<=5;i++) { Comment("© Singularity Partners 2024","\n", "num_ticks ",numTicks,"\n", "VALOR DE i: ",i, " CODE LINE:",__LINE__,"\n"); Sleep (1500); } veces++; } while (veces<=20); } //--------------on tick /*void OnStart() { //--- mostramos en el comentario del gráfico una cuenta atrás de 10 a 1 for(int i=10; i>0 && !IsStopped(); i--) { Comment(StringFormat("Wait %u seconds",i)); Sleep(1000); } //--- escribimos en el comentario "entrante" un texto describiendo el propósito del script string text="This was a test showing how the Sleep() function works"; string mess=""; for(int i=0; i<(int)text.Length(); i++) { mess+=ShortToString(text.GetChar(i)); Sleep(100); Comment(mess); } //--- nos despedimos... Sleep(1000); for(int i=0; i<6; i++) { mess=(i % 2 == 0 ? "" : " Bye!"); Comment(mess); Sleep(300); } //--- borramos el texto en el gráfico Comment(""); } void OnTick() { //--- /*int i; numTicks++; if (numTicks%10==0) { //hago este if para que no se haga para todos los ticks, sino uno de cada 100 for (i=1;i<=5;i++) { Sleep (500); Comment("© Singularity Partners 2024","\n", "num_ticks ",numTicks,"\n", "VALOR DE i: ",i, " CODE LINE:",__LINE__,"\n"); } }*/ } //+------------------------------------------------------------------+