Market losses from a SALE of those market assets negate market(capital)gains derived from dividends or stock sales or sales of an asset. These events should occur within the same year.
But remember--you can hold your losses for future use against capital gains. It isn't always the smartest move to negate gains--especially in a year where your income is low. Talk to your acct.
And dont forget the $3000 deduction against ordinary income(but again dont use this if your income is very very low--which can be the case for the self employed).