- Sum of 1+2+3+4+5 will never equal 5.
- Are those variables global? Not local?
I just want sum_y = Close[1]+Close[2]+Close[3]+Close[4]+Close[5]
Ye you are right with sum_x. I dont need to calculate that for linear regression.
Variables are global.
insub: Variables are global.
Then they are not being reset to zero.
sum_x += 1;
WHRoeder:
Then they are not being reset to zero.
I changed it and it works now!! thx WHRoeder.
Then they are not being reset to zero.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I want to code a linear regression of the 5 last Bars and i need the summation of the closes of the last 5 bars so i wrote this.
So for example now sum_x should be always 5 but already after a few seconds there is 1000!! and with sum_y there is the same problem too.