use the python API. its so much faster to develop in and if you're worried about speed dont use IB.
from sys import argv
from time import sleep, strftime
from trading import *
from baseapp import *
import numpy as np
from ib.ext.Contract import Contract
from ib.ext.Order import...