Who's the broker and whose API are you using? You may have better luck posting on the support forum for that particular Broker/API you plan to use.
I suggest you investigate the possibility of compartmentalizing your project. Develop separately three portions of your system...
1.) use your brokers API to place orders
2.) use a separate data vendors API to write data to history for processing and backtesting.
3.) write a app to process the data and make trading decisions.
You see what I'm saying? You may have a broker whose great at processing orders but whose data feed sucks. You also want to be able to pick up the whole operation and move to another broker in which case you only have to rewrite one piece of your project. Another benefit of compartmentalizing is that you will be able to team with several people who can work on step 3 which is the biggest and most important part.