logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
TrendChange  
#1 Posted : Friday, May 20, 2005 3:21:08 AM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

I want to program a smoothing constant called a % trend on price data. The formula is; 20 % trend = (.20*today's price close)+(0.80*yesterday's % trend value) Thanks!!!
wabbit  
#2 Posted : Friday, May 20, 2005 5:57:57 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
What you are really trying to program here is an exponential moving average. Have a look in your MS user manual for the moving averages under the Interpretation of Indicators and Line Studies, towards the back of the book. If you really want to program this function that is already built in, may I suggest you have a look at Jose Silva's excellent site at http://www.metastocktools.com/#metastock Hope this helps. wabbit :D
TrendChange  
#3 Posted : Friday, May 20, 2005 1:58:36 PM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

Wabbit, It is like a moving average but the results are different. I put the % trend, simple and EMA and the results were different for all three. I am afraid I am going to have to calculate this for an indicator that I am building. It is more like a smoothing constant if that helps. TC
wabbit  
#4 Posted : Saturday, May 21, 2005 2:40:15 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
How were you comparing the values of the %trend, SMA and EMA? There shouldn't be any difference between your %trend indicator and the EMA if the EMA periods are computed thus: For the 20%trend, pct=0.2 Periods = (2 / pct) - 1 = (2 / 0.2) -1 = 10 - 1 = 9 day EMA There should not be any differences between your 20%trend indicator and the 9 day EMA. Any differences between the 20%trend indicator and the 9 day EMA will (probably) be caused by the number of bars used in the calculation. The EMA will have 'remnants' of the very first bar in the chart, whereas your indicator might have a different seed? (Maybe Patrick or Jose might be able to provide a more precise answer here, but this is what I believe the problem might be!) If you compare the values for a chart with a lot of history (loaded) any differences will be minute. Hope this helps. wabbit :D P.S. I also question the validity of any system that is soooo sensitive to such minor differences. You might like to have a look again at the logic of your system; do a simple SWOT analysis (strengths, weaknesses, opportunities and threats) and I think you will find the sensitivity is a major threat to your analysis.
Patrick  
#5 Posted : Saturday, May 21, 2005 5:41:45 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
That one is for Jose oz_pdt_01; I can't explain Math, but I agree with Wabbit. Patrick :D
wabbit  
#6 Posted : Saturday, May 21, 2005 7:33:56 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
OK I will try to explain the seeding concept, by example. Lets say we program the %trend indicator as: (0.2*CLOSE)+(0.8*PREV) and compare this against the 9 day EMA. Starting with the very first bar for BHP:
Date Close %trend Moving Average
02 01 87 2.6884 
05 01 87 2.7408 0.9783 
06 01 87 2.7757 1.3378 
07 01 87 2.7975 1.6297 
08 01 87 2.7757 1.8589 
09 01 87 2.7888 2.0449 
12 01 87 2.8411 2.2041 
13 01 87 2.8237 2.328 
14 01 87 2.732 2.4088 2.7697
15 01 87 2.7626 2.4796 2.7682
16 01 87 2.7626 2.5362 2.7671
You can see that the %trend indicator is not defined on the first day as the PREV value is undefined on bar 1. On bar 2, when PREV is defined, the %trend indicator is also defined, BUT the EMA is not defined until the 9th bar. In the very short term, at the very beginning of a chart there will be differences between the indicators, sometimes called seeding discrepancies. These discrepancies, in many instances such as this one, become insignificant. [An example of when a seeding discrepancy may be significant might be if we were to look at a modified OBV; if the 'proper' OBV began with a value of zero on day 1 and a modified OBV bagan with a value of, say, 100000 on day 1, then this seeded discrepancy would be significant for the entire duration of the chart.] The values for these indicators at the end of the chart are:
Date Close %trend Moving Average
10 05 05 16.7 16.5916 16.5916
11 05 05 16.43 16.5593 16.5593
12 05 05 16.29 16.5055 16.5054
13 05 05 15.95 16.3944 16.3944
16 05 05 15.55 16.2255 16.2255
17 05 05 15.71 16.1224 16.1224
18 05 05 15.93 16.0839 16.0839
19 05 05 16.2 16.1071 16.1071
20 05 05 15.88 16.0617 16.0617
You can see that over a long period, some 4600 bars in this case, the differences between the %trend and the 9 day EMA are not significant (at 4 decimal places!) Hope this goes some way to explain what seeding means. wabbit :D
wabbit  
#7 Posted : Saturday, May 21, 2005 7:41:20 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
btw.... the difference between the %trend and the 9 day EMA becomes insignificant (0.0000) after 56 bars! wabbit :D
wabbit  
#8 Posted : Saturday, May 21, 2005 7:50:20 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
..and for my first attempt to attach an image.... failed
TrendChange  
#9 Posted : Saturday, May 21, 2005 8:51:45 PM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

Yup you are right Wabbit! Thanks for points that out to me..... IF you want to post an image try down loading to this site and posting the link. Thanks again! http://www.ttrader.com/mycharts/ TC
Users browsing this topic
Guest (Hidden)
Similar Topics
February 2024: Trend Identification by Price and Time Filtering (2024)
by MS Support 4/11/2024 7:59:18 PM(UTC)
Fulgent Coral Trend Trader - Product Update - January 24th, 2023 (MetaStock Product Updates)
by MS Support 1/24/2023 7:32:45 PM(UTC)
May 2020: Correlation as a Trend Indicator (2020)
by MS Support 6/15/2022 4:21:22 PM(UTC)
October 2016: Which Trend Indicator Wins (2016)
by MS Support 7/28/2017 10:13:26 PM(UTC)
Where is the Manual for Dr. Stoxx's Trend Trading Toolkit Add-on Installed? (MetaStock Add-Ons)
by MS Support 5/9/2017 2:56:12 PM(UTC)
What versions of MetaStock will Dr. Stoxx's Trend Trading Toolkit Add-on work with? (MetaStock Add-Ons)
by MS Support 5/9/2017 2:54:43 PM(UTC)
What is installed with the Dr. Stoxx's Trend Trading Toolkit Add-on? (MetaStock Add-Ons)
by MS Support 5/9/2017 2:53:53 PM(UTC)
How much data is needed to run Dr. Stoxx's Trend Trading Toolkit exploration? (MetaStock Add-Ons)
by MS Support 5/9/2017 2:48:22 PM(UTC)
Where is the Manual for the Teach Talk Trade's Trend Momentum Toolkit Add-on Installed? (MetaStock Add-Ons)
by MS Support 5/8/2017 10:36:11 PM(UTC)
What versions of MetaStock will the Teach Talk Trade's Trend Momentum Toolkit Add-on work with? (MetaStock Add-Ons)
by MS Support 5/8/2017 10:35:06 PM(UTC)
What is installed with the Teach Talk Trade's Trend Momentum Toolkit Add-on? (MetaStock Add-Ons)
by MS Support 5/8/2017 10:33:59 PM(UTC)
How much data is needed to run the Teach Talk Trade's Trend Momentum Toolkit exploration? (MetaStock Add-Ons)
by MS Support 5/8/2017 10:31:22 PM(UTC)
Make a Trend Line between two Points (Formula Assistance)
by homano 3/25/2017 5:38:20 AM(UTC)
Zigzag Trend Indicator (Formula Assistance)
by jigshir 9/24/2016 11:07:34 AM(UTC)
Adaptive Cycle Toolkit (ACT), Trend Quality Indicator (TQI) formula (Plugins & Addons)
by jacquesj 4/27/2016 7:56:07 PM(UTC)
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.