StockFetcher Forums · General Discussion · Help: SF Code for xx trading days back<< >>Post Follow-up
joepistell
37 posts
msg #157441
Ignore joepistell
8/26/2021 6:16:59 PM

I am looking at the column 'Perf(%)' 100 trading days back. I'd like to know what 'Perf(%)' was happening in between. HELP. Is there a SF formula that can show me an additional column of the 'Perf(%)' say... 50 trading days back?

Example I fetch stocks, go 100 trading days back (April 6,2021 to today), I lets say I get one stock.
I see the Default: 'Perf(%)' = 22.5%
I'd like to see the Perf(%) 50 days back (April 6th to June 16)

DId I explain this right? Looking for SF code to display performance within the lookback period.

Cheese
1,374 posts
msg #157442
Ignore Cheese
8/26/2021 9:05:10 PM

joe,
maybe something like this, using your day counts.
good luck

Fetcher[
/*
https://www.stockfetcher.com/forums/General-Discussion/Help-SF-Code-for-xx-trading-days-back/157441

code example for past Perf(%)
*/

SYMLIST (XLB,XLC,XLE,XLF,XLI,XLK,XLP,XLRE,XLU,XLV,XLY,SPY,QQQ,IWM,DIA,UUP)

SET{perf50daysagoa, close 50 days ago}
SET{perf50daysagob, close / perf50daysagoa}
SET{perf50daysago, perf50daysagob - 1}
SET{perf50daysago%, perf50daysago*100}
add column perf50daysago%

date offset is 6/16/2021
]



wantonellis
161 posts
msg #157450
Ignore wantonellis
8/27/2021 1:31:36 PM

Example I fetch stocks, go 100 trading days back (April 6,2021 to today), I lets say I get one stock.
I see the Default: 'Perf(%)' = 22.5%
I'd like to see the Perf(%) 50 days back (April 6th to June 16)

Take the stock(s) from 100 days back and add them to a watchlist. Then in "Watchlist Actions" select run as filter and go back to April 6th and advance 1 day till June 15th. You'll see Perf(%) for each day.

nibor100
1,042 posts
msg #157452
Ignore nibor100
8/27/2021 5:28:21 PM

@wantonellis,

I'm not quite following how your suggestion will give the Perf(%) 50 days (April 6th to June 16) .

As I understand the Perf(%) column in SF, it is measuring the performance from the date the filter is run on, in the past, to today's date, no matter whether we use offsets or not.

It appears to me that on Jun 15th that performance column will show the percent change from Jun 15th to Aug 27th not the percent change from April 6th to Jun15th on the one test I tried.

Perhaps you have a clarifying example?

Thanks,
Ed S.



joepistell
37 posts
msg #157457
Ignore joepistell
8/28/2021 7:43:14 AM

wow, Awesome sauce Cheese! ;-)

Cheese
1,374 posts
msg #157458
Ignore Cheese
8/28/2021 12:50:38 PM

@joepistell
I'm glad I've been of help.
good luck with your trading.



StockFetcher Forums · General Discussion · Help: SF Code for xx trading days back<< >>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.