[UPDATE] rewritten marketdata.tcl, added new api