StockFetcher Forums · Filter Exchange · variable: is not closed / multiple support<< >>Post Follow-up
mahkoh
892 posts
msg #101980
Ignore mahkoh
modified
8/3/2011 6:02:05 PM

Fetcher[
set{o, ma(20)/close}
SET{oo, COUNT(o between 0.99 and 1,1)}
set{r, ma(50)/close}
SET{rr, COUNT(r between 0.99 and 1,1)}
set{q, ma(200)/close}
SET{qq, COUNT(q between 0.99 and 1,1)}

add column c2{times}
sort column 5 descending

add column oo{ma20}
add column rr{ma50}
add column qq{ma200}
SET{C1, oo + rr}
SET{C2, C1 + qq}

draw ma(20)
draw ma(50)
draw ma(200)
]



This filter works, it shows stocks with multiple moving average support just below the close. What I'd like to do is maybe narrow down the range, instead of 1% make it 0.5%. I would have to go through the filter and change every 0.99 to 0.995. In order to create a shortcut for that I tried the following:


Fetcher[

set{x ,close*1.01}
set{y ,close*0.99}

SET{a1, COUNT(ma(20) below x,1)}
set{a2, count(ma(20) above y,1)
set{a, a2*a1}
SET{b1, COUNT(ma(50) below x,1)}
set{b2, count(ma(50) above y,1)
set{b, b2*b1}
SET{c1, COUNT(ma(200) below x,1)}
set{c2, count(ma(200) above y,1)
set{c, c2*c1}

set{x1, a + b}
set{d, x1+c}

add column d{times}
add column a{ma20}
add column b{ma50}
add column c{ma200}
sort column 5
]



My intention was that I only need to change x and y values. But I already get a "variable: is not closed" error message in debug. Am I using to many variables?
Does anyone know of a workaround?

Thanks
Marco

duke56468
683 posts
msg #101996
Ignore duke56468
modified
8/4/2011 10:02:54 AM

Marco.. the answer might be here
+++++++++++++++++++++++++++++++++

guyonn
6 posts
msg #74119
- Ignore guyonn 5/5/2009 5:20:31 PM

Hello,
What is wrong with this code in the 'Variables' window?
Buying Pressure - set{BP, Close - True Low}
"True Low" has been defined as a variable previously
(!) Error:Variable: is not closed..
Thanks for your help






chetron
2,817 posts
msg #74120
- Ignore chetron 5/5/2009 5:47:50 PM

you have tried to use a variable name more than once, just as it says.

to know what is wrong your code, you need to post ALL of it.


glty



guyonn
6 posts
msg #74121
- Ignore guyonn 5/5/2009 6:04:08 PM

Var Name = True Low
Value = min(low, close 1 day ago)
Var Name = Buying Pressure
Value = set{BP, close - True Low}
(!) Error:Variable: is not closed..






chetron
2,817 posts
msg #74122
- Ignore chetron
modified 5/5/2009 6:22:34 PM

TRY....



Fetcher[
SET{True_Low,min(low, close 1 day ago)}
set{Buying_Pressure , close - True Low}


ADD COLUMN TRUE_LOW
ADD COLUMN BUYING_PRESSURE

DRAW TRUE_LOW
DRAW BUYING_PRESSURE
]






four
4,000 posts
msg #101997
Ignore four
modified
8/4/2011 10:30:11 AM

SET statements for 'a2' 'b2 'c2' were missing the ending '}'
I added 'ascend' to Sort column 5

Fetcher[

set{x ,close*1.01}
set{y ,close*0.99}

SET{a1, COUNT(ma(20) below x,1)}
set{a2, count(ma(20) above y,1)}
set{a, a2*a1}
SET{b1, COUNT(ma(50) below x,1)}
set{b2, count(ma(50) above y,1)}
set{b, b2*b1}
SET{c1, COUNT(ma(200) below x,1)}
set{c2, count(ma(200) above y,1)}
set{c, c2*c1}

set{x1, a + b}
set{d, x1 + c}

add column d{times}
add column a{ma20}
add column b{ma50}
add column c{ma200}
sort column 5 ascend

DRAW MA(20)
DRAW MA(50)
DRAW MA(200)
]



mahkoh
892 posts
msg #101998
Ignore mahkoh
8/4/2011 12:58:38 PM

Thanks once again, four! What a difference a few }}'s can make.

One can use this filter intraday, replace ma's with any sort of resistance or support you like, pivots, fibonacci's linear regression or just add them to the code.
x and y are to be used to adjust for SF's delayed market data.
Look what the market has done the last 20-30 minutes, if it is down 2% set x and y to 1.02 and 1.03 and you'll scan for stocks that were 2 to 3 percent above significant support 20 minutes ago and that may be just above it right now. You'll have to verify this manually with a service that has realtime data.
Sort column 5 descending to have multiple support on top.

StockFetcher Forums · Filter Exchange · variable: is not closed / multiple support<< >>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 2016 - 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