Can somebody please tell me how I can associate the correct date with
barindex when data is compressed? In the following example I am compressing
the closing price of equity curve to monthly. However the trace statement
shows incorrect date for the monthly prices.TIA

 

dt = DateTime(); 
SetForeign( "~~~Equity" ); 
TimeFrameSet( inMonthly ); 
Eq = Close; 

for ( i = 0 ; i < BarCount ; i++ ) 
{ 
    _TRACE( "i: " + i + " Date: " + NumToStr( dt[i], formatDateTime ) + "
Eq: " + Eq[i] ); 
}

 

i: 2182 Date: 9/8/2009 Eq: {EMPTY}           

i: 2183 Date: 9/9/2009 Eq: 196780              

i: 2184 Date: 9/10/2009 Eq: 200143            

i: 2185 Date: 9/11/2009 Eq: 199723            

i: 2186 Date: 9/14/2009 Eq: 200235            

i: 2187 Date: 9/15/2009 Eq: 203289            

i: 2188 Date: 9/16/2009 Eq: 203369            

i: 2189 Date: 9/17/2009 Eq: 208362            

i: 2190 Date: 9/18/2009 Eq: 209573            

i: 2191 Date: 9/21/2009 Eq: 211509            

i: 2192 Date: 9/22/2009 Eq: 213253            

i: 2193 Date: 9/23/2009 Eq: 216647            

i: 2194 Date: 9/24/2009 Eq: 219080            

i: 2195 Date: 9/25/2009 Eq: 230729            

i: 2196 Date: 9/28/2009 Eq: 231932            

i: 2197 Date: 9/29/2009 Eq: 234587            

Reply via email to