I am getting unexpected results using WriteVal and numtostr when displaying data in the interpretation window. I just noticed that when I place the cursor on a bar, not the current bar, and watch the values in the interpretation window they will reflect the values of the bar with the cursor until a new value comes into the current bar fro, the data feed. I had not expected the values to change. I had to turn the data feed off for the values in the selected bar to remain unchanged.
Then I noticed something else. If I change the parameters the values on the selected bar, say close to MA delta, should change but the values in the interpretation window did not change until I repositioned the cursor on it. I changed from writeval to numtostr and the results remained the same. Then I plotted the values on the chart and they do change but the data in the interpretation window does not change with it. I don't understand why not. I am using the same vars to display both sets or data. That may explain what you are seeing. Turn your data feed off and see what happens. Most of the time that is fine since I am watching what is going on when auto trading. But when I am working on a formula I don't want the data in the interpretation window to change when the data feed changes the current bar. Barry --- In [email protected], Chris Grafham <[EMAIL PROTECTED]> wrote: > > > > 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); >
