If your capital gains was $10k you have to pay tax on that. The $18k only applies to income (i.e. payrolled employee).
Capital gains and regular income from say, a 9-5 job, should be considered completely seperate to eachother - unles my understanding is wrong (or unless you start talking about setting upa trust in which case DYOR because i'm clueless )