fact is you talk about IB here in this thread and have NO SINGLE IDEA how IB and TWS and its Gateway work, you made that apparently clear. Other users, such as vicirek pointed you in the right direction but you are ignorant. Then you made a tool out of yourself and your stupid OOP comments. Good luck with your Python IB execution module, written by someone who has no clue about how the IB interface works, has no clue about OOP languages, and suddenly claims to know the inside scoop of BNP and SocGen. You are just a fart, on ignore.
what an angry little turd you make, where is your thread explaining how IB works ? oh wait, you didn't make one. And how user vicirek pointed me in the right direction ? wtf are you talking about ? I made pretty clear from the start that the purpose of this thread was to build a simple and functional Python module to use IB APIs. Somehow, you got offended when I pointed out that OOP wasn't necessary for building batch trading applications. You sound like an angry loser, sorry to say. Why don't you go play somewhere with C# on some Microsoft forums for miserable programmers like yourself. Put me on ignore if you are so offended by those truth, since you seem to be simply another coward. gee, who needs another angry developer :LOL:
Butterfly, this is awesome. Thanks, unfortunately I had to move on to programming my app in Java. But I'm sure others will find this useful. Is the ft variable now just a string of the OrderStatus() message? I could just use string processing to get the filled=0 value (0) into a "filled" variable?
don't pay attention to "ft", it's a file descriptor to handle an open file to write "logs" and "trades" in my code. the function can also be written like this: Code: # Define a function to catch "OrderStatus" and "OrderState" type messages from IB Server def status_orders(msg): print "Status: ", msg.typeName, msg.orderId, msg.status, msg.whyHeld, msg.avgFillPrice, msg.filled, msg.remaining the "msg" variable is an object and msg.filled is the attribute that contains the number of shares filled, so there is no string transformation or anything else to do. It's already assigned and it's numeric. Therefore you could use it like any other numeric variables. See below: Code: if msg.filled == 0: print "Trades not filled, still in progress" else: print "Trades Done, Average Fill Price = %s, Shares Remaining = %s" % (msg.avgFillPrice, msg.remaining) Voila !!!
Butterfly, I ran across a short IBPy tutorial by sentdex on YouTube. Also, many videos he has uploaded on just about anything Python: https://www.youtube.com/user/sentdex/videos
Hello, I'm trying to write simple gui for IB API. I have already connected to reqMktData without any problems. Now i'm trying to connect to reqMktDepth, but I don't obtain any data or errors. I'm working on demo IB API demo version. Any ideas why it happens? I call it this way. Code: reqMktDepth(requestReference, contract, 20, new Vector<TagValue>()); It's same like reqMktData. Thx for help!
you just set create a new order and set m_parentId to the initial order def createBracketOrder(origOrder, oID, tif, orderType,price): bracketoptOrder = Utils.makeOptOrder( Side.flipside(origOrder.m_action), oID, tif, orderType,price,origOrder.m_totalQuantity) bracketoptOrder.m_parentId = origOrder.m_orderId return bracketoptOrder
Thank you 2rosy. I am not Python expert but I did go through your tutorial http://nbviewer.ipython.org/github/audubon/ibpytutorial/blob/master/IBpyTrading.ipynb Can you please provide a working example calling Utils.makeOptOrder