StockFetcher Forums · General Discussion · Slope (angle) as a Column number?<< >>Post Follow-up
glgene
620 posts
msg #162064
Ignore glgene
12/3/2025 2:02:29 PM

This may sound like an odd request, but is there a way to code the Slope (angle?) in StockFetcher, with the output in a Column number (say, 1 to 180, or negatively -1 to -180) ? I would like to include a with a 21-day (1 month) lookback and also a 63-day lookback (3 months). I want to be able to sort on that column. Any help would be appreciated. Thank you.

styliten
336 posts
msg #162065
Ignore styliten
modified
12/3/2025 3:53:45 PM

Fetcher[dow 30

set{21run, close minus close 22 days ago}
set{63run, close minus close 64 days ago}

set{atan21, atan(21run divided by 21) multiply by 57.2977}
set{atan63, atan(63run divided by 63) multiply by 57.2977}

and draw 22 day slope of close
and draw 64 day slope of close

add column atan21 {21_slope_deg}
add column atan63 {63_slope_deg}
]





wantonellis
167 posts
msg #162066
Ignore wantonellis
12/3/2025 3:59:56 PM

Here's a simple starter script to work with.

Fetcher[
21 day slope of close 21 days ago between 1 and 180
add column 21 day slope of close 21 days ago
sort by column 5 descending
]



glgene
620 posts
msg #162067
Ignore glgene
12/3/2025 9:00:00 PM

Thanks so much for the 2 scripts. Will need to study them; see what’s under the hood.

The scripting talent here is remarkable.


StockFetcher Forums · General Discussion · Slope (angle) as a Column number?<< >>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.