StockFetcher Forums · General Discussion · Weekly count of one standard deviation moves<< 1 2 >>Post Follow-up
15minofPham
169 posts
msg #160938
Ignore 15minofPham
3/17/2024 4:16:13 AM

Is there a way to have a count to see what stocks have moved the most times above and below one standard deviation(20) on a weekly basis over the past 52 weeks?

SAFeTRADE
644 posts
msg #160939
Ignore SAFeTRADE
3/17/2024 7:41:53 AM

Fetcher[set{x2,count(close crossed above Upper Bollinger Band(20,1),100)}
set{x,count(close crossed above Upper Bollinger Band(20,1),1)}
set{y2,count(close crossed below lower Bollinger Band(20,1),100)}
set{y,count(close crossed below lower Bollinger Band(20,1),1)}
draw Upper Bollinger Band(20,1)
add column x2{upper cross}
add column y2{lower cross}
s&p 100
draw x
draw y
chart-length 100 days
]



this for 100 days, don't think you can go over 100

xarlor
581 posts
msg #160940
Ignore xarlor
3/17/2024 1:34:23 PM

A 1-week standard deviation may be too tight, but here goes. SAFeTRADE used Bollinger Bands to do the same, though over a 4-week period instead of 1 and looking back 20 weeks instead of a year.

Fetcher[
s&p 100
set{1sdu,close 1 day ago + standard deviation(5) 1 day ago}
set{1sdd,close 1 day ago - standard deviation(5) 1 day ago}
set{break_above,count(close > 1sdu,252)}
set{break_below,count(close < 1sdd,252)}
set{broke_above,count(close > 1sdu,1)}
set{broke_below,count(close < 1sdd,1)}

broke_above > -1
broke_below > -1

set{total,break_above + break_below}

draw 1sdu on plot price
draw 1sdd on plot price

add column separator
add column break_above
add column break_below
add column separator
add column total
sort by column 9 descending
]



15minofPham
169 posts
msg #160950
Ignore 15minofPham
3/21/2024 5:59:39 PM

Hi SAFeTRADE & Xarlor,
Thank you for your help! I sell a lot of weekly Call & Put spreads so I'm trying to figure out how often a stock move one deviation from the previous week over the course of the past year. The fewer times the better!

TastyTrade is my brokerage and in each option chain they show you one & two deviations away from the current price, but I haven't been able to have SF calculate something close to theirs. Take AAPL for example. According to them, the Mar 28 exp one SD for Call is 180 and the Put is 162.50. Is there a way to have a column showing what 1 SD & 2 SD is for each direction?

I changed Xarlor's to weekly, but the results don't seem correct. I don't think APPL has moved 21X above the 1 SD from their previous week & 16X to the downside over the past year. If this was true, no one would sell spreads.

Thanks!

Fetcher[

apply to symlist(aapl)

set{1sdu,weekly close 1 week ago + standard deviation(5) 1 week ago}
set{1sdd,weekly close 1 week ago - standard deviation(5) 1 week ago}
set{break_above,count(weekly close > 1sdu,52)}
set{break_below,count(weekly close < 1sdd,52)}
set{broke_above,count(weekly close > 1sdu,1)}
set{broke_below,count(weekly close < 1sdd,1)}

broke_above > -1
broke_below > -1

set{total,break_above + break_below}
]







xarlor
581 posts
msg #160954
Ignore xarlor
3/22/2024 11:52:01 AM

Thank you for the more detailed request.

So a few things here.

1. I misunderstood your ask and thought you wanted a weekly SD. Easy fix, changed the SD calculation to 20 days instead. Sorted by ascending so the fewer ones are at the top now. Finally, added the 1SD up and 1SD down number that is being calculated.

2. You're talking about TastyTrade's definition of 1SD which is actually the Expected Move. Furthermore, you're looking at a 1SD move of an option, not the stock price. This is an important distinction as an option's 1SD move involves IV of that option and has a DTE calculation as well.

3. SD on stocks is usually calculated for the year. So really, what you want is 252 (number of trading days in the year). Changing the calculation below to 252 instead of 20 gets the values closer on AAPL to what you were expecting.

Here is the filter with a 1SD of 20 days. You can adjust it to your liking by changing the two 20s below to whatever you need. Just understand you're comparing 1SD of a stock price's performance over the last 20 days vs TastyTrade's Expected Move of a particular option that factors IV and DTE.

Fetcher[
s&p 500
set{1sdu,close 1 day ago + standard deviation(20) 1 day ago}
set{1sdd,close 1 day ago - standard deviation(20) 1 day ago}
set{break_above,count(close > 1sdu,252)}
set{break_below,count(close < 1sdd,252)}
set{broke_above,count(close > 1sdu,1)}
set{broke_below,count(close < 1sdd,1)}

broke_above > -1
broke_below > -1

set{total,break_above + break_below}

draw 1sdu on plot price
draw 1sdd on plot price

add column separator
add column 1sdu {1SD above}
add column 1sdd {1SD below}
add column separator
add column break_above
add column break_below
add column separator
add column total
sort by column 9 ascending
]



15minofPham
169 posts
msg #160955
Ignore 15minofPham
3/22/2024 12:47:51 PM

Awesome job Xarlor! Thank you for the clarification on TT. I'll play around with it and let you know.

15minofPham
169 posts
msg #160956
Ignore 15minofPham
3/22/2024 2:45:31 PM

I changed it to weekly so if I'm doing it correctly, selling a Put Spread on NVDA has been 100% profitable over the past year.

Fetcher[
optionable
price above 10
Average Volume(63) above 5000000

set{1sdu, weekly close 1 week ago + standard deviation(20) 1 week ago}
set{1sdd, weekly close 1 week ago - standard deviation(20) 1 week ago}
set{break_above,count(weekly close > 1sdu,52)}
set{break_below,count(weekly close < 1sdd,52)}
set{broke_above,count(weekly close > 1sdu,1)}
set{broke_below,count(weekly close < 1sdd,1)}

broke_above > -1
broke_below > -1

set{total,break_above + break_below}

draw 1sdu on plot price
draw 1sdd on plot price

add column separator
add column 1sdu {1SD above}
add column 1sdd {1SD below}
add column separator
add column break_above
add column break_below
add column separator
add column total
sort by column 10 ascending

chart-display is weekly
]



xarlor
581 posts
msg #160962
Ignore xarlor
3/23/2024 1:15:50 AM

Not exactly. I ran a backtest on my OptionAlpha account and there were 5 losses. If you have different criteria or exit strategies, let me know and I can run it with those.

Capture

danny1961
1 posts
msg #160964
Ignore danny1961
3/23/2024 9:27:30 AM

I'm looking for help with adding language to existing filter scans that will include option trading ideas such as include stocks that are optionable or exclude ones that are not. Setting minimum open interest requirements as well as setting current IV percentile levels favorable to buying strategies vs. selling strategies.
Any input is appreciated.
Thanks,
Danny

xarlor
581 posts
msg #160965
Ignore xarlor
3/23/2024 10:37:13 AM

I'm looking for help with adding language to existing filter scans that will include option trading ideas such as include stocks that are optionable or exclude ones that are not. Setting minimum open interest requirements as well as setting current IV percentile levels favorable to buying strategies vs. selling strategies.
StockFetcher does not have open interest nor IV percentile.
For only tickers with options, include the word 'optionable' at the top of your filter.

StockFetcher Forums · General Discussion · Weekly count of one standard deviation moves<< 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 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.