I'd be happy to clarify as much as you need. There is a ReadME
with some more details on this, but it is still quite spotty.
When RightEdge is launched on a live trading system it creates an instance of the plugin to handle the broker functions. This instance of the plugin is unique, and it's bound to the instance of RightEdge from which it was created. When a plugin instance is being constructed it receives all of the service settings from RightEdge. These settings contain the file names of the trade entities and account values stores for the broker plugin to use. So, if you use the same file names you can get multiple instances of RightEdge to do the same thing, or use different file names and get different behavior. It's up to you how you want to set it up.
Design wise, to overcome the mono "global-account" there are two basic issues :
1) order routing - Since there are no facilities to directly specify an account number on an order, the broker module needs a lookup mechanism. This is where the trade entities data file comes in. You can specify the file name in your service setup inside RE. Note that there is toolbar button to edit this file on the custom service settings dialog. The contents of this file help the broker module decide what sub-account to use for each order request. (Note that there is a button on the service settings custom dialog toolbar to edit the entities file.)
2) position sizing - you can't really use the % allocations from the position manager since the balance reported to the RightEdge "global-account" reflects the sum of all detected sub-accounts. Every time an instance of the plugin receives a call from RE to check the account margin and balances, the plugin updates the AccountValuesStore data file specified in the startup options and reports the totals back to RightEdge. Thus to get a sub-account specific balance/margin for position sizing calculations a trading system must probe the account values store using code like this...
//create the avs in your system startup
FunctionObjectResult avres = AccountValuesStore.newFromSettings("your avs file name");
// deal with the error
AccountValuesStore acct_data = avres.ResultObject;
//somewhere in your trading system (ie NewBar(), etc..)
//to get fresh data, force the broker to update the avs and re-parse the results like this...
FunctionResult fres = acct_data.RefreshFromBroker(SystemData);
// deal with the error
Also, the standalone Monitor tool can be used to trace the contents of the AVS in real-time (polled).
Hope that helps!