StockFetcher Forums · General Discussion · Weekly +di(14)<< >>Post Follow-up
volvlov
32 posts
msg #148004
Ignore volvlov
6/1/2019 10:35:38 PM

I am interesting in seeing when the weekly +di moving average starts to move up. The script below works for the day but SF does not like the syntax for the weekly, i.e. "set {x,weekly +di(14)}". I think it hates the + sign. Any thoughts?


set {x,+di(14)}
set {xx,cema(x,15)}
set {y,-di(14)}
set {yy,cema(y,15)}
set {xm1, value of xx 1 day ago}
set {del,xx-xm1}
del crossed above 0
draw del line at 0
draw xx
draw yy on plot xx
draw adx



KSK8
561 posts
msg #148007
Ignore KSK8
6/2/2019 10:21:27 AM

Should work.

Fetcher[

set{pos,+DI(14)}
set{neg, -DI(14)}

set{x,weekly pos}
set{xx,cema(x,15)}
set{y,weekly neg}
set{yy,cema(y,15)}
set{xm1, value of xx 1 day ago}
set{del,xx-xm1}
del crossed above 0
draw del line at 0
draw xx
draw yy on plot xx
draw adx

]





volvlov
32 posts
msg #148012
Ignore volvlov
6/2/2019 8:24:55 PM

Thank you for the help!

Mactheriverrat
3,153 posts
msg #148013
Ignore Mactheriverrat
modified
6/2/2019 10:17:34 PM

One question is if your looking at Weekly +di(14). Wouldn't you want to look at it from a weekly chart?


Chart-display is weekly

Village Elder
231 posts
msg #148015
Ignore Village Elder
6/2/2019 10:33:10 PM

The SF syntax here needs to be modified to make sure it works as you want:

"Note:

When using the +DI or -DI inside set statements, you'll want to use PDI (for +DI) and MDI (for -DI)."


use weekly pdi(14) and weekly mdi(14) when referencing these indicators within a user defined function (e.g., the set{} statement).

bushynose
22 posts
msg #148018
Ignore bushynose
6/3/2019 12:59:32 AM

Fetcher[
set {x,weekly pdi(14)}
set {xx,cema(x,15)}
set {y,weekly mdi(14)}
set {yy,cema(y,15)}
set {xm1, value of xx 1 day ago}
set {del,x-xm1}
del crossed above 0
draw del line at 0
draw xx
draw yy on plot xx
draw adx
]



Fetcher[
set {x,weekly pdi(14)}
set {y,weekly mdi(14)}
set {xm1, value of x 1 day ago}
set {del,x-xm1}
del crossed above 0
draw del line at 0
draw x
draw y on plot x
draw adx
]



volvlov
32 posts
msg #148027
Ignore volvlov
6/3/2019 8:41:04 PM

Perfect. Thanks everyone! Yes, I should be looking at weekly here. I will probably end up with daily and weekly elements in the same filter and look at the results side by side in TradingView. I'm still very new here and learning.

StockFetcher Forums · General Discussion · Weekly +di(14)<< >>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.