osBrain

osBrain is a general-purpose multi-agent architecture package written in Python and currently being developed by OpenSistemas. It allows the user to define the behavior of complex, scalable and distributed architectures in a simple way.

Each agent is a system process, meaning that it runs independently from the others and that it does not hit performance issues when using GIL-enabled Python interpreters. Although they can be configured before start running, it is also possible to configure agents while they are already running, even in remote locations. In order to do so, each agent is running a Pyro server, allowing the user to treat remote agents as local objects.

While Pyro is not the most efficient way for communication between processes, osBrain uses ZeroMQ internally for message-passing between agents. This enables good communication performance and eases the process of defining communication patterns.

RobinVOL Portfolio analysis

In order to perform parameter optimizations, osBrain is being used to execute millions of vectorized RobinVOL backtests. Those backtests are then filtered and sent to another osBrain network which perform a portfolio analysis so select the best combination of strategies.

The portfolio analysis is performed in a hierarchical manner. Each agent in the first layer receives a small set of random-selected backtests, and calculates the matrix correlation, drawdown and Sharpe ratio in order to select a small set of strategies among all the ones received: a miniportfolio. Those miniportfolios are then passed to another layer which receives a smaller number of strategies (filtered by the first layer) and then creates more miniportfolios (normally of a bigger size than in the first layer).

This procedure may be repeated in many layers until the last one, which combines all the miniportfolios received into a last portfolio with the desired size.