Suppose $M$ and $N$ are continuous martingales, $K$ and $H$ are processes that can be written in the form: $$ K_s = \sum_{i=0}^p Y_{a_i}\mathbb{1}_{(a_i,a_{i+1}]}(s),\quad H_s = \sum_{j=0}^q X_{a_j}\mathbb{1}_{(a_j,a_{j+1}]}(s) $$ with each $Y_{a_i}$ $\mathcal{F}_{a_i}$-measurable. For such processes we define: $$ \int_0^t K_s dM_s = \sum_{i=0}^p Y_{a_i}(M_{t \land a_{i+1}}-M_{t \land a_i}) $$ I'm trying to compute the cross-variation $$ \left\langle \int_0^{.} K_s dM_s,\int_0^{.} H_s dN_s \right\rangle_t $$ but I get lost in the computation of: $$ \left\langle \sum_{i=0}^p Y_{a_i}(M_{\cdot \land a_{i+1}} - M_{\cdot \land a_{i}}) ,\sum_{j=0}^q X_{a_j}(N_{\cdot \land a_{j+1}} - N_{\cdot \land a_{j}})\right\rangle_t $$ obtaining something like: $$ \sum_{i=0}^p \sum_{j=0}^q Y_{a_i}X_{a_j}\langle M_{\cdot \land a_{i+1}} - M_{\cdot \land a_{i}}, N_{\cdot \land a_{j+1}} - N_{\cdot \land a_{j}} \rangle_t $$ What am I doing wrong?
P.S. The result should be: $$ \int_0^t K_s H_s d \langle M, N \rangle_s $$