StockFetcher Forums · Filter Exchange · help with code line<< >>Post Follow-up
push5280
201 posts
msg #150507
Ignore push5280
1/26/2020 7:42:49 AM

I'm having an issue with syntax in this scan and hoped that one of the coding champions could help. I think that I have narrowed it to one of two lines of code. The problem lies either in this set phrase under /*my indicators*/ set{mymac%,close / ma(126)} or this line under /*criteria*/ mymac% crossed .8 from below.
The full scan is below, any assistance you can provide is appreciated

Fetcher[/*my indicators*/
set{myrange, high 52 week high / low 52 week low}
set{mymac%,close / ma(126)}
set{myslp, count( 7 day slope of PVI > -.01,2)}
set{mshares, shares outstanding *1,000,000}
set{maxshares, mshares * .0005}
set{myatr, count(ATR(10) > ATR(10) 20 day low, 2)}
set{mypvi, count(PVI > ma(PVI,20),2)}
set{mymo, count(momentum(10) > 0, 2)}
/*MoneyFlow RSI*/
set{up,count(close above close 1 day ago,1)}
set{down,count(close below close 1 day ago,1)}
set{pivot,pp}
set{MF, pivot * volume}
set{UPMF, MF * up}
set{PMF, sum(UPMF,10)}
set{DNMF, MF * down}
set{NMF, sum(DNMF,10)}
set{ratio, PMF / NMF}
set{MFI, 1 + ratio}
set{MFSI, 100 / MFI}
set{MFRSI, 100 - MFSI}
/*Criteria*/
Market is not otcbb
Market is not etf
close > 1
avg volume(90) above 250,000
myatr > 1
mypvi > 1
mymo > 1
myslp > 1
mymac% crossed .8 from below
/*Charting*/
draw ma(16)
draw ma(126)
draw ATR(10)
draw ATR(10) 20 day low
draw PVI
draw CMA(PVI,20)
draw myslp
draw momentum(10) 20 day low
draw momentum(10) line at 0
draw mymac% line at 1
draw mymac% line at .8
draw rsi(2) line at 90
draw rsi(2) line at 10
draw cci(4) line at 0
draw cci(4) line at 100
draw cci(4) line at -100
draw cci(4) line at -130
draw RSI(14) line at 90
draw RSI(14) line at 70
draw RSI(14) line at 50
draw RSI(14) line at 30
draw RSI(14) line at 10
draw MFRSI line at 20
draw MFRSI 16 day low
add column myrange
add column shares outstanding
add column maxshares
sort column five descending
chart-time is 12 months
]




mahkoh
1,065 posts
msg #150508
Ignore mahkoh
modified
1/26/2020 8:31:35 AM

Use "crossed above 0.8" in the second snippet

JoeyVinyl
125 posts
msg #150511
Ignore JoeyVinyl
1/26/2020 10:57:12 AM

I clicked on it (thanks for making it clickable), made the change that mahkoh suggested, and the first syntax error was this line: set{myslp, count( 7 day slope of PVI > -.01,2)}

I'm far from a coding expert here but can you count how many days a slope of anything was above a certain number? I think I'll play with that and see what I come up with.

JoeyVinyl
125 posts
msg #150512
Ignore JoeyVinyl
modified
1/26/2020 11:18:25 AM

Okay, got it. You have a - sign in that line in front of the .01. I played around with PVI and the lowest number I got was 0. When I deleted that sign in your code the syntax error went away. It didn't show any other syntax errors but no stocks made it through the filter.

set{myslp, count( 7 day slope of PVI > -.01,2)}

Change -.01 to .01

xarlor
587 posts
msg #150513
Ignore xarlor
1/26/2020 11:47:57 AM

Without changing anything, results are returned for 01/24/2020 and further back. Do these results not match what you were expecting?

JoeyVinyl
125 posts
msg #150521
Ignore JoeyVinyl
1/26/2020 8:40:54 PM

@xarlor

That's odd. I just tried it again without changing anything and didn't get results for Thursday or Friday, (1/23 or 1/24) but did get them for Wednesday, 1/22, and before without any syntax errors. I am definitely NOT one of the coding champions here so if push5280 is still having problems with it then I don't know why but I hope they get them resolved.

@push5280, SF support has found errors in my code when I email it to them that I didn't see, so if you're still having problems that's what I'd recommend.

xarlor
587 posts
msg #150523
Ignore xarlor
1/26/2020 8:54:34 PM

Apologies, I meant to say 01/22/2020 and further back. I do not get results for 1/23/2020 or 1/24/2020 either.

KSK8
561 posts
msg #150536
Ignore KSK8
1/27/2020 11:05:11 AM

Do you mind explaining the 'max shares' component as well as the purpose of the filter's use of the 'PVI' ? Genuinely curious.

byebyemoney
31 posts
msg #150650
Ignore byebyemoney
2/3/2020 3:39:45 PM

no syntax errors for me, worked fine

StockFetcher Forums · Filter Exchange · help with code line<< >>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.