Calculate boundries within which $r$ remains above a critical value given correlation coefficient $(x,f(x)) =...
up vote
0
down vote
favorite
I'm experimenting with a trading indicator based on the correlation of the closing price of a day and the simple moving average of P periods. When the correlation is above certain threshold, I need to determine at what closing price the correlation of this day will be go below that threshold.
Example:
y, is the simple moving average of 5 periods, starting at t4.
r, is calculated with previous 5 periods.
t0: x0=1, y0=(1)/1
t1: x1=2, y1=(1+2)/2
t2: x2=3, y2=(1+2+3)/3
t3: x3=4, y3=(1+2+3+4)/4
t4: x4=5, y4=(1+2+3+4+5)/5 ,r4=1
t5: x5=7, y5=(2+3+4+5+7)/5 ,r5= 0.9974
t6: x6=6, y6=(3+4+5+7+6)/5 ,r6=0.8826
t7: x7=8, y7=(4+5+7+6+8)/5 ,r7= 0.906
t8: x8=9, y8=(5+7+6+8+9)/5 ,r8= 0.917
Q: t9: x9=?, y9=(7+6+8+9+x9)/5, r9=0.9
How do I get x9 (nearest to x8) for r9=0.9.
I'd like to know if there's a general solution so that f(x) may not necessarily be the simple moving average but another linear function.
Thanks in advance.
Edit: Ok no more edits. Sorry for all the mess I hope you get what I'm looking for.
correlation
New contributor
add a comment |
up vote
0
down vote
favorite
I'm experimenting with a trading indicator based on the correlation of the closing price of a day and the simple moving average of P periods. When the correlation is above certain threshold, I need to determine at what closing price the correlation of this day will be go below that threshold.
Example:
y, is the simple moving average of 5 periods, starting at t4.
r, is calculated with previous 5 periods.
t0: x0=1, y0=(1)/1
t1: x1=2, y1=(1+2)/2
t2: x2=3, y2=(1+2+3)/3
t3: x3=4, y3=(1+2+3+4)/4
t4: x4=5, y4=(1+2+3+4+5)/5 ,r4=1
t5: x5=7, y5=(2+3+4+5+7)/5 ,r5= 0.9974
t6: x6=6, y6=(3+4+5+7+6)/5 ,r6=0.8826
t7: x7=8, y7=(4+5+7+6+8)/5 ,r7= 0.906
t8: x8=9, y8=(5+7+6+8+9)/5 ,r8= 0.917
Q: t9: x9=?, y9=(7+6+8+9+x9)/5, r9=0.9
How do I get x9 (nearest to x8) for r9=0.9.
I'd like to know if there's a general solution so that f(x) may not necessarily be the simple moving average but another linear function.
Thanks in advance.
Edit: Ok no more edits. Sorry for all the mess I hope you get what I'm looking for.
correlation
New contributor
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm experimenting with a trading indicator based on the correlation of the closing price of a day and the simple moving average of P periods. When the correlation is above certain threshold, I need to determine at what closing price the correlation of this day will be go below that threshold.
Example:
y, is the simple moving average of 5 periods, starting at t4.
r, is calculated with previous 5 periods.
t0: x0=1, y0=(1)/1
t1: x1=2, y1=(1+2)/2
t2: x2=3, y2=(1+2+3)/3
t3: x3=4, y3=(1+2+3+4)/4
t4: x4=5, y4=(1+2+3+4+5)/5 ,r4=1
t5: x5=7, y5=(2+3+4+5+7)/5 ,r5= 0.9974
t6: x6=6, y6=(3+4+5+7+6)/5 ,r6=0.8826
t7: x7=8, y7=(4+5+7+6+8)/5 ,r7= 0.906
t8: x8=9, y8=(5+7+6+8+9)/5 ,r8= 0.917
Q: t9: x9=?, y9=(7+6+8+9+x9)/5, r9=0.9
How do I get x9 (nearest to x8) for r9=0.9.
I'd like to know if there's a general solution so that f(x) may not necessarily be the simple moving average but another linear function.
Thanks in advance.
Edit: Ok no more edits. Sorry for all the mess I hope you get what I'm looking for.
correlation
New contributor
I'm experimenting with a trading indicator based on the correlation of the closing price of a day and the simple moving average of P periods. When the correlation is above certain threshold, I need to determine at what closing price the correlation of this day will be go below that threshold.
Example:
y, is the simple moving average of 5 periods, starting at t4.
r, is calculated with previous 5 periods.
t0: x0=1, y0=(1)/1
t1: x1=2, y1=(1+2)/2
t2: x2=3, y2=(1+2+3)/3
t3: x3=4, y3=(1+2+3+4)/4
t4: x4=5, y4=(1+2+3+4+5)/5 ,r4=1
t5: x5=7, y5=(2+3+4+5+7)/5 ,r5= 0.9974
t6: x6=6, y6=(3+4+5+7+6)/5 ,r6=0.8826
t7: x7=8, y7=(4+5+7+6+8)/5 ,r7= 0.906
t8: x8=9, y8=(5+7+6+8+9)/5 ,r8= 0.917
Q: t9: x9=?, y9=(7+6+8+9+x9)/5, r9=0.9
How do I get x9 (nearest to x8) for r9=0.9.
I'd like to know if there's a general solution so that f(x) may not necessarily be the simple moving average but another linear function.
Thanks in advance.
Edit: Ok no more edits. Sorry for all the mess I hope you get what I'm looking for.
correlation
correlation
New contributor
New contributor
edited 2 days ago
New contributor
asked 2 days ago
Pedro S.
11
11
New contributor
New contributor
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago
add a comment |
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Pedro S. is a new contributor. Be nice, and check out our Code of Conduct.
Pedro S. is a new contributor. Be nice, and check out our Code of Conduct.
Pedro S. is a new contributor. Be nice, and check out our Code of Conduct.
Pedro S. is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000776%2fcalculate-boundries-within-which-r-remains-above-a-critical-value-given-correl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'm not sure I understand your problem. Can you give a small example and update the question?
– tpb261
2 days ago
Just added an example. Thanks.
– Pedro S.
2 days ago
I think this example might be not enough to understand the problem. At least for me.
– Jaroslaw Matlak
2 days ago
@Jaroslaw Matlak , I changed the example, I hope it's clearer.
– Pedro S.
2 days ago