How is the direction of intercept determined? Let's say I have a equation like as below (linear regression)
Y = intercept + x1+x2+x3...xn
intercept = 30
positive coeff sum = 40
negative coeff sum = -10
So, the final outcome becomes like as below
30 + 40 - 10 = 60
My question is why does intercept have to be +30?
It could have been -30 as well?
Whether logistic or linear regression, how is the sign of intercept determined?
Does intercept only take positive values always?
 A: It is determined by the estimation method you select. In OLS, the regression parameters $\hat\beta_{OLS}$ are determined by the following.
$$
\hat\beta_{OLS}=(X^TX)^{-1}X^Ty
$$
Whatever the result of that calculation turns out to be is the answer.
Logistic regression does not have a closed-form equation for its parameter vector, but it can be calculated as the parameter vector that minimizes the crossentropy loss function (same as how OLS minimizes the square loss function, which turns out to be the same as the $\hat\beta_{OLS}$ above). Whatever the intercept value is in the parameter vector is the intercept in the logistic regression; any real number is possible.
A: For linear regression, the intercept can be positive or negative (or 0), and simply represents the value of the mean of Y when the hyperplane (your linear relationship) passes through the point where all of the explanatory variables are 0 (i.e, x=(0,0,...,0).)  If you have data around (0,0,...,0), this point is meaningful, otherwise it's just a starting point for estimating the value of y for any x in your data range and doesn't have much practical value, itself.
For a logistic regression, it can also be positive or negative (or 0).  Being negative, here, means that the probability (e^B0/(1+e^B0)) at x = (0,0,...,0) will be < 0.5 and being positive means that it will be > 0.05.  Again, though, its practical value will depend on whether you are interested in (and have data around) that point.
Side note: I can't tell from the original question whether you are confusing variables and coefficients, and possibly missing that they are two different but required elements.  For example, we might normally see:
y = intercept + B1X1 + B2X2 + ... + BnXn + noise
where each Bi is the coefficient (slope) of the corresponding Xi variable. The intercept is often written as B0.
The sum of the coefficients (your "coeff sum"), then, would only matter if you happened to be looking at the point where all of the X's have a value of 1.  That's a very, very specific case that is rarely of particular interest (even with all binary variables, that's just one particular case.)
