StockFetcher Forums · Filter Exchange · TRADING DIVERGENCES ON THE S&P 500<< 1 ... 19 20 21 22 23 ... 33 >>Post Follow-up
Kevin_in_GA
4,553 posts
msg #112515
Ignore Kevin_in_GA
3/29/2013 4:17:40 PM

No - like this:

Fetcher[

/*CODING FOR DIVERGENCE BETWEEN MA(3) AND THE STOCHASTIC MOMENTUM
INDICATOR*/
SYMLIST(SPY)
SET{SMI11down, COUNT(ind(^spx, SMI(3,6,6)) below ind(^spx, SMI(3,6,6)) 11 days ago,1)}
SET{SMI11down7, COUNT(ind(^spx, SMI(3,6,6)) DROPPED MORE THAN 7% OVER THE LAST 11 DAYS,1)}

SET{MA3UP2, COUNT(ind(^spx, MA(3)) above ind(^spx, MA(3)) 11 days ago,1)}
SET{MA3UP2_7, COUNT(ind(^spx, MA(3)) gained MORE THAN 7% OVER THE LAST 11 DAYS,1)}

SET{DIV1B, SMI11down * MA3UP2}
SET{DIV2B, SMI11DOWN7 + MA3UP2_7}
SET{DIV3B, COUNT(DIV2B ABOVE 0.5,1)}
SET{SMI11DIV, DIV1B*DIV3B}

ADD COLUMN SMI11DIV

DRAW SMI11DIV

set{exit1, count(ind(^spx, close) reached a new 10 day high,1)}
set{exit2, count(ind(^spx, ROC(15,1)) is below ind(^spx, ROC(15,1)) 10 day high,1)}
set{exit, exit1 * exit2}

ADD COLUMN EXIT

draw exit
]



jackmack
334 posts
msg #112517
Ignore jackmack
3/29/2013 5:09:59 PM

Dude
You rock
Thank you
Happy Easter
Cheers

jackmack
334 posts
msg #112564
Ignore jackmack
4/1/2013 4:20:36 PM

Not sure why this isn't working
I have tried it several ways and still cannot find what is causing it to flame out.
What am I not doing right?
It has to be 1 item out of place but I swear I cannot find it - sigh.

/*CODING FOR DIVERGENCE BETWEEN MA(3) AND THE Q-STICK INDICATOR*/
SYMLIST(SPY)
SET{QST12down, COUNT(ind(^spx, QSTICK(12)) below ind(^spx, QST(12)) 12 days ago,1)}
SET{QST12down2, COUNTind(^spx,(QSTICK(12)) DROPPED MORE THAN 2% OVER THE LAST 12 DAYS,1)}

SET{MA3UP7, COUNT(ind(^spx,MA(3)) above ind(^spx,MA(3)) 12 days ago,1)}
SET{MA3UP7_1, COUNT(ind(^spx,(MA(3)) gained MORE THAN 2% OVER THE LAST 12 DAYS,1)}

SET{DIV1G, QST12down * MA3UP7}
SET{DIV2G, QST12DOWN2 + MA3UP7_1}
SET{DIV3G, COUNT(DIV2G ABOVE 0.5,1)}
SET{QST12DIV, DIV1G * DIV3G}

ADD COLUMN QST12DIV

DRAW QST12DIV

set{exit1, count(ind(^spx,close) reached a new 10 day high,1)}
set{exit2, count(ind(^spx,(ROC(15,1)) is below ind(^spx,ROC(15,1)) 10 day high,1)}
set{exit, exit1 * exit2}

ADD COLUMN EXIT

draw exit


Kevin_in_GA
4,553 posts
msg #112570
Ignore Kevin_in_GA
4/1/2013 5:05:55 PM

/*CODING FOR DIVERGENCE BETWEEN MA(3) AND THE Q-STICK INDICATOR*/
SYMLIST(SPY)
SET{QST12down, COUNT(ind(^spx, QSTICK(12)) below ind(^spx, QST(12)) 12 days ago,1)}
SET{QST12down2, COUNTind(^spx,(QSTICK(12)) DROPPED MORE THAN 2% OVER THE LAST 12 DAYS,1)}

Clue - it is somewhere in here.

mahkoh
894 posts
msg #112572
Ignore mahkoh
modified
4/1/2013 6:13:27 PM

C'mon, don't leave him hanging. I know from personal experience that there are few things as frustrating as a filter not working because of a misplaced } or ).



Kevin_in_GA
4,553 posts
msg #112575
Ignore Kevin_in_GA
4/1/2013 7:40:45 PM

Enlightenment cannot be given.

frsrblch
35 posts
msg #112578
Ignore frsrblch
4/1/2013 10:49:24 PM

Zen and the Art of Stock Fetcher

In other news, the spreadsheet is done. Data is pasted into the 'Data' tab, with the left column being the asset to be traded, and the right column being the asset used to determine entries and exits. As a default, these are SPY and the S&P500, respectively, but you can change these as you see fit, provided you make sure the dates line up across both columns. The sheet can handle up to 2500 days of data, beyond which you'll have to add more lines of formulas to each of the filters.

The 'Control' tab shows some limited statistics for each system, including annual return for the period backtested. I have included an option to limit the number of days a stock is held for in each system, but most of these systems react poorly to these exits.

The spreadsheet is designed to buy when the entry signal is 1 and the exit signal is 0, and sell when the entry signal is 0 and the exit signal is 1. Please feel free to check my calculations, and let me know if you find any errors.

If nothing else, this spreadsheet has shown me the importance of using ^SPX data rather than SPY data when it comes to choosing entries and exits. Most systems grossly under-perform if you use SPY data for choosing entries and exits. The poor results I have had backtesting most of Kevin's Top 10 in SF are likely the result of this. The data in the spreadsheet runs from Jan 1, 2006 through to today, and it's worth noting that these systems plowed through 2008 with barely a hiccup.

https://docs.google.com/file/d/0B0rUWi0Alg22ZnlWNEU1TkNGbDg/edit?usp=sharing

mahkoh
894 posts
msg #112586
Ignore mahkoh
4/2/2013 10:38:54 AM

Great work, thanks for sharing. Do you have any idea as to why ^SPX would give better results than SPY besides the latter going ex-dividend every now and then?

Kevin_in_GA
4,553 posts
msg #112588
Ignore Kevin_in_GA
4/2/2013 10:42:39 AM

Because that was the data upon which the systems were designed.

radiobb2
10 posts
msg #112591
Ignore radiobb2
4/2/2013 1:03:16 PM

Maybe another dumb question. If ^SPX is better than SPY, then is there a way to program that into the StockFetcher formula?

StockFetcher Forums · Filter Exchange · TRADING DIVERGENCES ON THE S&P 500<< 1 ... 19 20 21 22 23 ... 33 >>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