Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have this idea that I'm trying to code but i'm getting mixed results. The indicator will take the previous period based on options expiration and find out 1 standard deviation and plot lines above and below the close of the period.
What i'm finding is that i'm almost there but can't figure out why the value grows each period.... Its like they are being summed up. When it is finished it will plot over price similar to a pivot but putting it below the price you can see what i'm talking about. Screenshot below.
@rmejia Thanks, that is an interesting indicator and I haven't seen it before..... But its not quite getting at what i'm hoping to find.
I'm realizing that aggregationPeriod.OPT_EXP is giving me the close of every option ex period which is not what I want. I wish I was a little better at understand tos coding. I need the aggregation period to be day and I need it to start and end with the Opt exp time frame of 1 month. I really can't figure out how to do that.
Here is what the indicator will look like. SPY's last options exp was from 1/21 to 2/21. Take the stdev of all the closes of that period (using yahoo finance data) you get a standard deviation of 3.18. Now take the close of the last options ex period of 183.91 and add 3.18 to that and subtract 3.18 to that and you end up with a chart that looks like this below.
I'm proposing that those levels are going to be super important. Big funds are going to sell premium above / below 1 and 2 standard deviations and are going to protect those levels.
Anyone that can help code this it would be much appreciated!
@rmejia Thank you so much for your work on this! Awesome it does what I need it to. One small tweak on it would be to define the number of days during the previous month and then have that be the length. I noticed if I make the length 19 days it comes out with the right values for the last period. Each month has a slightly different number of trading days and that would be the only thing that would make this a done deal. Thanks for your work already and getting it to this point!
The length parameter defines the aggregation period lookback. The aggregation period being Opt Exp, a length of 1 is the previous Option Expiration, a length of 19 is the 19 previous Opt Exp's of which it finds the high and low of that period and calculates the standard deviation of that. Selecting the aggregation period Opt Exp it automatically calculates the days in the opt exp of that month.
@rmejia Awesome I guess I was just misinterpreting it and what it meant. Looking at it now its complete! And I can easily get 2 standard deviations up and down as well. Thank you so much for your work on this. I'm sure others may find this useful as well.