I have data on Bitcoin price and S&P500 price development from Oct. 6th 2020 - Dec. 27th 2013, in this order. The dates are strings and the price development are numeric (doubles). Below I have pasted a data.

My variable bitc is the Bitcoin price development.
My variable SP500 is the price development in the S&P500 index.

Dataex:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str13 date double(bitc SP500)
"Oct 06, 2020"  10621.66 3360.95
"Oct 05, 2020"     10804 3408.63
"Oct 02, 2020"  10585.16 3348.44
"Oct 01, 2020"  10623.33  3380.8
"Sep 30, 2020"  10787.62    3363
"Sep 29, 2020"  10848.83 3335.47
"Sep 28, 2020"  10721.33  3351.6
"Sep 25, 2020"  10702.29 3298.46
"Sep 24, 2020"  10745.55 3246.59
"Sep 23, 2020"  10225.86 3236.92
"Sep 22, 2020"  10538.46 3315.57
"Sep 21, 2020"  10462.26 3281.06
"Sep 18, 2020"  10944.59 3319.47
"Sep 17, 2020"  10948.99 3357.01
"Sep 16, 2020"   10974.9 3385.49
"Sep 15, 2020"  10796.95  3401.2
"sep. 14, 2020" 10680.84 3383.54
"sep. 11, 2020" 10400.91 3340.97
"sep. 10, 2020" 10363.14 3339.19
"sep. 09, 2020" 10242.35 3398.96
"sep. 08, 2020" 10131.52 3331.84
"sep. 07, 2020" 10369.56       .
"sep. 04, 2020" 10511.81 3426.96
"sep. 03, 2020"  10245.3 3455.06
"sep. 02, 2020" 11414.03 3580.84
"sep. 01, 2020" 11970.48 3526.65
"aug. 31, 2020" 11680.82 3500.31
"aug. 28, 2020"  11542.5 3508.01
"aug. 27, 2020"  11323.4 3484.55
"aug. 26, 2020" 11488.36 3478.73
"aug. 25, 2020" 11366.14 3443.62
"aug. 24, 2020"  11774.6 3431.28
"aug. 21, 2020" 11592.49 3397.16
"aug. 20, 2020" 11878.37 3385.51
"aug. 19, 2020" 11758.28 3374.85
"aug. 18, 2020" 11991.23 3389.78
"aug. 17, 2020"  12254.4 3381.99
"aug. 14, 2020" 11768.87 3372.85
"aug. 13, 2020" 11784.14 3373.43
"aug. 12, 2020" 11584.93 3380.35
"aug. 11, 2020" 11410.53 3333.69
"aug. 10, 2020" 11878.11 3360.47
"aug. 07, 2020" 11601.47 3351.28
"aug. 06, 2020" 11779.77 3349.16
"aug. 05, 2020" 11747.02 3327.77
"aug. 04, 2020" 11205.89 3306.51
"aug. 03, 2020" 11246.35 3294.61
"jul. 31, 2020" 11323.47 3271.12
"jul. 30, 2020" 11111.21 3246.22
"jul. 29, 2020" 11100.47 3258.44
"jul. 28, 2020" 10912.82 3218.44
"jul. 27, 2020" 10990.87 3239.41
"jul. 24, 2020"  9536.89 3215.63
"jul. 23, 2020"  9581.07 3235.66
"jul. 22, 2020"  9525.36 3276.02
"jul. 21, 2020"  9374.89  3257.3
"jul. 20, 2020"  9164.23 3251.84
"jul. 17, 2020"  9151.39 3224.73
"jul. 16, 2020"  9132.23 3215.57
"jul. 15, 2020"  9192.84 3226.56
"jul. 14, 2020"  9243.21 3197.52
"jul. 13, 2020"  9243.61 3155.22
"jul. 10, 2020"  9278.81 3185.04
"jul. 09, 2020"  9277.97 3152.05
"jul. 08, 2020"  9428.33 3169.94
"jul. 07, 2020"  9252.28 3145.32
"jul. 06, 2020"  9375.47 3179.72
"jul. 03, 2020"   9087.3       .
"jul. 02, 2020"  9123.41 3130.01
"jul. 01, 2020"  9228.33 3115.86
"jun. 30, 2020"  9137.99 3100.29
"jun. 29, 2020"  9190.85 3053.24
"jun. 26, 2020"  9162.92 3009.05
"jun. 25, 2020"  9264.81 3083.76
"jun. 24, 2020"  9313.61 3050.33
"jun. 23, 2020"  9629.66 3131.29
"jun. 22, 2020"  9648.72 3117.86
"jun. 19, 2020"  9288.02 3097.74
"jun. 18, 2020"  9411.84 3115.34
"jun. 17, 2020"  9480.26 3113.49
"jun. 16, 2020"  9538.02 3124.74
"jun. 15, 2020"   9450.7 3066.59
"jun. 12, 2020"  9480.84 3041.31
"jun. 11, 2020"  9321.78  3002.1
"jun. 10, 2020"  9870.09 3190.14
"jun. 09, 2020"   9795.7 3207.18
"jun. 08, 2020"  9771.49 3232.39
"jun. 05, 2020"  9665.53 3193.93
"jun. 04, 2020"  9800.64 3112.35
"jun. 03, 2020"  9656.72 3122.87
"jun. 02, 2020"   9529.8 3080.82
"jun. 01, 2020" 10167.27 3055.73
"May 29, 2020"   9439.12 3044.31
"May 28, 2020"   9525.75 3029.73
"May 27, 2020"   9181.02 3036.13
"May 26, 2020"   8835.05 2991.77
"May 25, 2020"   8906.93       .
"May 22, 2020"   9182.58 2955.45
"May 21, 2020"   9081.76 2948.51
"May 20, 2020"   9522.98 2971.61
end
I am interested in finding Pearsons correlation for chosen sub-periods Bitcoin price and S&P 500 price development.I have a number of 1767 observations from the period Dec. 27th 2013 - October 6th 2020.

The mean for the sample of Bitcoin price for the whole period is 4045.81.

Lets say I want to know what sub-periods (date start to date end) the Bitcoin price deviates more than 10 % from the mean value of 4045.81.
For instance:
From Jun. 05, 2020 - Jul. 10., 2020,
From May 15., 2018 - Aug. 17., 2018,
From Jan. 10. 2014 - Mar. 3. 2014
the Bitcoin price deviates more than 10 % from the mean value.

Is there any way I can code a command that will give me a result like this?

Thank you so much in advance.

/Tor Magne