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.
|
volvlov 32 posts msg #148012 - Ignore volvlov |
6/2/2019 8:24:55 PM
Thank you for the help!
|
Mactheriverrat 3,156 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
|
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.
|