Selasa, 12 Juni 2018

[smf_addin] Digest Number 4341

5 Messages

Digest #4341
1b
2a
smftech ADL and OBV by bdingeman@gmail.com
2b
Re: smftech ADL and OBV by "Randy Harmelink" rharmelink
2c
Re: smftech ADL and OBV by "bdingeman" bdingeman@gmail.com

Messages

Mon Jun 11, 2018 10:13 am (PDT) . Posted by:

pete_cook2001

When I use element 80 in smfGetYahooPortfolioView to get the ex-dividend date, for some stocks it pulls up the most recent date and for others it pulls up the next date. Is there a different function that would consistently pull up the next date? (I'll settle for the most recent and just add 30 or 90 for an estimate.)


Pete

Mon Jun 11, 2018 11:08 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

It will be subject to Yahoo's update schedule. Personally, I don't use them
for ex-dividend dates, and estimate my own when they are out-dated. In any
case, Yahoo will only have the next ex-dividend date if it has been
declared. I hesitate giving formulas for what I do, because they aren't
something I would want people to do on a large number of stocks. I do mine
in an smfUpdateDownloadTable process, so I only need to retrieve the data
for a given stock several times a quarter. That's far different than
grabbing data on hundreds of stocks every time a workbook is opened.

On Mon, Jun 11, 2018 at 10:12 AM, peterscottcook@
​...
wrote:

> When I use element 80 in smfGetYahooPortfolioView to get the ex-dividend
> date, for some stocks it pulls up the most recent date and for others it
> pulls up the next date. Is there a different function that would
> consistently pull up the next date? (I'll settle for the most recent and
> just add 30 or 90 for an estimate.)
>
>
>

Mon Jun 11, 2018 11:02 am (PDT) . Posted by:

bdingeman@gmail.com

I wrote simple VBA code with reference to RCH_Stock_Market_Functions.xla. The code outputs a number of different technical indicators for each ticker symbol in a list using smftech.


However, I've encountered a problem when I run the code on a single ticker symbol versus looping through multiple ticker symbols. Specifically, the same ticker symbol run individually gives different ADL and OBV values than when it is run looping through a group of ticker symbols.


What's odd is that the other indicators do match -- I only notice the difference in ADL and OBV (and a very small difference in RSI).


I've pasted an excerpt of my code below and welcome any thoughts or ideas about how to fix this. Thanks


ReDim ditems(ndaysp1, 6) As Variant, adl(ndaysp1, 2) As Variant, atr(ndaysp1, 5) As Variant, cci(ndaysp1, 4) As Variant, _
ema(ndaysp1, 1) As Variant, macd(ndaysp1, 3) As Variant, obv(ndaysp1, 1) As Variant, roc(ndaysp1, 1) As Variant, _
rsi(ndaysp1, 7) As Variant, sma(ndaysp1, 1) As Variant, sto(ndaysp1, 3) As Variant

ditems = RCHGetYahooHistory(pTicker:=symb, pStartYear:=yr1, pStartMonth:=mo1, pStartDay:=dy1, _
pEndYear:=yr2, pEndMonth:=mo2, pEndDay:=dy2, pItems:=sItems, _
pNames:=1, pResort:=1, pDim1:=ndaysp1, pDim2:=6)

adl = SMFTech(pDataRange:=ditems, pIndicator:="ADL")
atr = SMFTech(pDataRange:=ditems, pIndicator:="ATR", pParm1:=atr_p)
cci = SMFTech(pDataRange:=ditems, pIndicator:="CCI", pParm1:=cci_p)
ema = SMFTech(pDataRange:=ditems, pIndicator:="EMA", pParm1:=ema_p)
macd = SMFTech(pDataRange:=ditems, pIndicator:="MACD", pParm1:=macd_p1, pParm2:=macd_p2, pParm3:=macd_sp)
obv = SMFTech(pDataRange:=ditems, pIndicator:="OBV")
roc = SMFTech(pDataRange:=ditems, pIndicator:="ROC", pParm1:=roc_p)
rsi = SMFTech(pDataRange:=ditems, pIndicator:="RSI", pParm1:=rsi_p)
sma = SMFTech(pDataRange:=ditems, pIndicator:="SMA", pParm1:=sma_p)
sto = SMFTech(pDataRange:=ditems, pIndicator:="STO", pParm1:=sto_kp, pParm2:=sto_dp, pParm3:=sto_sp)

Mon Jun 11, 2018 11:14 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Off-hand, I can't think of a reason for results to be different
individually versus looping? It's been years since I've looked at that
function, or even used it. I stopped working on the function when I found
out there was already an existing free technical analysis add-in:

https://www.ta-lib.org/excel_doc.html

I just didn't see a reason to reinvent the wheel. I almost deleted the
function from SMF, but kept it "just in case".

On Mon, Jun 11, 2018 at 6:21 AM, bdingeman@
​...
wrote:

> I wrote simple VBA code with reference to RCH_Stock_Market_Functions.xla.
> The code outputs a number of different technical indicators for each ticker
> symbol in a list using smftech.
>
> However, I've encountered a problem when I run the code on a single ticker
> symbol versus looping through multiple ticker symbols. Specifically, the
> same ticker symbol run individually gives different ADL and OBV values than
> when it is run looping through a group of ticker symbols.
>
> What's odd is that the other indicators do match -- I only notice the
> difference in ADL and OBV (and a very small difference in RSI).
>
> I've pasted an excerpt of my code below and welcome any thoughts or ideas
> about how to fix this. Thanks
>
> ReDim ditems(ndaysp1, 6) As Variant, adl(ndaysp1, 2) As Variant,
> atr(ndaysp1, 5) As Variant, cci(ndaysp1, 4) As Variant, _
>
> ema(ndaysp1, 1) As Variant, macd(ndaysp1, 3) As Variant, obv(ndaysp1,
> 1) As Variant, roc(ndaysp1, 1) As Variant, _
>
> rsi(ndaysp1, 7) As Variant, sma(ndaysp1, 1) As Variant, sto(ndaysp1,
> 3) As Variant
>
> ditems = RCHGetYahooHistory(pTicker:=symb, pStartYear:=yr1,
> pStartMonth:=mo1, pStartDay:=dy1, _
>
> pEndYear:=yr2, pEndMonth:=mo2, pEndDay:=dy2, pItems:=sItems, _
>
> pNames:=1, pResort:=1, pDim1:=ndaysp1, pDim2:=6)
>
>
>
> adl = SMFTech(pDataRange:=ditems, pIndicator:="ADL")
>
> atr = SMFTech(pDataRange:=ditems, pIndicator:="ATR", pParm1:=atr_p)
>
> cci = SMFTech(pDataRange:=ditems, pIndicator:="CCI", pParm1:=cci_p)
>
> ema = SMFTech(pDataRange:=ditems, pIndicator:="EMA", pParm1:=ema_p)
>
> macd = SMFTech(pDataRange:=ditems, pIndicator:="MACD", pParm1:=macd_p1,
> pParm2:=macd_p2, pParm3:=macd_sp)
>
> obv = SMFTech(pDataRange:=ditems, pIndicator:="OBV")
>
> roc = SMFTech(pDataRange:=ditems, pIndicator:="ROC", pParm1:=roc_p)
>
> rsi = SMFTech(pDataRange:=ditems, pIndicator:="RSI", pParm1:=rsi_p)
>
> sma = SMFTech(pDataRange:=ditems, pIndicator:="SMA", pParm1:=sma_p)
>
> sto = SMFTech(pDataRange:=ditems, pIndicator:="STO", pParm1:=sto_kp,
> pParm2:=sto_dp, pParm3:=sto_sp)
>

Mon Jun 11, 2018 11:23 am (PDT) . Posted by:

"bdingeman" bdingeman@gmail.com

Thanks Randy -- it could be because I used a different date range for the individual lookup  versus when I was looping & those variable may reflect a summation from the start date.
I'll take a look at the link.  Thanks again! -Bruce

Sent from my Samsung Galaxy smartphone.
-------- Original message --------From: "Randy Harmelink rharmelink@gmail.com [smf_addin]" <smf_addin@yahoogroups.com> Date: 6/11/18 21:14 (GMT+02:00) To: smf_addin@yahoogroups.com Subject: Re: [smf_addin] smftech ADL and OBV

 

Off-hand, I can't think of a reason for results to be different individually versus looping? It's been years since I've looked at that function, or even used it. I stopped working on the function when I found out there was already an existing free technical analysis add-in:
https://www.ta-lib.org/excel_doc.html

I just didn't see a reason to reinvent the wheel. I almost deleted the function from SMF, but kept it "just in case".
On Mon, Jun 11, 2018 at 6:21 AM, bdingeman@​... wrote:

I wrote simple VBA code with reference to RCH_Stock_Market_Functions.xla.  The code outputs a number of different technical indicators for each ticker symbol in a list using smftech.However, I've encountered a problem when I run the code on a single ticker symbol versus looping through multiple ticker symbols.  Specifically, the same ticker symbol run individually gives different ADL and OBV values than when it is run looping through a group of ticker symbols.
What's odd is that the other indicators do match -- I only notice the difference in ADL and OBV (and a very small difference in RSI).
I've pasted an excerpt of my code below and welcome any thoughts or ideas about how to fix this.  Thanks
 ReDim ditems(ndaysp1, 6) As Variant, adl(ndaysp1, 2) As Variant, atr(ndaysp1, 5) As Variant, cci(ndaysp1, 4) As Variant, _
    ema(ndaysp1, 1) As Variant, macd(ndaysp1, 3) As Variant, obv(ndaysp1, 1) As Variant, roc(ndaysp1, 1) As Variant, _    rsi(ndaysp1, 7) As Variant, sma(ndaysp1, 1) As Variant, sto(ndaysp1, 3) As Variant  ditems = RCHGetYahooHistory(pTicker:=symb, pStartYear:=yr1, pStartMonth:=mo1, pStartDay:=dy1, _
    pEndYear:=yr2, pEndMonth:=mo2, pEndDay:=dy2, pItems:=sItems, _    pNames:=1, pResort:=1, pDim1:=ndaysp1, pDim2:=6)    adl = SMFTech(pDataRange:=ditems, pIndicator:="ADL")  atr = SMFTech(pDataRange:=ditems, pIndicator:="ATR", pParm1:=atr_p)  cci = SMFTech(pDataRange:=ditems, pIndicator:="CCI", pParm1:=cci_p)  ema = SMFTech(pDataRange:=ditems, pIndicator:="EMA", pParm1:=ema_p)  macd = SMFTech(pDataRange:=ditems, pIndicator:="MACD", pParm1:=macd_p1, pParm2:=macd_p2, pParm3:=macd_sp)  obv = SMFTech(pDataRange:=ditems, pIndicator:="OBV")  roc = SMFTech(pDataRange:=ditems, pIndicator:="ROC", pParm1:=roc_p)  rsi = SMFTech(pDataRange:=ditems, pIndicator:="RSI", pParm1:=rsi_p)  sma = SMFTech(pDataRange:=ditems, pIndicator:="SMA", pParm1:=sma_p)  sto = SMFTech(pDataRange:=ditems, pIndicator:="STO", pParm1:=sto_kp, pParm2:=sto_dp, pParm3:=sto_sp) 

For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar