I have used this exact code on a 1 hour chart for GBPEUR using an esignal feed.

The values for the various EMA period tend to change during the first 3 seconds are so when starting the commentary are selecting a a bar on the chart.

Within approx. 3 secs the commentary output  transit from....

(correct values)
----------------
Daily EMA
  1.255
4 Hourly EMA
   1.256
Hourly EMA
   1.255
-------------------


to...

---------------
Daily EMA
   1.254
4 Hourly EMA
   1.254
Hourly EMA
   1.254
----------------------


to.......

----------------
Daily EMA
  1.454
4 Hourly EMA
   1.454
Hourly EMA
   1.454




This appears to be related the chart update frequency...



Any ideas?



On 15 Jul 2008, at 19:11, Barry Scarborough wrote:

TimeFrameSet(inDaily);
LongTermEMA = EMA(Close, 10);
TimeFrameRestore();
WriteIf(1,"Daily EMA","");
WriteVal(TimeFrameExpand(LongTermEMA, inDaily));

TimeFrameSet(inHourly * 4);
MediumTermEMA = EMA(Close, 10);
TimeFrameRestore();
WriteIf(1,"4 Hourly EMA","");
WriteVal(TimeFrameExpand(MediumTermEMA, inHourly * 4));

ShortTermEMA = EMA(Close, 10);
WriteIf(1,"Hourly EMA","");
WriteVal(ShortTermEMA);

Reply via email to