StockFetcher Forums · General Discussion · Divergence -- 1-week Price up and MACD down<< >>Post Follow-up
glgene
613 posts
msg #96564
Ignore glgene
9/26/2010 1:15:04 AM

A friend of mine recently signed up for SF, and in talking with him, he would like to see a sample script that shows price divergence from an indicator.

So I chose Price and MACD. I'm only at the 101 level in SF scripting, so I would appreciate any assistance in improving the sample divergence script below. Maybe this was a bad week for divergences, or ?:

Fetcher[
price has been increasing the past 1 week
macd(12,26) has been decreasing the past 1 week
add column separator
add column close 1 week ago{close 1 wk ago}
add column macd(12,26)
add column macd(12,26) 1 week ago {macd 1 wk ago}
set {b, price}
set {c, price 1 week ago}
set{d, b-c}
add column separator
add column d{price diff}
set{e, macd(12,26)}
set{f, macd(12,26) 1 week ago}
set{g, e-f}
add column g{macd diff}
add column separator
add column rsi(14)
add column cci(20)
]



Kevin_in_GA
4,599 posts
msg #96565
Ignore Kevin_in_GA
9/26/2010 10:12:48 AM

We recently asked for (and received) a divergence function:

http://forums.stockfetcher.com/sfforums/?q=view&fid=1001&tid=95123&qrid=

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]



Kevin

StockFetcher Forums · General Discussion · Divergence -- 1-week Price up and MACD down<< >>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.