StockFetcher Forums · General Discussion · A challenge to TomB and the Stockfetcher Crew<< 1 2 3 >>Post Follow-up
tomb
267 posts
msg #95217
Ignore tomb
7/29/2010 11:51:52 AM

We definitely aren't afraid to open the door to feature requests!

We'll be honest when a requested feature is something we are unable to implement or do not plan on implementing at this time. However, if it is something that we can implement and will help you and help the site, we are always willing to look into new features.

In fact, as requested here is a new correlation function:

Correlation (corr)

Below is an example that may help. Basically looks for stocks whose price was positively correlated to SPY over the last 100 days (starting 30 days ago) but have become negatively correlated within the last 30 days.

Fetcher[show stocks where corr(SPY,100,close) 30 days ago is above 0.50
and corr(SPY,30, close) is below -0.250
and close is above 3.00
and average volume(30) is above 250000
and add column corr(SPY,100,close) 30 days ago {long_corr}
and add column corr(SPY,30,close) {short_corr}
and compare with SPY
and chart-length is 100 days
]



This function deviates from your request in that only 1 symbol is specified. Obviously, you can focus the results using the "apply to symlist" and "apply to watchlist" features. You can also focus results to specific correlations using the "ind()" function. For example:

Fetcher[
set{myvar,IND(IBM,CORR(SPY,30,CLOSE))}
close is above 10
and add column myvar
]



The above will create a constant variable which is the correlation two specific equities.

Hope that helps!

Tom
StockFetcher.com Support


tomb
267 posts
msg #95222
Ignore tomb
7/29/2010 12:04:17 PM

Also, a quick follow-up on the original request. We have created two new functions:

SfPosDiv(ind1, ind2, period, pctChg)
SfNegDiv(ind1, ind2, period, pctChg)


Note: these functions are part of a new feature that allows for custom user defined functions. In essence these functions are based on the exact code you specified.

While we do not have a release date for opening up this feature, we are hoping to allow custom user functions in the near future. You'll also notice the legends on the charts are somewhat lengthy, we hope to fix that with future updates to the user-defined functions feature.



Examples:

Fetcher[sfPosDiv(MACD Fast Line(12,26,9), MA(3), 10,3) is above 0]



Fetcher[sfNegDiv(MACD Fast Line(12,26,9), MA(3), 10,3) is above 0]



Comparing with your original:

Fetcher[/*CODING FOR DIVERGENCES*/
SET{MACD_UP, COUNT(MACD(12,26,1) GAINED MORE THAN 3% OVER THE LAST 10 DAYS,1)}
SET{MACD_DN, COUNT(MACD(12,26,1) DROPPED MORE THAN 3% OVER THE LAST 10 DAYS,1)}

SET{MA3_UP, COUNT(MA(3) GAINED MORE THAN 3% OVER THE LAST 10 DAYS,1)}
SET{MA3_DN, COUNT(MA(3) DROPPED MORE THAN 3% OVER THE LAST 10 DAYS,1)}

SET{POS_DIV, MACD_UP * MA3_DN}
SET{NEG_DIV, MACD_DN * MA3_UP}

POS_DIV is above 0
]



Fetcher[/*CODING FOR DIVERGENCES*/
SET{MACD_UP, COUNT(MACD(12,26,1) GAINED MORE THAN 3% OVER THE LAST 10 DAYS,1)}
SET{MACD_DN, COUNT(MACD(12,26,1) DROPPED MORE THAN 3% OVER THE LAST 10 DAYS,1)}

SET{MA3_UP, COUNT(MA(3) GAINED MORE THAN 3% OVER THE LAST 10 DAYS,1)}
SET{MA3_DN, COUNT(MA(3) DROPPED MORE THAN 3% OVER THE LAST 10 DAYS,1)}

SET{POS_DIV, MACD_UP * MA3_DN}
SET{NEG_DIV, MACD_DN * MA3_UP}

NEG_DIV is above 0
]




Kevin_in_GA
4,599 posts
msg #95242
Ignore Kevin_in_GA
7/29/2010 2:52:18 PM

YOU GUYS ROCK!!

