RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Custom Broker Plugin (Account Value & Order... Expand / Collapse
Message
Posted 10/7/2010 22:52:26 Post #12330
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Two questions wrapping up a custom broker interface and since it the first one I've completed I'm stumbling on two issues.

1.  Account details such as account value, equity, etc aren't being set from brokerage even though I'm implementing the following methods.

GetShortedCash()  GetBuyingPower()  GetMargin()  and SetAccountState() with brokeroverride set to true...  after values are set I'm still getting the RE configuration for the account value from the system data (SystemData.AccountValue).  Obviously I'm missing something here but not sure where.

2. My orders successfully move from Pending to Open by triggering an OrderUpdated event along with adding a fill to the order itself, but how do I trigger a close to an open order back to RE and the details about the close price?

I'm in build 25.

Thanks in advace,

Eric Rockenbach

Posted 10/7/2010 23:21:59 Post #12331
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
On Item number two I believe I just add another fill and call the OrderUpdated event again.. going to give that a try, but I'm still stuck on the account value issue mentioned above.
Posted 10/8/2010 08:24:35 Post #12334
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
SetAccountState is used to synchronize RightEdge with the broker where the AccountValue, margin, cash, buying power, etc are values you provide to RightEdge. Are you saying that your broker does not give you this information? If that's the case, the only thing I can think of is making it a broker setting and having the user input that information. Not really a great a solution, but I'm not sure how else to handle it if the broker doesn't provide via their API.

erockenbach (10/7/2010)
Two questions wrapping up a custom broker interface and since it the first one I've completed I'm stumbling on two issues.

1. Account details such as account value, equity, etc aren't being set from brokerage even though I'm implementing the following methods.

GetShortedCash()
GetBuyingPower() GetMargin() and SetAccountState() with brokeroverride set to true... after values are set I'm still getting the RE configuration for the account value from the system data (SystemData.AccountValue). Obviously I'm missing something here but not sure where.

Eric Rockenbach
Posted 10/8/2010 08:38:17 Post #12335
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
First off thank you for the quick response. 

In the Method SetAccountState I set the pending and open orders as well as set the brokeroverride=true.  When the broker plugin is loading I set the values for GetShortedCash()  GetBuyingPower()  GetMargin() and I have everything running in VS 2010 and see that it hits the break points.  Orders process, etc through my api, but when accessing the AccountValue through the SymbolScriptBase it shows the default value from the configuration (properties) panel in RE.  I'm not sure what else I need to do.

-E

Posted 10/8/2010 16:01:39 Post #12337
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
SetAccountState is for synchronizing the open positions and pending orders, but shouldn't affect the account value.

IBroker.GetBuyingPower() should be called when you access SystemData.AccountValue if you are running a live system and SystemData.UseBrokerBuyingPower is set to true. You can set this in your system's Startup method.

IBroker.GetMargin() and IBroker.GetShortedCash() aren't used at all.

Thanks,
Daniel
Posted 10/9/2010 17:32:56 Post #12340
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Ah this is the key ingrident "SystemData.UseBrokerBuyingPower"  I didn't know there was a switch from the RE code (SystemData) that explicitly had to be set to true to force it to use broker values over standard configuration properties.  Thank you for your help!
« 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, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 4:53pm

2005-2007 © RightEdge Systems