Author: Copyright 2019, SEM Software Corp.
0 Views
0 Downloads
0 Favorites
Next
ÿþ//+------------------------------------------------------------------+

//|                                                         Next.mq5 |

//|                        Copyright 2019, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property service

#property copyright "Copyright 2019, SEM Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"







input int _X=10; //second



int _next=1000; //second

//+------------------------------------------------------------------+

//| Service program start function                                   |

//+------------------------------------------------------------------+

void OnStart(void)

  {

   _next=_X*1000;

   OnStartTimeFrame();

   Sleep(1000);

   OnStart();

  }

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+

bool OnStartTimeFrame()

  {

   long currChart=0,prevChart=ChartFirst();

   int i=0,limit=100;

   while(i<limit && !IsStopped())

     {

      ChartSetInteger(prevChart,CHART_BRING_TO_TOP,0,true);

      ChartRedraw(prevChart);

      Sleep(_next);

      currChart=ChartNext(prevChart);



      if(currChart<0)

         break;

      prevChart=currChart;

      i++;

     }

   return(true);

  }

//+------------------------------------------------------------------+

Comments