Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Weighted Moving Average in TeleChart Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
halliday
Posted : Monday, September 25, 2006 10:29:35 AM
Registered User
Joined: 12/31/2004
Posts: 163
Hi Bruce or Craig,

TeleCharts only has a Simple and an Exponential Moving Averages.

How do I add a Weighted Moving Average?

Bill
Bruce_L
Posted : Monday, September 25, 2006 10:59:32 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
It depends on the period.

2-Period WMA:

(2 * C + C1) / 3

3-Period WMA:

(3 * C + 2 * C1 + C2) / 6

4-Period WMA:

(4 * C + 3 * C1 + 2 * C2 + C3) / 10

Start by multiplying the current value by the period and subtract 1 from each of the coefficients as you go back. Then divide the result by the sum of the coefficients. If you create it using a Custom Indicator, make sure to select Plot using price scale.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
halliday
Posted : Monday, September 25, 2006 12:02:21 PM
Registered User
Joined: 12/31/2004
Posts: 163
O.K. Bruce,

If I want a front weighted moving average, I just reverse the weighting from the current price being the highest weight to the earliest price being the highest weight, right?

Bill
Craig_S
Posted : Monday, September 25, 2006 12:09:24 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
No, he gave you the front weighted. Front weighted means the most recent price has more weight.

- Craig
Here to Help!
halliday
Posted : Tuesday, September 26, 2006 11:24:06 AM
Registered User
Joined: 12/31/2004
Posts: 163
Oh!

Thanks Craig.

I decided to program a front weighted average and a reverse front weighted average (or is it Non-Front weighted or is it just weighted?), just to see the difference in the plot.

While doing so, I observed something interesting.

This calculation:

(15 * C14 + 14 * C13 + 13 * C12 + 12 * C11 + 11 * C 10 + 10 * C9 + 9 * C8 + 8 * C7 + 7 * C6 + 6 * C5 + 5 * C4 + 4 * C3 + 3 * C2 + 2 * C1 + C)

And this calculation:

(15 * C14 + 14 * C13 + 13 * C12 + 12 * C11 + 11 * C 10 + 10 * C9 + 9 * C8 + 8 * C7 + 7 * C6 + 6 * C5 + 5 * C4 + 4 * C3 + 3 * C2 + 2 * C1 + C) / 120

produce the same plot.

The difference: one is divided by 120 and the other isn't!

Is there an explanation?

I think I also noticed something else happening. I added a day's calculation then looked at the plot, then added another day, observed, etc, etc. The plot didn't seem to change much between 10 and 15 days. Is this just a spurious observation or a valid observation? The plot seemed to change more noticably when I was working on the days below 10.

Bill
Craig_S
Posted : Tuesday, September 26, 2006 11:27:28 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
They will present the same pattern and appear identical because they are both on different scales. Check the "plot using price scale" on both and you will see a HUGE difference.

- Craig
Here to Help!
halliday
Posted : Tuesday, September 26, 2006 11:42:33 AM
Registered User
Joined: 12/31/2004
Posts: 163
Stranger than fiction!
Craig_S
Posted : Tuesday, September 26, 2006 11:43:28 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
LOL

- Craig
Here to Help!
halliday
Posted : Tuesday, September 26, 2006 2:11:26 PM
Registered User
Joined: 12/31/2004
Posts: 163
O.K. Craig/Bruce,

I settled on a 50 period front weighted average. See if I typed it correctly:

((50 * C) +
(49 * C1) +
(48 * C2) +
(47 * C3) +
(46 * C4) +
(45 * C5) +
(44 * C6) +
(43 * C7) +
(42 * C8) +
(41 * C9) +
(40 * C10) +
(39 * C11) +
(38 * C12) +
(37 * C13) +
(36 * C14) +
(35 * C15) +
(34 * C16) +
(33 * C17) +
(32 * C18) +
(31 * C19) +
(30 * C20) +
(29 * C21) +
(28 * C22) +
(27 * C23) +
(26 * C24) +
(25 * C25) +
(24 * C26) +
(23 * C27) +
(22 * C28) +
(21 * C29) +
(20 * C30) +
(19 * C31) +
(18 * C32) +
(17 * C33) +
(16 * C34) +
(15 * C35) +
(14 * C36) +
(13 * C37) +
(12 * C38) +
(11 * C39) +
(10 * C40) +
(9 * C41) +
(8 * C42) +
(7 * C43) +
(6 * C44) +
(5 * C45) +
(4 * C46) +
(3 * C47) +
(2 * C48) +
(C49)) / 1275

I plotted it using the price scale and it looks real nice. It also compares nicely with the front weighted average in SnapSheets!

Bill
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.