With the following code I am trying to calculate monthly
change in closing price using TimeFrameGetPrice function. Variable mc is
calculated correctly. However, mcChg gives wrong answer. Would you please point
out what I am doing wrong? TIA
dt=DateTime();
//pull monthly closing
price
mc = TimeFrameGetPrice("C", inMonthly, 0,expandPoint);
//Calculate monthly %
Change
mcChg = ROC( mc,-1);
//iterate thru all bar
to verify results
for( i = 0 ; i < BarCount; i++ )
{
_TRACE("i: " + i + " Date: " + NumToStr( dt[i], formatDateTime ) + " mc: " + mc[i] + " mcChg: " + mcChg[i]);
}
