Profile Picture

Custom Broker Plugin (Account Value & Order Help Needed)

Posted By erockenbach 7 Years Ago

Custom Broker Plugin (Account Value & Order Help Needed)

Message
Posted Thursday October 07 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.

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 Thursday October 07 2010
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 Friday October 08 2010
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 Friday October 08 2010
First off thank you for the quick response.  Smile

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 Friday October 08 2010
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 Saturday October 09 2010
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!


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems