Compression takes the data within the time frame specified (e.g., daily date 
during July 2007) and compresses it into one bar and the C for that month is 
the last C of the month.  To answer your question, the date for the C 1 year 
ago is 12/31/07 and for 12 months ago it is 7/31/07 and so the code that you 
used will not produce the same roc().

Bill
  ----- Original Message ----- 
  From: Ken Close 
  To: [email protected] 
  Sent: Friday, July 18, 2008 4:14 PM
  Subject: [amibroker] Minor Question on TimeFrames + Tiny, Tiny Bug


  Is ROC(C,1) in "inYearly" compression supposed to be the same as ROC(C,12) in 
"inMonthly" compression?

  TimeFrameSet(inMonthly);

  MnGain1  =  ROC(C,1);

  QGain    =  ROC(C,3);

  YGain    =  ROC(C,12);

  TimeFrameRestore();

  TimeFrameSet(inyearly);

  YGain1   =  ROC(C,1);

  TimeFrameRestore();

  YGain2   =  TimeFrameExpand(YGain1,inMonthly);

  TimeFrameSet(inQuarterly);

  QGain2   =  ROC(C,1);

  TimeFrameRestore();

  QGain3   =  TimeFrameExpand(QGain2,inMonthly);


  (Above copied as is from the Formula Editor window)

  In this code, YGain calculated with ROC(C,12) produces the correct answer 
while YGain1 produces a different and incorrect value.
  Monthly is set as the Periodicity in the AA window.
  Which is why I asked the question.

  The minor, minor bug is that "inYearly" and "inQuarterly" are not red as 
reserved words, even though they function correctly.  One little color bit 
needs to be set somewhere in the guts of the program code.

  Ken




   
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.5.2/1561 - Release Date: 7/18/2008 6:35 
PM

Reply via email to