mystiq
650 posts
msg #95365
Ignore mystiq
8/4/2010 5:08:37 AM

tomb
msg #95222
- Ignore tomb 7/29/2010 12:04:17 PM

Also, a quick follow-up on the original request. We have created two new functions:

SfPosDiv(ind1, ind2, period, pctChg)
SfNegDiv(ind1, ind2, period, pctChg)


--------------------------------------------------------------------------------
Note: these functions are part of a new feature that allows for custom user defined functions. In essence these functions are based on the exact code you specified.

While we do not have a release date for opening up this feature, we are hoping to allow custom user functions in the near future. You'll also notice the legends on the charts are somewhat lengthy, we hope to fix that with future updates to the user-defined functions feature.

*****WHAT does THE pctChg represent?

mystiq
650 posts
msg #95366
Ignore mystiq
8/4/2010 5:11:39 AM

Kevin_in_GA
msg #95125
- Ignore Kevin_in_GA 7/27/2010 9:19:34 AM

Two separate functions would also work

posdiv(indicator1, indicator2, X, Y) would return a "1" if these conditions are met and a positive divergence is seen, and a 0 if they are not met.

negdiv(indicator1, indicator2, X, Y) would return a "1" if these conditions are met and a negative divergence is seen, and a 0 if they are not met.


*******what does the (....,X,Y) represent?

CarpeMomentum
8 posts
msg #95368
Ignore CarpeMomentum
8/4/2010 9:20:07 AM

You guys definitely do rock.

Kevin_in_GA
4,599 posts
msg #95381
Ignore Kevin_in_GA
8/4/2010 10:52:46 AM

mystiq
msg #95365


Also, a quick follow-up on the original request. We have created two new functions:

SfPosDiv(ind1, ind2, period, pctChg)
SfNegDiv(ind1, ind2, period, pctChg)


--------------------------------------------------------------------------------
Note: these functions are part of a new feature that allows for custom user defined functions. In essence these functions are based on the exact code you specified.

While we do not have a release date for opening up this feature, we are hoping to allow custom user functions in the near future. You'll also notice the legends on the charts are somewhat lengthy, we hope to fix that with future updates to the user-defined functions feature.

*****WHAT does THE pctChg represent?

++++++++++++++++++

Each of the two indicators being evaluated must have changed by at least pctChg over the period under review. Example - the MACD goes up 3% in 10 days and price goes down 2%. If pctChg is 0.02 a divergence is signaled, but if it is 0.025 no signal is generated. My thinking on this was to eliminate small noise related moves - what this particular incarnation does not pick out is a strong move in one indicator with a flat response in the other. Technically a divergence but not one where the two are actually moving in opposite directions.

++++++++

Kevin_in_GA
msg #95125
- Ignore Kevin_in_GA 7/27/2010 9:19:34 AM

Two separate functions would also work

posdiv(indicator1, indicator2, X, Y) would return a "1" if these conditions are met and a positive divergence is seen, and a 0 if they are not met.

negdiv(indicator1, indicator2, X, Y) would return a "1" if these conditions are met and a negative divergence is seen, and a 0 if they are not met.


*******what does the (....,X,Y) represent?

+++++++++

Basically the same as above - X is the period in days over which the divergence is being measured, and Y is the minimum percent change required by both indicators to generate a signal.

mystiq
650 posts
msg #95390
Ignore mystiq
8/5/2010 1:37:12 AM

...Thanks Kevin ! appreciate the information.

traderseb
36 posts
msg #95394
Ignore traderseb
8/5/2010 6:41:28 AM

A divergence function result will be pos, neg, or zero. Do not need 2 separate functions when one will work. FIlter based on the amount of divergence and the sign of the value.

Kevin_in_GA
4,599 posts
msg #95397
Ignore Kevin_in_GA
8/5/2010 10:12:23 AM

SF code is designed to return a binary value in this type of circumstance - either a 1 or 0. Therefore I wrote my snippet of code as two separate functions, one for positive divergence and one for negative. To me this structure is fine, this I want to be looking for a specific type of divergence in my trade setups.

StockFetcher Forums · General Discussion · A challenge to TomB and the Stockfetcher Crew<< 1 2 3 >>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.