Cone8
 ( 41.83% )
- ago
This is a REALLY good idea. Write base provider for FIX and then inherit it to pump out a dozen broker providers. I think in most cases, it's only a matter of changing a settings file, and you're automatically connected to another FIX broker - brilliant!

I was looking into this a couple years ago and found this library, which makes it really easy to implement.
http://quickfixn.org/

Example of a FIX config file:


[DEFAULT]
ConnectionType=initiator
HeartBtInt=30
ReconnectInterval=1
FileStorePath=c:\fixfiles
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=N
SocketConnectHost=localhost

[SESSION]
BeginString=FIX.4.2
SenderCompID=CLIENT1
TargetCompID=FixServer
SocketConnectPort=5001
7
1,008
1 Replies

Reply

Bookmark

Sort
- ago
#1
QUOTE:
REALLY good idea. Write base provider for FIX and then inherit it to pump out a dozen broker providers.

I totally agree, especially since FIX is the wave of the future brokers would be using. It's not a question of "if" but "when". Something like

CODE:
namespace WealthLab.MyBroker {    private class FixConfigDef    {       //default settings       int heartBtInt = 30;       string fileStorePath = @"TEMP\fixfiles";       ...       //overriding constructors       FixConfigDef(int heartBtOverride)       {          heartBtInt = heartBtOverride;       }    }        public class MyBrokerProvider : FixBase    {       public MyBrokerProvider(..., ...) : base(new FixConfigDef(25))       {       }    } }
And it's even possible to place "FixConfigDef" inline as ExcelReader does (although I find that approach a bit confusing). See the new ExcelReaderConfiguration() definition at https://github.com/ExcelDataReader/ExcelDataReader for an example.

In addition, some of these FIX functions need to be "virtual" so they can be overridden by the MyBrokerProvider because the broker may not support all the FIX functions "at this time". So there's a need to override some of the FIX implementation with non-FIX traditional calls to fill in the gaps.

Although this is a flexible approach, it is somewhat advanced. But those writing broker providers are likely experienced oops programmers, so they can appreciate the flexibility of this inheritance approach with virtual methods.
0

Reply

Bookmark

Sort