StockFetcher Forums · General Discussion · Help for 'strange' syntax error | << >>Post Follow-up |
lorypanna 19 posts msg #160239 - Ignore lorypanna |
4/3/2023 11:54:23 AM Hi I'm trying the code below (it's an attempt of mine to code in SF a TC2K scan). NOTE1: likely its execution requires advanced SF subscription level. NOTE2: the code below is the working version where I commented out the lines causing it not to work. Removing the comments' delimiters from those lines (all the ones beginning with '/* SYNTAX ERROR? ...') the script stops working. It contains some commented lines beginning with '/* SYNTAX ERROR? ...'. The first of them seems the one causing the filter not working: 'set {My4Avg42TotEntryFlag, count(My4Avg42TotEntry equals 11, 1)}' I cannot figure out what code is wrong in this line. It appears to me very similar to a following one ('set {My4Avg42TotExitFlag, count(My4Avg42TotExit equals 2, 1)}') which works fine. Can someone help figuring out what I'm doing wrong? Thanks for any help. Cheers from Italy. LP |
nibor100 1,031 posts msg #160242 - Ignore nibor100 |
4/3/2023 4:06:56 PM It runs fine for me when I take off the Syntax Error comments on your 2 trouble lines, I have advanced subscription level. Ed S. |
lorypanna 19 posts msg #160243 - Ignore lorypanna |
4/3/2023 5:38:43 PM Thanks nibor100 I tried to remove the comments and still it doesn't work for me. I get the following messages: - "No Stocks Matched your filter." - If I follow the link inside 'Click here to learn why' I see a triangle withan exclamation mark (should be the indication of a syntax error) near the following 3 lines: -- set {My4Avg42TotEntryFlag, count(My4Avg42TotEntry equals 11, 1)} -- add column My4Avg42TotEntryFlag -- draw My4Avg42TotEntryFlag Can you please confirm that you can successfully run the following code (same as before but with all cited commands uncommented)? It should return 4,488 stocks. Thanks for your and others support. LP |
jimvin 173 posts msg #160244 - Ignore jimvin |
4/3/2023 10:41:31 PM At the most basic level of operational knowledge (which is proudly mine) have you tried StockFetcher's "Debug" function? It's helped me through a few (though not all) rough patches... |
nibor100 1,031 posts msg #160245 - Ignore nibor100 |
4/4/2023 12:35:40 AM Sorry, I missed one of the Syntax Error lines. When I remove the Syntax Error from the first one and leave the last 2 commented out your filter runs in advanced subscription but if either of the other 2 are un-commented it fails so its a nesting problem. There are some possible workarounds and i'll take a look at it later and see what I can come up with. I use TC2000 also, is this from their Worden forum or your own PCF? Thanks, Ed S. |
nibor100 1,031 posts msg #160246 - Ignore nibor100 |
4/4/2023 1:12:07 AM In order to get your last posted filter to run I have to comment out the last 7 lines of the filter and then it returns 5,012 stocks. To get rid of nesting and make your filter simpler I replace cma(4) and cma(42) in all occurences with ma(4) and ma(42) since your cma statements are taking a cma of the close price which is what the standard ma in SF does. after doing all of those replacements the nesting is not as deep and all lines of your last filter run with those modifications and also returns 5,012 stocks. I can't figure out how you get 4,488 stocks. My modified filter is below. Thanks, Ed S. |
lorypanna 19 posts msg #160247 - Ignore lorypanna modified |
4/4/2023 5:17:07 AM Thanks again nibor100 and thanks jimvin too. First thing I've to say it's that I'm just a beginner, both in using SF and both in trading / investing. At present I make very few trades and whenever possible I study [but with a full time job the time is limited; and many 'gray hair' on my head make my understanding much slower than some years ago ... No problem, I have time, every day a little step and, as we say in Italy, 'se son rose ... fioriranno' (don't know if the same expression in used in English: 'if they're roses ... they'll bloom')]. I'm interested in technical analysis and in ways to identify 'interesting' stocks with programming techniques. I like SF because it's very powerful but at the same time quite simple to learn, and at a cost for me affordable. I tried starting from raw data (Tiingo), but not much progress due too many components that have to be managed and my limitations. I don't use TC2K (too expensive for what I need) but I started reading the blog https://stockbee.blogspot.com/ (the free version) where StockBee / @PradeepBonde makes extensive use of TC2K and its scans to explain the concepts and how he identifies his 'interesting' stocks. And so I try to convert them into SF filters for trying to better understand the explained concepts and for seeing if I can use some of them in future for my trading. This said, I come to the answers. First reply for jimvin: yes I had tried it and it showed the same (syntax?) error that can be seen if using the link inside the string "Click here to learn why" that is available after the message "No Stocks Matched your filter". To be honest, I'm often not able to understand immediately where the error actually is analyzing the 'Debug' and/or the cited link ... For nibor100: 1. I confirm that just uncommenting the (only probably wrong?) first line of the ORIGINAL filter, it works and I can use the variable / column 'My4Avg42TotEntry' to identify the 'interesting' stocks 2. Thanks for your updates to the filter code. Now it works as I originally wanted. In this moment in time (20230404, 10:55AM Italy time), the stocks returned by the filter are "4716 results from Monday April 3, 2023" 3. The filter is based on the following post in the above cited site: https://stockbee.blogspot.com/2011/06/q-with-pradeep-bonde.html (search for '401K mutual fund' to identify the section containing the TC2K scan). NOTE: I'm not interested in '401K mutual funds', I just tried to convert the scan to SF (as an exercise); anyway, it could be a useful filter for who is interested in that type of investment, read the post if that is the case 4. Because you use TC2K, if you have time and want to do it, can you confirm that similar results are returned from the scan (my objective is to check if I understood well the TC2K syntax and then if I implemented a 'good' similar filter in SF). But don't lose too much time in it, it's just a check if you are interested 5. Just for reference, I put below the final working version of the SF filter (the one which returnetd the number of stocks above cited) Have a nice day and thanks for the support (and sorry for my poor English, likely full of errors and words used with the wrong meaning due to 'false friendship' with Italian ones). LP |
nibor100 1,031 posts msg #160248 - Ignore nibor100 |
4/5/2023 1:18:58 AM When I run the entry PCF in TC200 Version20 I get 137 stocks, when I run your last posted filter in SF limiting the add column for entry to > 0 I get 147 results. matching symbol sorts shows that some of the stocks found in SF are not in the database for TC2000 and other 10 stocks or so, that I checked, were in both. So your implementation is probably working as expected. Ed S. PS. It appears that blogger is recommending that scan for mutual funds only....though I'm not sure why that limitation as rationale seems to be missing. |
lorypanna 19 posts msg #160252 - Ignore lorypanna |
4/5/2023 5:56:10 PM Thanks nibor100 for you checks and your support. I cannot explain why the blogger limits this 'strategy' to mutual funds only. Have a nice evening. Cheers from Italy |
StockFetcher Forums · General Discussion · Help for 'strange' syntax error | << >>Post Follow-up |
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