StockFetcher Forums · General Discussion · Undefined variable replacing defined variable with odd values<< >>Post Follow-up
faraway
16 posts
msg #136109
Ignore faraway
5/29/2017 10:13:45 PM

I spent 10 hrs today attempting to develop a momentum filter (I'm learning), only to find that SF is seemingly "creating" a variable I've never defined, and exhibiting some very strange behavior. In the filter below, If I uncomment /* set{r2,RSquared(close,60)} */ variable R2 appears with values I can't explain -- when I add column /RSquared(close,60)} I get the values I expect, but r2 never appears after assigning RSquared(close,60) to it. Add column r2 is replaced by R2 with strange values, even when I simply assign r2 to 1 (see my current version below). What's going on? Thanks for any help anyone can provide ...

set{shrs,75/ATR(20)}
set{cost, shrs*close}
set{slp,60 day slope of the close}
/* set{r2,RSquared(close,60)} */
set{r2, 1}
/* set{R2, 2} */
set{ranker, slp*RSquared(close,60)}
set{2bw,2*Bollinger Width(20) two days ago}
set{bwcnt,count(Bollinger Width(20) > 2bw, 30)}
set{subtr, ATR(20)/2}
set{atr_p,close-subtr}

RSquared(close,60) > 0.91
45 Day slope of the close is above 0
and RSquared(close,60) is above 0.89
and 60 day slope of ROC(15) is above 0
and close has been above EMA(20) for the past 20 days
and bwcnt < 1
and close is above 5.00
and average volume(30) is above 200000

and add column slp
and add column RSquared(close,60) {rsqr}
and add column r2
and add column ranker
and add column shrs
and add column cost
and add column atr_p
/* and add column Normalized Standard Deviation(35) {sd35} */
and sort column 6 descending


four
5,087 posts
msg #136110
Ignore four
5/29/2017 10:26:03 PM

Perhaps,

Pivot Points (PP,R1,S1,R2,S2)

R2 is considered a Pivot Point.

Kevin_in_GA
4,599 posts
msg #136119
Ignore Kevin_in_GA
5/30/2017 8:56:46 AM

Yup. You can't use R2 as a variable name since it is already assigned to another function.

StockFetcher Forums · General Discussion · Undefined variable replacing defined variable with odd values<< >>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.