There are call and put options on the same underlying asset, with the same expiry, $T$, and with strikes $K_c=(k_c^1, k_c^2, \ldots, k_c^m)$ and $K_p=(k_p^1, k_p^2, \ldots, k_p^m)$, $S_t$ is a price of the underlying asset at calendar time, $0\leq t \leq T$, $\hat{S}_T$ is a forecasting price of the underlying asset at the time $T$.
Suppose you would like to construct a negative cost portfolio at the start time $t=0$ by combining long and short positions in put and call European-style contracts based on the same underlying asset with different strikes.
Let $X_c=(x_1^c, x_2^c, \ldots, x_m^c)$, $X_p=(x_1^p, x_2^p, \ldots, x_m^p)$ be the number of unit of call and put options, with $x_i^c, x_i^p>0$ for buying, $x_i^c, x_i^p<0$ for selling. Denote by $C=(c_1, c_2, \ldots, c_m)$ and $P=(p_1, p_2, \ldots, p_m)$ the market prices for buying and selling of call and put options respectively.
Then the cost portfolio, $M$, at the time of purchase, $t=0$, is expressed by: $$M=\sum_{i=1}^{m} x_i^c \cdot c_i+ x_i^p \cdot p_i.$$
For the negative cost portfolio $M$ should be negative, i.e. $M<0$.
Denote by $V$ the payoff function $V(S_T, K_c, K_p, T, X)=\sum_{i=1}^{m} x_i^c (\hat{S}_T-k_c^i)^+ + x_i^p (k_p^i - \hat{S}_T)^- - M$
How to show that the payoff $V(T)$ at time $T$ is non-negative ($V≥0$)?
The example of the portfolio and payoff at $t=0$ and $t=T$ in R
is below
X_c <- c(-3, -7, 2, 0, -2, 10);
X_p <- c( 1, 1, 7, 4, -5, -8);
K_c <- c(8050, 8150, 8250, 8350, 8400, 8500);
K_p <- c(7850, 7950, 8050, 8150, 8250, 8350);
S_hat_T <- 8400;
C <- c(48.0, 10.0, 0.9, 0.5, 0.3, 0.2);
P <- c( 2.2, 10.5, 35.0, 100.0, 183.0, 343.0);
M <- sum(X_c*C) + sum(X_p*P);
M
# [1] -3212.1
V <- sum(X_c*max(S_hat_T-K_c,0)) + sum(X_p*max(K_p - S_hat_T,0))
V
#[1] 0
V-M
#[1] 3212.1
$M=-3212.1<0$, therefore, the portfolio having negative cost at time $t=0$, and $V=0$, at the time $T$.
My question is what is wrong with what I am doing?
Update. After noob2's comment. I tried to find the rule of the cost portfolio calculation, and the book by Eliezer Z Prisman (2000) Pricing derivative securities: an interactive, dynamic environment with Maple V and Matlab was found.