StockFetcher Forums · Filter Exchange · "Death Cross" help neeed<< 1 2 >>Post Follow-up
glgene
616 posts
msg #95754
Ignore glgene
8/20/2010 2:07:23 AM

The "Death Cross" is when the 50-day moving average crosses below the 200-day moving average of a major index. I'm not sure if that typically applies to the major barometer Dow 30 or SP 500 index.

Anyway, in a newsletter I read tonight, its "Death Cross" favors the Exponential Moving Average (vs. the Simple Moving Average). It also favors the Dow 30. Here is a script I wrote that calculates both the Simple MA and Exponential of the Dow, SP 500, QQQQ, and VTI (I use DIA for the Dow, and SPY for SP 500):

Fetcher[
symlist(dia,spy,qqqq,vti)
add column separator
add column ma(50)
add column ma(200)
set{g,ma(50)/ma(200)}
add column g{SMA-cross}
add column separator
add column ema(50)
add column ema(200)
set{k,ema(50)/ema(200)}
add column k{ema-cross}
]


I would like to have the SMA-cross and EMA-cross columns to include 3 places to the right of the decimal, In other words (e.g.,) DIA on 8/19/10 would show as 1.011....not 1.01 as it now shows. I have my reasons.

The newsletter says, in essence, if the Dow 30 EMA "Death Cross" occurs......it will be the last nail in the bearish coffin.

According to the above script, here are 8/19/10 results of the EMA crossovers:

SPY, 1.00
QQQQ, 1.02
DIA, 1.01
VTI, 1.00

I would like to change the script so I can get the results to show 3 places to the right of the decimal point, using SF's new "rounded" feature, or alternate way (preferably using the "rounded" feature). Can someone help? Thanks.

mystiq
650 posts
msg #95755
Ignore mystiq
8/20/2010 3:24:01 AM

..just a suggestion: try using EMA(50) crossing SMA(200)..

glgene
616 posts
msg #95757
Ignore glgene
8/20/2010 8:52:39 AM

Mystiq,

Your idea may be right on target.

I was just following the newsletter writer's pick on using the Dow 50-day (EMA) cross below the Dow 200-day(EMA) figure. Still trying to figure out how to get 3 places to the right of the decimal figure. Anybody with an idea how to do this (preferably using SF's 'rounded' feature, if that's possible)?

Thanks, again!

In the meantime, mystiq, why do you suggest using the EMA for the 50-day and SMA on 200-day figure?

four
5,087 posts
msg #95758
Ignore four
modified
8/20/2010 12:03:00 PM

See, http://forums.stockfetcher.com/sfforums/?q=view&fid=1002&tid=93373&qrid=&isiframe=

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

mystiq
650 posts
msg #95763
Ignore mystiq
8/21/2010 2:25:31 AM

In the meantime, mystiq, why do you suggest using the EMA for the 50-day and SMA on 200-day figure?
EMA represent the fast line and SMA the slow line. For spotting early moves AND ...less false moves.

glgene
616 posts
msg #95768
Ignore glgene
8/21/2010 8:51:33 PM

mystiq,

I said, "In the meantime, mystiq, why do you suggest using the EMA for the 50-day and SMA on 200-day figure?

You replied: "EMA represents the fast line and SMA the slow line. For spotting early moves AND ...less false moves."

----------------------------------------------------------

I can certainly see your first point at times (early moves), but can you elaborate on your second point (less false moves)? Not sure why the latter would be true. Please...share your thoughts. I'm always open to constructive input!

As you know, dividing EMA(50) by MA(200) is easily doable.

For actual numbers, at end-of-day on Friday, Aug. 20, here are comparative numbers on the ETF, SPY (SP 500):

Less than 1.00 (i.e., .99 or lower) would represent the so-called "Death Cross" has taken place:

MA(50) / MA(200) = 109.11 / 111.88 = .9752 (rounded .98)

EMA(50) / MA(200) = 109.88 / 111.88 = .9821 (rounded .98)

EMA(50) / EMA(200) = 109.88 / 109.76 = 1.0011 (rounded 1.00)

Note: I prefer the non-rounded number for more precision. That is fixable, thanks to the suggestion earlier!

The article I read 2 days ago, said the writer preferred using strictly the EMA crossover. Don't know if that is just his opinion, or conventional wisdom. I had always thought the Death Cross was based on the crossover of the Simple Moving Average (MA). But maybe the hybrid of EMA(50) / MA(200) makes the most sense. Anyway, from the numbers above, we're "dying" on the first two numbers, and just hanging by a thread on the strictly EMA (the third one) crossover. At least with SPY.

Additional comments from anyone?

glgene
616 posts
msg #95772
Ignore glgene
8/22/2010 12:29:02 AM

Here is the update I made to my original script. I changed the % column to effectively get a 4-figure to the right of the decimal (thanks to the suggestion), by multiplying by 100. Thus, instead of the previous answer showing (e.g.,) .98, it now shows as 97.52. In other words, 97.52%. That would be the same as .9752 that I originally sought. I also added these columns: WMA(30), RSI(14) and MACD(12,26). Does anyone have any other suggestions for indicators to include?

Fetcher[
symlist(dia,spy,qqqq,vti)
add column separator
add column wma(30)
add column rsi(14)
add column macd(12,26,9)
add column cci(20)
add column separator
add column ma(50)
add column ma(200)
set{g,ma(50)/ma(200)}
set{g1,g*100}
add column g1{SMA-x%}
add column separator
add column ema(50)
add column ema(200)
set{k,ema(50)/ema(200)}
set{k1,k*100}
add column k1{ema-x%}
add column separator
]



mystiq
650 posts
msg #95785
Ignore mystiq
8/23/2010 12:59:05 AM

update I made to my original script. I changed the % column to effectively get a 4-figure to the right of the decimal (thanks to the suggestion), by multiplying by 100. Thus, instead of the previous answer showing (e.g.,) .98, it now shows as 97.52. In other words, 97.52%. That would be the same as .9752 that I originally sought. I also added these columns: WMA(30), RSI(14) and MACD(12,26).

Does anyone have any other suggestions for indicators to include?

try using IFT() - because 50ma could be just using 200ma for support and could bounce or represent a false breakdown.
IFT() would confirm whether a new trend is starting or continued falling. I suggested ema/sma only because I adapted
the combination from ema2/sma3 to signify a new trend might start/end. Less false moves because 200sma will not
whipsaw or move as fast as 200ema.

glgene
616 posts
msg #95788
Ignore glgene
8/23/2010 9:13:06 AM

Mystiq,

You said I should try using IFT(). Now that's a new one to me. So I had to look it up in the SF Manual, page 64.

I feel like a kindergartner hanging out with 3rd graders in school. I haven't even passed SF 101, and you want me to jump to SF 301....? Just kidding, of course. I certainly admire you and others for your scripting expertise.

That said, om page 64, SF uses the example of IFT(5,9). First number is the RSI days, the second number is the weighted MA days [not EMA].

5,9 seem short, considering I'm using your suggested script line in conjunction with 50-day and 200-day numbers for the so-called Death Cross. In light of what I just said, would you still use IFT(5,9) or other numbers?

Zack

mystiq
650 posts
msg #95812
Ignore mystiq
8/24/2010 8:16:10 AM

try weekly IFT(2,9)....

StockFetcher Forums · Filter Exchange · "Death Cross" help neeed<< 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 2022 - 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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.