Experts
From Open Forex Platform Wiki
An Expert is the main trading entity in the Open Forex Platform. Whether it is an automated, semi automated or a manual trading expert. An expert can also serve to analyze existing trading data or do back testing or for any other purpose that requires an active platform component with access to data. An expert may have corresponding UI component to allow for its control and visualization.
The design of the Platform allows an Expert to work on many pairs (EURUSD for ex.), on many time frames (for ex. 60M) at the same time. For each pair-timeframe couple (for ex. EURUSD/M60 ) used by an expert an ExpertSession is created. The ExpertSession represents all information related to this given trading couple and it has 2 major components - data acquisition and order management. The design also allows ExpertSessions to be based on trading integrations based on separate broker instances or interfaces. This means a single expert can operate on any number of trading symbols, time periods, broker accounts and event different brokers - all at the same time.
Expert Host
Each expert is run inside an "ExpertHost" (ExpertHost abstract class) and it serves as a "SessionManager" for the Expert (ISessionManager interface). A session manager provides services to work with the available Data and Order Execution Providers and Sources in the platform. Using these providers and sources, Expert Sessions are created. The Expert can query its Expert Host to get all the possible Data and Order Execution Sources and the SessionInfos they contain. Then based on this information, call one of the CreateSession methods to create an active Expert Session.
Expert Sessions
Using an expert session you use the IDataProvider and IOrderExecutionProvider interface members it contains. The first takes care of data delivery and the second order execution.
The process of creating expert session with the Session Manager is as follows:
[see IExpertSessionManager]
- Get DataSources
ArbiterClientId[] DataSources { get }
- For the selected Data Source get running Sessions:
SessionInfo[] GetSourceSessions({Id the of the source})
- Get Execution Sources
ArbiterClientId[] ExecutionSources { get; }
- For the selected Execution Source get running Sessions:
SessionInfo[] GetSourceSessions({Id of the source})
- When you have selected the proper Data Source and Execution Source you need, and the SessionInfo that they share (must both support the same Session), create an expert session:
ExpertSession CreateRemoteExecutionSession(dataProviderSourceId, orderExecutionerSourceId, sessionInfo);
- Once you have created the Session, you can access it also from the Sessions member of your ISessionManager instance
ReadOnlyCollection<ExpertSession> Sessions { get; }
An ExpertSession contains Data Provider and Order Execution Provider. Use the first to obtain the data (there is events inside for ticks etc), use the second to Execute Orders.
There is a UI dialog that automates the tedious process of creating an Expert Session (see CreateExpertSessionDialog). Use it if you wish to allow for the manual creation of sessions for your expert.

