South Korean shares trimmed earlier gains to close almost unchanged on Wednesday as retail investors offloaded stocks ahead of the ex-dividend date. The benchmark Korea Composite Stock Price Index (KOSPI) edged up 0.43 point, or 0.02 percent, to close at 1,982.25. Trading volume stood at 420 million shares worth 3.47 trillion won (3.24 billion U.S. dollars). The KOSPI started higher to trade above 2,000 points in early trading thanks to purchases by both foreigners and local institutions, but the index pared its initial gains mostly throughout the session as retail investors offloaded stocks ahead of the ex-dividend date. Foreign investors maintained their buying spree for 18 straight sessions by purchasing a net 243.8 billion won worth of local shares, and institutional investors bought a net 248.7 billion won worth of stocks. Retail investors dumped a net 477.9 billion won worth of shares, preventing the KOSPI to making a strong advance. Investors tended to sell stocks ahead of the ex-dividend date scheduled for Thursday this year as they will lose the right to receive dividend payout for the year after the ex-dividend date. The Korea Exchange estimated that the KOSPI would theoretically decline by 1.19 percent on Thursday due to the ex-dividend effect, saying that the KOSPI should subtract the amount of dividend payout from stock prices. Among large-cap shares, gainers outnumbered decliners. Top steelmaker POSCO rose 0.43 percent to 351,500 won, and the nation\' s biggest life insurer Samsung Life Insurance added 0.31 percent to 96,400 won. Memory chip giant SK Hynix advanced 1.19 percent to 25,450 won, but market bellwether Samsung Electronics inched down 0.27 percent to 1,470,000 won. Auto shares gained ground. Top automaker Hyundai Motor rose 0. 22 percent to 223,000 won, and its affiliate Kia Motors gained 0. 35 percent to 58,000 won. The nation\'s largest auto parts maker Hyundai Mobis climbed 1.36 percent to 298,000 won. Wireless carriers ended in negative terrain after the Korea Communications Commission slapped them with fines and business suspensions for doling out discriminative subsidies. Top mobile carrier SK Telecom retreated 0.63 percent to 158,500 won, and the No.2 player KT declined 1.45 percent to 37,500 won. Leading chemical firm LG chem fell 0.6 percent to 332,00 won, and the world\'s largest shipbuilder Hyundai Heavy Industries inched down 0.21 percent to 239,500 won. The local currency finished at 1,073.2 won against the greenback, up 1.0 won from Monday\'s close. Bond prices ended lower. The yield on the liquid three-year treasury notes added 0.01 percentage point to 2.88 percent, and the return on the benchmark five-year government bonds rose 0.02 percentage point to 3.05 percent.