 Initialize session with Trader Workstation

% initialize session with TWS
session = TWS.Session.getInstance();

% create local buffer for account summary events 
[buf,lh] = TWS.initBufferForEvent(TWS.Events.ACCOUNTSUMMARY);

% list of account attributes to querey
attrkeys = [                               ...
            'AccountType'                 ,...
            'NetLiquidation'              ,...
            'TotalCashValue'              ,...
            'SettledCash'                 ,...
            