StockFetcher Forums · Filter Exchange · VTI EMA(150) - 4%<< 1 2 >>Post Follow-up
glgene
534 posts
msg #93373
Ignore glgene
6/1/2010 10:06:02 PM

Need a little help to accomplish this calculation:

Symlist is VTI
Draw calculation of VTI EMA(150) -4%

For example, in looking at Stockcharts.com, I get this (end of day, June 1)

a) VTI ending price = $54.93
b) VTI EMA(150) = $56.66

a/b = 54.93/56.66 = .9694

A sell is when it dips to .9600 or lower (4% less than the 150-day EMA of VTI)

A rebuy would be when it goes back to 1.04 or higher.

Is there a way of showing the buy and sell dates over the past 1 year and calculated fields?


Zack

For what it's worth, I tried several filters (-1%, -2%, -3%, -4%, -5%, -6%) and it seems VTI EMA(150) - 4% produces the best results with fewest whipsaws. I use VTI (Vanguard Total Market) as an overall market barometer.







glgene
534 posts
msg #93375
Ignore glgene
6/1/2010 10:17:27 PM

Here is what I tried, and got zip. Please don't snicker too much at my 'rough' scripting:

symlist(vti)
set a (close)
set b(ema(150))
set c(a/b)
draw c

Help!

Zack

four
3,995 posts
msg #93377
Ignore four
modified
6/1/2010 11:27:47 PM

Fetcher[


symlist(vti,spy)

draw ema(150)
set{v1, ema(150)}
set{v2, cma(close,1)}
set{v3, ema(1) / ema(150)}
draw v3 line at .96
draw v3 line at 1.04
draw v3

set{A, count(v3 crossed above 1.04,1)}
set{B, count(v3 crossed below .96,1)}
draw a
draw b

draw v2 on plot v1
add column v3
add column ema(150)
chart-length is 1 year

]



glgene
534 posts
msg #93379
Ignore glgene
6/1/2010 11:50:46 PM

Four, Many thanks for your prompt response. You make it look so easy! YOU know SF scripting.

A couple of follow-up questions (relative to end-of-day June 1)

1) Wonder why Stockcharts.com shows VTI 150-day EMA as $56.66, and SF shows it as $56.88. It must be the lookback period. But whether I use 3 mos., 6 mos. or 1 year, the Stockcharts.com figure is still $56.66. What is the default lookback period in SF?

2) Can SF show the VTI line as 0.9657 instead of 0.97? I need 4 decimal places. Can that be scripted?

Zack



glgene
534 posts
msg #93380
Ignore glgene
6/2/2010 12:01:16 AM

Four,

Not sure what this line means:

set{v2, cma(close,1)}

Zack

four
3,995 posts
msg #93382
Ignore four
modified
6/2/2010 12:34:10 AM

I'm in italic

--


glgene
- Ignore glgene 6/1/2010 11:50:46 PM

Four, Many thanks for your prompt response. You make it look so easy! YOU know SF scripting.

A couple of follow-up questions (relative to end-of-day June 1)

1) Wonder why Stockcharts.com shows VTI 150-day EMA as $56.66, and SF shows it as $56.88. It must be the lookback period. But whether I use 3 mos., 6 mos. or 1 year, the Stockcharts.com figure is still $56.66. What is the default lookback period in SF?

Unknown... however, "There is a limit of 100 days for accumulating the counts."

http://support.stockcharts.com/entries/20489-how-much-data-is-in-your-scan-engine
Our Scan Engine (Stockcharts)contains 800 daily data points for each of the 30,000+ different stocks, indices, and mutual funds that we track. This is enough data for an accurate 200-day EMA to be calculated. Scans that require longer duration indicators will lose accuracy.


2) Can SF show the VTI line as 0.9657 instead of 0.97? I need 4 decimal places. Can that be scripted?
I never considered 4 decimal places
Zack




glgene
- Ignore glgene 6/2/2010 12:01:16 AM

Four,

Not sure what this line means:

set{v2, cma(close,1)}
Used for plotting... but not precise

Zack



Curious... why 4 decimal places? This isn't a day trade. Explore, http://backtestingblog.com/tag/curve-fitting/


glgene
534 posts
msg #93388
Ignore glgene
6/2/2010 8:47:07 AM

Four,

Need 4 decimal places for this reason.

The 'sell' signal is when it reaches .9600. Thus, with only 2 decimal places, a .9635 would show as .96. That, in rounded terms, would fit the 'sell' signal, even though it's still shy. Showing it as .9635 would easily show the 'sell' signal even though it had not yet been reached.

That said, can SF show decimal places beyond 2? Can it show 4 (e.g., .9635?

Again, many thanks for your help.

Zack

four
3,995 posts
msg #93455
Ignore four
6/3/2010 1:23:11 PM

From: stockfetcher


Thank you for the feedback. StockFetcher currently does not support this
feature.


--

> Can Stockfetcher show decimal places beyond 2?
>
> Can it show 4 decimal places(e.g., .9635)?

traderseb
36 posts
msg #93484
Ignore traderseb
6/4/2010 6:11:55 AM

Multiply by 100.......this will give you the significant digits that you seek. HTH

symlist(vti,spy)

draw ema(150)
set{v1, ema(150)}
set{v2, cma(close,1)}
set{v3a, ema(1) / ema(150)} <------------ changed V3 to V3a as an intermediate step
set{v3, V3a * 100} <--------------- recalcs V3 at 100x
draw v3 line at 96 <------------ reset line object at 100x
draw v3 line at 104 <------------ reset line object at 100x
draw v3

set{A, count(v3 crossed above 104,1)} <------------ reset crossover targets at 100x
set{B, count(v3 crossed below 96,1)} <------------- reset crossover targets at 100x
draw a
draw b

draw v2 on plot v1
add column v3
add column ema(150)
chart-length is 1 year


four
3,995 posts
msg #93495
Ignore four
6/4/2010 10:35:27 AM

click...

Fetcher[
symlist(vti,spy)

draw ema(150)
set{v1, ema(150)}
set{v2, cma(close,1)}
set{v3a, ema(1) / ema(150)} <------------ changed V3 to V3a as an intermediate step
set{v3, V3a * 100} <--------------- recalcs V3 at 100x
draw v3 line at 96 <------------ reset line object at 100x
draw v3 line at 104 <------------ reset line object at 100x
draw v3

set{A, count(v3 crossed above 104,1)} <------------ reset crossover targets at 100x
set{B, count(v3 crossed below 96,1)} <------------- reset crossover targets at 100x
draw a
draw b

draw v2 on plot v1
add column v3
add column ema(150)
chart-length is 1 year
]



StockFetcher Forums · Filter Exchange · VTI EMA(150) - 4%<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus