StockFetcher Forums · General Discussion · ???what does " set{etc........}" syntax mean?? Why is it Used?<< >>Post Follow-up
rbsingleton56
7 posts
msg #132269
Ignore rbsingleton56
11/1/2016 7:58:08 AM

Why is the syntax “set { etc…..} used? Is this done to create the charts and lines below the bar charts? Can that graphical data be used to fine tune the drafting of variables utilized in our filter drafting? Where can we locate comprehensive sources on how to understand and utilize this info?

Kevin_in_GA
4,599 posts
msg #132272
Ignore Kevin_in_GA
11/1/2016 9:31:33 AM

You are talking about user-defined functions, which can be used to do more than just draw lines at the bottom of charts. They allow for the combination of different values and/or variables into new functions.

The basic structure uses the set{} statement - within the brackets you need to

1. give the user-defined function a name
2. call upon an existing variable (e.g., close, RSI(2), ema(10))
3. optionally perform one mathematical operation (e.g., add ema(10) and ema(20), divide RSI(2) by RSI(4), etc.).

You cannot perform more than one mathematical operation at a time

Here is a simple example - I want to see when the price is more than 10% below the 52-week high by drawing that line directly on the price chart:

Fetcher[
symlist(spy,vxx)
set{52weekhigh, high 52 week high}
set{threshold, 52weekhigh * 0.9} note than I can call on other previous user-defined functions
draw threshold on plot price
]



Here you can see that the SPY is still well above the threshold, while VXX is well below. These more advanced functions are really useful and it is not that hard to learn. Read through the forums and you will see tons of examples.


graftonian
1,089 posts
msg #132277
Ignore graftonian
11/1/2016 12:03:59 PM

@rb, check out Kevins "PANGOLIN Z AND PANGOLIN W - FULL SYSTEM CODE" in the filter exchange forum. This was my "textbook" learning SF coding, and I recommend it to anyone wanting learn.
Thanks again, Kevin.

four
5,087 posts
msg #132280
Ignore four
11/1/2016 12:43:58 PM

http://www.stockfetcher.com/sfhelp2/?id=100379

Guide located here

rbsingleton56
7 posts
msg #132288
Ignore rbsingleton56
11/1/2016 4:08:51 PM

Thank you Kevin in GA.

It appears that reading a lot of the forum posts is going to help shed a lot of light on the subject also. The downloadable manual is a bit thin but much trial and error with an abundance of "debug" seems to be helping to make progress. It is wonderful that the forum has folks like you and others willing to reach out and assist. There is a special place in heaven for folks like you!

StockFetcher Forums · General Discussion · ???what does " set{etc........}" syntax mean?? Why is it Used?<< >>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.