StockFetcher Forums · General Discussion · Question for Stockfetcher folks<< 1 2 >>Post Follow-up
SAFeTRADE
412 posts
msg #117202
Ignore SAFeTRADE
modified
12/4/2013 12:31:32 PM

Why not or how would it be possible to use a value to do math or look back functions.

As in the following example;


SET{H20,DAYS(HIGH REACHED A NEW 20 DAY HIGH,10)}
set{x, H20 + 1}

ADD COLUMN H20
ADD COLUMN HIGH 20 DAY HIGH
ADD COLUMN LOW 20 DAY HIGH
ADD COLUMN LOW A DAYS AGO


SYMLIST(SPY)

The value of H20 is 3. Why can I not use the value of H20 to find the low of the 20 day high?

The I could also do the following;

set{isdl, low x days ago > low a days ago,1)}

Seems like there should be a way to do this, it would open up a whole new world of filtering.

What do you think?

________________________________________________________________________

An after thought. Maybe we could make a and x numeric, therefore use the values. You know
like assign or label as numeric. I don't know, seems possible to this feeble mind...

Kevin_in_GA
4,541 posts
msg #117220
Ignore Kevin_in_GA
12/4/2013 9:20:22 PM

Perhaps a set of functions like

low(X,Y) and High(X,Y)

where X is the quantity being measured and Y is functionally days look-back but could also be a user-defined variable that returns a positive integer as well.

Example:

set{var1, count(close above close 1 day ago,10)}

add column high(close, var1)

SAFeTRADE
412 posts
msg #117222
Ignore SAFeTRADE
12/4/2013 9:31:38 PM

Kevin, that is exactly what I am thinking. You explained it better though. Thanks

Clarence

SAFeTRADE
412 posts
msg #117245
Ignore SAFeTRADE
12/5/2013 10:01:52 PM

Bump to the top.

stockfetcher
963 posts
msg #117259
12/6/2013 12:12:42 PM

Below is an example using the new "VarOffset()" function that should do what you are looking for:

Fetcher[
set{var_ago, days(high reached a new 20 day high,10)}
close is above 10
and add column VarOffset(low,var_ago)
and draw price line at VarOffset(low,var_ago)}
and var_ago > -1
]



The VarOffset() function is a new function that we are still working on and testing. So if you run into any bugs or unexpected results, please let us know. Additionally, due the performance concerns of this function, it is possible that some scenarios may not produce results.

VarOffset() takes 2 parameters:

Parameter #1 - The indicator you wish to access a past value from. For example, "close" or "RSI(10)"
Parameter #2 - The variable or value that determines how to calculate the variable offset. In the example above var_ago is the number of days since the stock reached a new 20 day high. Because "days()" can return -1, not all stocks will match this condition.

Here is another example:

Fetcher[
set{new_low, days(low reached a new 52 week low,50)}
set{rsi_at_low, VarOffset(RSI(10),new_low)}
show stocks where RSI(10) is below rsi_at_low
and rsi_at_low is below 30
and new_low is above -1
]



Please let us know if you have any questions or run into any issues.

Thank you,
StockFetcher Support




SAFeTRADE
412 posts
msg #117260
Ignore SAFeTRADE
12/6/2013 12:17:56 PM

Thanks Stockfetcher, I am going to have a longer look at this to see if it does what I intend for it. Thanks again.

SAFeTRADE
412 posts
msg #117263
Ignore SAFeTRADE
12/6/2013 2:42:55 PM

Stockfetcher,

Fetcher[set{var_ago, days(high reached a new 20 day high,10)}
set{a, var_ago +3}
set{var_ago1,(low, a days ago)}
add column varoffset(low, var_ago1)
symlist(spy)

add column var_ago
add column a
]



Not seeming to work. A little help, please.

Clarence

stockfetcher
963 posts
msg #117265
12/6/2013 3:09:54 PM

We are not sure the intent of the following line. The syntax is not valid.

set{var_ago1,(low, a days ago)}

If possible, can you provide more details concerning what you are looking to do?

Thank you,

StockFetcher Support


SAFeTRADE
412 posts
msg #117267
Ignore SAFeTRADE
12/6/2013 3:40:20 PM

12/6/2013 3:09:54 PM

We are not sure the intent of the following line. The syntax is not valid.

set{var_ago1,(low, a days ago)}

If possible, can you provide more details concerning what you are looking to do?

Thank you,

StockFetcher Support


set{var_ago, days(high reached a new 20 day high,10)}
set{a, var_ago +3}
set{var_ago1,(low, a days ago)}
add column varoffset(low, var_ago1)
symlist(spy)

add column var_ago
add column a

Yes, I am adding 5 from var_ago and 3. 3 as in 3 days before the 20 day high. Trying to arrive at the low
3 days before the 20 day high. Then draw a line at the low of 3 days before the 20 day high. That number will change
the farther away we move form the high. If the high is today than the low would be 3 days prior. Hope that helps.

Clarence

stockfetcher
963 posts
msg #117268
12/6/2013 3:48:26 PM

If you are looking for the low 3 days prior to the high, below is an example (you may need to click on the filter text to see the actual results.)

Fetcher[
set{var_ago, days(high reached a new 20 day high,10)}
set{low_day, var_ago +3}
apply to symlist(spy)
and add column VarOffset(low, low_day)
and add column var_ago
and add column low_day
and draw price line at VarOffset(low,low_day)
and draw price line at high 20 day high
]



StockFetcher Support


StockFetcher Forums · General Discussion · Question for Stockfetcher folks<< 1 2 >>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