                                     (reify com.ib.controller.ApiConnection$ILogger
                                       (log [this s] (print s)))))
 
+(defn create-row []
+  (reify
+    com.ib.controller.ApiController$ITopMktDataHandler
+    (tickPrice [this tick-type p auto-execute?]
+      (println (format "tick: %s price: %s" tick-type  p)))
+    (tickSize [this tick-type size]
+      (println (format "type: %s size: %s" tick-type " " size)))
+    (tickString [this tick-type val]
+      (println (format  "Last time, type: %s value: %d") val))
+    (marketDataType [this data-type]
+      (println "Frozen? " (= data-type com.ib.controller.Types$MktDataType/Frozen)))
+    (tickSnapshotEnd [this] (println "tick snapshot end"))
+    ))
+
 
 (defn start []
-  (let [api (api-ctrl)]
+  (let [api (api-ctrl)
+        c (create-contract "VXX")
+        row (create-row)]
     (.connect api "localhost" 7497 5)
+    (.reqTopMktData api c "" false row)
+
     (Thread/sleep 1000)
+    (.cancelTopMktData api row)
     (.disconnect api)))
 
 
 (defn -main
   "the main function"
   []
- (start)
-
-
-      )
+  (start))


    ))

(defn api-ctrl []
  (com.ib.controller.ApiController. (create-controller)
                                    (reify com.ib.controller.ApiConnection$ILogger

(ns ibclj.core
  [:import  com.ib.controller.ApiController])


(defn create-controller []
  (reify
