StockFetcher Forums · General Discussion · User-Defined Variables IN SETTINGS?<< >>Post Follow-up
mslattery@dc.rr.com
91 posts
msg #97709
Ignore mslattery@dc.rr.com
12/1/2010 3:51:45 PM

I want to be able to calculate and include a col in my returns for the following calculation.

SET{AR1,RSI(2) / ATR(5)}

When I add the script above to my settings variables it indicates an error.

Do I need to define RSI and ATR. I thought it would recognize standard names?

Thanks, Michael

Kevin_in_GA
4,599 posts
msg #97710
Ignore Kevin_in_GA
12/1/2010 3:58:15 PM

I want to be able to calculate and include a col in my returns for the following calculation.

SET{AR1,RSI(2) / ATR(5)}

When I add the script above to my settings variables it indicates an error.

Do I need to define RSI and ATR. I thought it would recognize standard names?

Thanks, Michael

++++++++++++++++++++++

Fetcher[

set{AR1, RSI(2) / ATR(5)}

add column ar1
draw ar1

]



Seems to work. I added a space after the first comma in the set statement which might be what was causing you problems earlier.

mslattery@dc.rr.com
91 posts
msg #97713
Ignore mslattery@dc.rr.com
modified
12/1/2010 9:52:27 PM

Hello Kevin:

Still not working. I am attempting to define a variable in the settings tab in order to be able to list that variable result for all of my filters.

Is that possible?

Here is the link to the tab and settings locations that I am trying to define the variable.
http://forums.stockfetcher.com/stockdb/fetcher?p=uservars&qrid=1291258400

It is asking for 1: Variable Name, eg. myratio
2: Value eg. close / upper bollinger band(20)

The error that is being generated when I input the the provided text:

"set{AR1, RSI(2) / ATR(5)}
add column ar1
draw ar1 ", is:
(!) Error:Variable: is not closed.. Variable: 'set{ar1,' undefined

Thanks for the direction, Michael

straken
469 posts
msg #97714
Ignore straken
12/1/2010 11:04:57 PM

mslattery@dc.rr.com
msg #97713
- Ignore mslattery@dc.rr.com
modified 12/1/2010 9:52:27 PM

Hello Kevin:

Still not working. I am attempting to define a variable in the settings tab in order to be able to list that variable result for all of my filters.

Is that possible?

Here is the link to the tab and settings locations that I am trying to define the variable.
http://forums.stockfetcher.com/stockdb/fetcher?p=uservars&qrid=1291258400

It is asking for 1: Variable Name, eg. myratio
2: Value eg. close / upper bollinger band(20)

The error that is being generated when I input the the provided text:

"set{AR1, RSI(2) / ATR(5)}
add column ar1
draw ar1 ", is:
(!) Error:Variable: is not closed.. Variable: 'set{ar1,' undefined

Thanks for the direction, Michael

************************************************************************************************************************

Michael,
In settings you enter it just like it says


name it: myratio or var1 or whatever

under value enter the math function you do not need to use set parameter, enter RSI(2) / ATR(5) thats all then click save.

Whatever you name it enter that in your filter as a column. I name mine with names like custvar1 and so on so I dont confuse other set{var# in the filters themselves. Once you have your custom variable names just add it into your filter and it will show up.


example: name it "custvar1" as name, enter only the math function "RSI(2) / ATR(5)"
then in your filters code "add column custvar1" and your custom variable will appear in your filter results.
Note: " " are not needed, they are only for detail.

HTH


miko
68 posts
msg #97715
Ignore miko
12/1/2010 11:19:26 PM

Hmm, I was able to set it up. Variable Name is AR1, Value is RSI(2) / ATR(5). Created filter:

add column ar1
draw ar1

Runs as expected. Your post suggestes you are including "set" somewhere in your user-defined iable name, "set" is only used within a filter to establish a variable (for that filter only).

A word of warning, carefully test any usage of variables in settings, my experience is that sometimes they work as expected, sometimes they don't work at all.

Good luck.

mslattery@dc.rr.com
91 posts
msg #97729
Ignore mslattery@dc.rr.com
12/2/2010 4:56:22 PM

Got it everyone:

Thanks for your assistance. I noticed if you have a variable defined in setting and it's indicating an error. Any filter that relies on that same variable name will not return any hits.

Last night I was to tired to be working on this. I read but missed Kevins point of omitting the set command.

Thanks again, Michael

StockFetcher Forums · General Discussion · User-Defined Variables IN SETTINGS?<< >>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.