Exponential moving average

TeeChart for ActiveX, COM and ASP
Post Reply
dcurrier
Newbie
Newbie
Posts: 32
Joined: Thu Jul 15, 2004 4:00 am

Exponential moving average

Post by dcurrier » Fri Nov 05, 2004 2:51 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Nov 05, 2004 3:57 pm

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

dcurrier
Newbie
Newbie
Posts: 32
Joined: Thu Jul 15, 2004 4:00 am

Post by dcurrier » Fri Nov 05, 2004 7:37 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 09, 2004 9:09 am

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

dcurrier
Newbie
Newbie
Posts: 32
Joined: Thu Jul 15, 2004 4:00 am

Post by dcurrier » Thu Nov 11, 2004 9:51 pm

Pep,

The tfMovavg works ok here too.

The tfExpavg is the one giving me trouble.

Thanks for the explanation on the CheckDataSource method.

David

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Nov 12, 2004 9:24 am

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 ?

dcurrier
Newbie
Newbie
Posts: 32
Joined: Thu Jul 15, 2004 4:00 am

Post by dcurrier » Fri Nov 12, 2004 1:00 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Sun Nov 21, 2004 10:55 pm

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 ?

Post Reply