I'm new to thinkScript and was hoping someone could help. I wanted to create an indicator that shows the first and second deviation level of the range of a stock (not SMA or EMA). By "range," I simply mean the [High] minus [Low] daily movement over X number of candles. I'll sacrifice not taking into account gap ups/downs in after hours so it's a little bit different than finding the standard deviation of ATR. Could anyone help?
For example, if...
Day1: High = 10, Low = 5, then range = 10-5=5
Day2: High = 8, Low = 4, then range = 8-4=4
Day3: High = 12, Low = 2, then range = 12-2=10
Day4: High = 9, Low = 7, then range = 9-7=2
Day5: High = 7, Low = 1, then range = 7-1=6
The Standard Deviation of 5, 4, 10, 2, and 6 is 2.653. So, if on Day6, the stock opened at 6, there would be a line at 8.653 and 3.347 for the first deviation, as well as a line at 11.306 and 0.694 for the second deviation. My strategy is to buy options for a reversal after the price has reached the second deviation. In the previous example, I'd buy a call at 0.694 or a put at 11.306. Please help!
For example, if...
Day1: High = 10, Low = 5, then range = 10-5=5
Day2: High = 8, Low = 4, then range = 8-4=4
Day3: High = 12, Low = 2, then range = 12-2=10
Day4: High = 9, Low = 7, then range = 9-7=2
Day5: High = 7, Low = 1, then range = 7-1=6
The Standard Deviation of 5, 4, 10, 2, and 6 is 2.653. So, if on Day6, the stock opened at 6, there would be a line at 8.653 and 3.347 for the first deviation, as well as a line at 11.306 and 0.694 for the second deviation. My strategy is to buy options for a reversal after the price has reached the second deviation. In the previous example, I'd buy a call at 0.694 or a put at 11.306. Please help!