Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/4/2005 Posts: 40
|
Hi guys, First, I'd like to compliment you on the fine presentations at Trader Expo in Chicago.
Now a question: In looking at the chart for GOOG, I noticed something that doesn't make sense. I have GOOG set up with a bunch of indicator, one of which is a 5 EMA. Starting with Aug 19, 2004, the dat of the IPO, I show the following close values and moving average calculation 08/19/2004 close_______________:100.33 08/20/2004 close_______________:108.31 08/23/2004 close_______________:109.40 08/24/2004 close_______________:104.87 08/25/2004 close_______________:106.00 Sum____________________________:528.91 Average, 528.91/5 :105.78
However, TC-Net shows 0.00 as a value for 8/25 - which is bogus, and 106.21 for a MA on 8/26. So, Where's the value for 8/25?
Also, since it's an exponential MA, the value for 8/26 should be ((107.91-105.78) * 2/6 )+ 105.78 = 106.49, which TC-Net calculates as 106.21. I'm using Wilder's formula for EMA from his book, "New Concepts in Technical Trading Systems", which is: EMA(current) = ( (Price(current) - EMA(prev) ) x Multiplier) + EMA(prev)
Where multiplier is: 2 / (1 + N) where N is the specified number of periods.
G
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
It looks like the EMA is being calculated on the previous 5 days, so 8/26 is the first day where there are 5 previous days. I checked with KKD, and the same phenomenon appears when it IPO'd back on April 5, 2000. I will forward this on to the appropriate people to confirm that this is by design, and if so, why the EMA starts on day 6 instead of day 5. I will also check on the EMA calculation to confirm the result for GOOG on 8/26/04.
- Doug Teaching Online!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
TeleChart currently does not start displaying the values of Exponential Moving Averages until it has at least the EMA Period plus one bars of data to use for the caluculation (Personal Criteria Formulas require 5 times the EMA Period bars of data).
You are seeding your EMA formula with the 5-Period Simple Moving Average of Price (105.78) being used as the previous EMA on the sixth bar. TeleChart is seeding its formula with the first available Price (100.33) being used as the previous EMA on the second bar.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/4/2005 Posts: 40
|
Doug, Bruce, I recomputed the 5 EMA and got 106.20 versus TC-Net's 106.21. The missing penny is probably a rounding error on my part as I calculated it by hand.
But when I specify a simple moving average, I would expect a value of 105.78 (528.91/5) for day 6, i.e., 8/26. However, TC-Net gives a 107.30. So why the difference?
G
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Here's what I get when running the calculations by hand:
(108.31 + 109.40 + 104.87 + 106.00 + 107.91) / 5 = 536.49 / 5 = 107.298
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/4/2005 Posts: 40
|
You dropped off the first term. The 6th day MA is the average of the first 5 periods. I get: (100.33 + 108.31 + 109.40 + 104.87 + 106.00)/5=528.91/5=105.78
G
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The sixth day 5-Period Simple Moving Average is five days long and includes the sixth day. While it doesn't show on the chart, the 5-Period Simple Moving Average would be five days long and include the fifth day.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/4/2005 Posts: 40
|
So the sixth day MA is the sum of the previous 5 days divided by the period. It cannot include the sixth day because the close is not yet finalized. Thus I do not understand why the sixth day MA is computed on days 2,3,4,5,6. What happens to day 1?
I'm developing a ATS based on IB's API and using TC-Net to check my buy and sell signals. I'm getting data inconsistencies so I need to nail this down. Thanks for the help. G
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No. The 5-Period Simple Moving Average taken on the sixth day is the sum of the most recent 5 days, including the current day (day 6), divided by the period:
Current 5-Period SMA: AVGC5
Previous bar's 5-Period SMA: AVGC5.1
It seems like you want the second formula. It can be created as a Custom Indicator:
Select Chart Template | Add Indicator | Indicator. -Visible: Checked -Center Zero Line: Unchecked -Plot using price scale: Checked -Smoothing Average: 1 -Indicator Formula:
AVGC5.1
You can also create it as a Personal Criteria Formula. You may wish to review the following video and forum topic:
How to create a Personal Criteria Forumula (PCF) Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/4/2005 Posts: 40
|
So let me finally nail this down. The simple MA for day 6 includes days 2,3,4,5,6 and is 107.30 The simple MA for day 5 includes days 1,2,3,4,5 and is 105.78, but is not displayed.
Please confirm.
G
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Exactly.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |