View Single Post
  #3 (permalink)  
Old 07-04-2006, 04:36 AM
elihayun's Avatar
elihayun elihayun is offline
Senior Member
 
Join Date: Jan 2006
Posts: 377
elihayun is on a distinguished road
Quote:
Originally Posted by unltdsoul
I am having problems with MT4 in that it does not appear to save variable data on a tick by tick basis, but rather only at end of 1 min bars.
I did the following and it works

PHP Code:
   static double  lastClose;
   
   
double b Bid;
   
   if( 
lastClose )
      Print(
TimeToStr(Time[0])," Up  Close="+DoubleToStr(b,Digits)+"  lastClose="+DoubleToStr(lastClose,Digits));
   else if( 
blastClose )
         Print(
TimeToStr(Time[0])," Dn  Close="+DoubleToStr(b,Digits)+"  lastClose="+DoubleToStr(lastClose,Digits)); 
      else
         Print(
TimeToStr(Time[0])," NoChange  Close="+DoubleToStr(b,Digits)+"  lastClose="+DoubleToStr(lastClose,Digits));   
         
   
lastClose b;
   return(
0); 
06:33:14 Tick Data USDCHF,M1: 2006.07.04 06:33 Up Close=1.2235 lastClose=0.0000
06:33:14 Tick Data USDCHF,M1: 2006.07.04 06:33 NoChange Close=1.2235 lastClose=1.2235
06:34:25 Tick Data USDCHF,M1: 2006.07.04 06:34 Dn Close=1.2234 lastClose=1.2235
06:34:28 Tick Data USDCHF,M1: 2006.07.04 06:34 Up Close=1.2235 lastClose=1.2234
06:34:29 Tick Data USDCHF,M1: 2006.07.04 06:34 Dn Close=1.2234 lastClose=1.2235
06:34:31 Tick Data USDCHF,M1: 2006.07.04 06:34 Up Close=1.2235 lastClose=1.2234
06:34:32 Tick Data USDCHF,M1: 2006.07.04 06:34 Dn Close=1.2234 lastClose=1.2235
06:34:59 Tick Data USDCHF,M1: 2006.07.04 06:34 Up Close=1.2235 lastClose=1.2234
06:36:20 Tick Data USDCHF,M1: 2006.07.04 06:36 Up Close=1.2237 lastClose=1.2235
06:36:20 Tick Data USDCHF,M1: 2006.07.04 06:36 Dn Close=1.2235 lastClose=1.2237
06:36:20 Tick Data USDCHF,M1: 2006.07.04 06:36 Up Close=1.2236 lastClose=1.2235
Reply With Quote