//+------------------------------------------------------------------+ //| scOnTickMarketWatch.mq5| //| Copyright 2010, Lizar | //| lizar-2010@mail.ru | //+------------------------------------------------------------------+ #property copyright "Copyright 2010, Lizar" #property link "lizar-2010@mail.ru" #property version "1.00" int delay=500; // Delay time in milliseconds //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { datetime prev_time=0; // Previous tick time //--- while(!_StopFlag) { //--- get time of the last tick datetime current_tick=TimeCurrent(); if(prev_time=current_tick) EventChartCustom(ChartID(),pos,SymbolInfoInteger(symbol,SYMBOL_SPREAD),SymbolInfoDouble(symbol,SYMBOL_BID),symbol); } prev_time=current_tick; // Save last tick time } Sleep(delay); } } //+------------------------------------------------------------------+