RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



IB Portfolio and IB Pending Orders Expand / Collapse
Message
Posted 5/31/2009 18:30:03 Post #8653
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
How do I can 'read' from RE program the IB's account live pending orders and live portfolio?
I have test the following in the Startup() method, but that write nothing in the file, although I have cca 15 pending IB positions and RE with Live System works properly.
public override void Startup()
{
// Perform initialization here.
String filename;
String s="";
filename="c:/Temp/OpenPos.csv";
using (StreamWriter sw = new StreamWriter(filename)) {
sw.WriteLine("Size;EntryPrice;Symbol");
foreach (Position oo in this.PositionManager.GetOpenPositions()) {
s=""+oo.CurrentSize+";"+oo.EntryPrice+";"+oo.Symbol;
sw.WriteLine(s);
}
sw.WriteLine("All done!");

}

}
Can everybody post a sample code with the solution.
Thanks a lot.
Hali
Posted 6/1/2009 07:38:28 Post #8661
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
This isn't really something we support. And if you're referring to open positions/orders that are currently in play while the system is running, those are not accessible from a file. There is a file called OpenPositions.xml that we persist between sessions. You could parse this yourself to pick up information, but OpenPositions.xml is processed by RightEdge before Startup() is called.

RLHali (5/31/2009)
How do I can 'read' from RE program the IB's account live pending orders and live portfolio?
I have test the following in the Startup() method, but that write nothing in the file, although I have cca 15 pending IB positions and RE with Live System works properly.
public override void Startup()
{
// Perform initialization here.
String filename;
String s="";
filename="c:/Temp/OpenPos.csv";
using (StreamWriter sw = new StreamWriter(filename)) {
sw.WriteLine("Size;EntryPrice;Symbol");
foreach (Position oo in this.PositionManager.GetOpenPositions()) {
s=""+oo.CurrentSize+";"+oo.EntryPrice+";"+oo.Symbol;
sw.WriteLine(s);
}
sw.WriteLine("All done!");

}

}
Can everybody post a sample code with the solution.
Thanks a lot.
Hali
Posted 6/1/2009 09:11:16 Post #8662
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
Thank you.
Hali
Posted 6/23/2009 23:23:44 Post #8870
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
Bill, I am curious to know how once RE has recovered its position and order state from OpenPositions.xml, RE then matches up and "Broker Side" order IDs.

By this I mean, what handles (IDs) does it use to manage those orders at the broker. Is there another dictionary mapping RE IDs to Broker IDs or is there a mapping function that can always generate a Broker ID from an RE ID?

Posted 6/24/2009 07:53:33 Post #8871
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
Yes, there's a mapping between the two. If you're looking at the RightEdge TWS plugin source code, the variable is a Dictionary named openOrders.

smersh (6/23/2009)
Bill, I am curious to know how once RE has recovered its position and order state from OpenPositions.xml, RE then matches up and "Broker Side" order IDs.

By this I mean, what handles (IDs) does it use to manage those orders at the broker. Is there another dictionary mapping RE IDs to Broker IDs or is there a mapping function that can always generate a Broker ID from an RE ID?

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 7:29pm

2005-2007 © RightEdge Systems