Page 1 of 1

Exponential moving average

Posted: Fri Nov 05, 2004 2:51 pm
by 9083183
I'm using version 6.0.0.6 of the AX control with VB6.

The tfExpavg function is giving me some trouble.

I'm trying to use a 13 minute period. The result is no where near my manual calc. Am I missing a parameter or something?

With MultiChart.Series(21)
.Clear
.SetFunction tfExpavg
.DataSource = "series0"
.FunctionType.Period = 13

End With

The series0 is a candlestick series. Hopefully it is using the close values.

I'm also concerned because I need to use the Bollinger band function as well with a exponential MA set to true.

Thanks,

David

Posted: Fri Nov 05, 2004 3:57 pm
by Pep
Hi David,

have you tried to add the CheckDataSource method ?

Code: Select all

With MultiChart.Series(21)
.Clear
.SetFunction tfExpavg
.DataSource = "series0"
.FunctionType.Period = 13
.CheckDataSource
End With

Posted: Fri Nov 05, 2004 7:37 pm
by 9083183
Pep,

Not familiar with CheckDataSource method. What is is for?

Anyhow I just tried it again with CheckDataSource and the result is no different.

It must be something else. It looks like it's tracking the candle mid points. No point is outside the current candle range. A moving average will usually deviate from the candle points. This doesn't.

Thanks for getting back to me.

I guess I'll have to write my own EMA function.

David

Posted: Tue Nov 09, 2004 9:09 am
by Pep
Hi David,
Not familiar with CheckDataSource method. What is is for?
Description
The CheckDataSource method will refresh all Series point values, either from database Tables, Queries or another Series points.
You can call this method regularly if you want new or modified data to appear in realtime in the Series.
The parent Chart will be automatically repainted to reflect any changes.
Series1.CheckDataSource ;

Using the following code works fine here (with the TeeChart Pro v7) :

Code: Select all

With TChart1
    .AddSeries scCandle
    .Series(0).FillSampleValues (20)
    .AddSeries scLine
    .Series(1).SetFunction tfMovavg
    .Series(1).DataSource = "Series0"
    .Series(1).FunctionType.Period = 13
End With

Posted: Thu Nov 11, 2004 9:51 pm
by 9083183
Pep,

The tfMovavg works ok here too.

The tfExpavg is the one giving me trouble.

Thanks for the explanation on the CheckDataSource method.

David

Posted: Fri Nov 12, 2004 9:24 am
by Pep
Hi David,
The tfExpavg is the one giving me trouble.
I'm sorry, I'm not able to reproduce any problem here. I'm going to need a sample code or example with which I can see it. Could you please post it at steema.public.attachments newsgropup or send it directly to pep@steema.com ?

Posted: Fri Nov 12, 2004 1:00 pm
by 9083183
Sure.

The code in my original question was copied from the program.

With MultiChart.Series(21)
.Clear
.SetFunction tfExpavg
.DataSource = "series0"
.FunctionType.Period = 13
End With


It isn't that the function fails or gives an error, it's just that the values are not realistic. I'm not sure exactly what to show you as an example.

David

Posted: Sun Nov 21, 2004 10:55 pm
by Pep
Hi David,
It isn't that the function fails or gives an error, it's just that the values are not realistic. I'm not sure exactly what to show you as an example.
Could you please send me a Chart which would be the correct for you ? An example with which I can compare what should we get instead ?