Compare commits
15
Commits
development
...
sdk_doc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bbe9cfd98 | ||
|
|
ba633532eb | ||
|
|
7bf50415ca | ||
|
|
edbaa9c435 | ||
|
|
7789f39c9d | ||
|
|
6e188b4f73 | ||
|
|
33e8ff58c5 | ||
|
|
24ae03a9f8 | ||
|
|
5fe0335e1a | ||
|
|
6cbf707094 | ||
|
|
7e4ad55d9d | ||
|
|
35a0074014 | ||
|
|
b8dd5c119d | ||
|
|
8ada73aa64 | ||
|
|
a16ff30873 |
No files matched your search
Vendored
+4
-4
@@ -33,12 +33,12 @@
|
||||
"requireExactSource": false
|
||||
},
|
||||
{
|
||||
"name": "SDK Launch",
|
||||
"name": "FIX Launch",
|
||||
"type": "clr",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/build/Debug/bin/net471/spark_sdk.exe",
|
||||
"args": ["md","GLBX","Future","ZN", "ZNU8"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"program": "${workspaceRoot}/build/Debug/bin/net471/sparkcmd.exe",
|
||||
"args": ["fix","-f","spark_fix.cfg","-d"],
|
||||
"cwd": "${workspaceRoot}/build/Debug/bin/net471/",
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"requireExactSource": false
|
||||
|
||||
@@ -23,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_test", "src\client\sp
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_excel", "src\client\spark_excel\spark_excel.csproj", "{BE9F27C3-B583-47DF-95FA-1F8BBC89DCCB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "spark_fix", "src\client\spark_fix\spark_fix.csproj", "{D8031C13-7BEA-430A-BB60-40927D15CFC3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -219,6 +221,26 @@ Global
|
||||
{BE9F27C3-B583-47DF-95FA-1F8BBC89DCCB}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{BE9F27C3-B583-47DF-95FA-1F8BBC89DCCB}.RelWithDebInfo|x86.ActiveCfg = Release|x64
|
||||
{BE9F27C3-B583-47DF-95FA-1F8BBC89DCCB}.RelWithDebInfo|x86.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Debug|x64.Build.0 = Debug|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|Any CPU.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|Any CPU.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|x86.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.MinSizeRel|x86.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Release|x64.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Release|x64.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.Release|x86.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|Any CPU.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|x86.ActiveCfg = Release|x64
|
||||
{D8031C13-7BEA-430A-BB60-40927D15CFC3}.RelWithDebInfo|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using bts;
|
||||
using bts.api.admin;
|
||||
using bts.api.core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace mbts.spark {
|
||||
_dynamic_helper = dynamic_helper;
|
||||
var scheduler = ThreadPoolScheduler.Instance;
|
||||
var interval = TimeSpan.FromMilliseconds(100);
|
||||
on_orders = _service.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache();
|
||||
on_positions = _position_service.subscribei_position_data().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache();
|
||||
on_orders = _service.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache();
|
||||
on_positions = _position_service.subscribei_position_data().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache();
|
||||
working_orders =
|
||||
on_orders.Scan(
|
||||
ImmutableDictionary<uint,OrderRecordImmutable>.Empty,
|
||||
@@ -55,7 +55,7 @@ namespace mbts.spark {
|
||||
on_order_tuples = order_record_tuple_source.subscribe_incremental_update();
|
||||
on_order_tuples_table = order_record_tuple_source.subscribe_incremental_table_update();
|
||||
on_order_securities = order_record_tuple_source.subscribe_order_securities();
|
||||
on_fills = _service.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(admin_model).Table().Cache();
|
||||
on_fills = _service.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(admin_model.on_admin_data).Table().Cache();
|
||||
_activity = new OrderActivitySummarizer(bus, on_orders);
|
||||
on_fill_tuples = FillTupleSource.create_observable(bus.subscribe(SparkTags.SecuritiesTag), on_orders, on_fills);
|
||||
_security_orders_demuxer = new TableUpdateDemuxer<OrderRecordImmutable, uint, uint>(o => o.Key, o => o.security_key());
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>x64</Platforms>
|
||||
<RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
|
||||
<ApplicationIcon>logo.ico</ApplicationIcon>
|
||||
|
||||
@@ -3,4 +3,5 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: InternalsVisibleTo("spark_core")]
|
||||
[assembly: InternalsVisibleTo("sparkcmd")]
|
||||
[assembly: InternalsVisibleTo("spark_test")]
|
||||
[assembly: InternalsVisibleTo("spark_fix")]
|
||||
|
||||
@@ -75,7 +75,12 @@ namespace bts.api.md
|
||||
return req;
|
||||
}
|
||||
|
||||
public Security lookup(security_key key)
|
||||
public IEnumerable<SecurityImmutable> get_securities()
|
||||
{
|
||||
return _data.Values.Select(x => new SecurityImmutable(x.data.Security));
|
||||
}
|
||||
|
||||
public SecurityImmutable? lookup(security_key key)
|
||||
{
|
||||
Data value;
|
||||
if(_data.TryGetValue(key, out value))
|
||||
@@ -233,6 +238,11 @@ namespace bts.api.md
|
||||
/// <param name="interval"></param>
|
||||
/// <returns></returns>
|
||||
public async Task start_pump(TimeSpan? interval = null)
|
||||
{
|
||||
await _start_pump(interval);
|
||||
}
|
||||
|
||||
async Task _start_pump(TimeSpan? interval = null, int num_pumps = -1)
|
||||
{
|
||||
var rep = await _md.Value.request_names_async(new VoidMessage());
|
||||
int count = 0;
|
||||
@@ -248,7 +258,8 @@ namespace bts.api.md
|
||||
}
|
||||
}
|
||||
while (!rep.success && count++ < 5);
|
||||
while (true)
|
||||
count = 0;
|
||||
while (num_pumps < 0 || count++ < num_pumps)
|
||||
{
|
||||
var reply = await _md.Value.requestmd_async(_subscription);
|
||||
if (reply.success)
|
||||
@@ -298,6 +309,19 @@ namespace bts.api.md
|
||||
await this.start_pump(interval);
|
||||
}
|
||||
|
||||
public void pump_once()
|
||||
{
|
||||
if (_pump_task == null)
|
||||
{
|
||||
_pump_task = this._start_pump(null, 1)
|
||||
.ContinueWith(ex =>
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(ex == null, ex.ToString());
|
||||
}
|
||||
, TaskContinuationOptions.OnlyOnFaulted);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
readonly CancellationTokenSource _cts = new CancellationTokenSource();
|
||||
public void Dispose()
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using static bts.api.Security;
|
||||
|
||||
namespace bts.api {
|
||||
struct FutureLeg {
|
||||
public struct FutureLeg {
|
||||
public readonly Venue exchange;
|
||||
public readonly string symbol, exchange_desc;
|
||||
public readonly FutureContractImmutable future;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using static bts.api.Security;
|
||||
|
||||
namespace bts.api {
|
||||
internal static class SecurityHelper {
|
||||
public static class SecurityHelper {
|
||||
public static IEnumerable<FutureLeg> get_flat_future_legs(SecurityImmutable sec) {
|
||||
switch (sec.ContractCase) {
|
||||
case ContractOneofCase.Spread: return _get_flat_future_legs(sec.Spread.Legs, 1);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bts
|
||||
{
|
||||
public static class APIExtensions
|
||||
{
|
||||
public static T? TryFirst<T>(this IEnumerable<T> src) where T : struct
|
||||
{
|
||||
foreach (var v in src)
|
||||
return v;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,8 @@ namespace bts {
|
||||
Latency,
|
||||
DataFlow,
|
||||
Plugin,
|
||||
ClientSdk
|
||||
ClientSdk,
|
||||
Fix
|
||||
// Please keep this list in sync with logging.h/logging.cpp
|
||||
}
|
||||
|
||||
@@ -75,8 +76,9 @@ namespace bts {
|
||||
internal static Logger Assert => new Logger(Subsystem.Assert);
|
||||
internal static Logger Ui => new Logger(Subsystem.Ui);
|
||||
internal static Logger Testing => new Logger(Subsystem.Testing);
|
||||
internal static Logger DataFlow => new Logger(Subsystem.DataFlow);
|
||||
internal static Logger DataFlow => new Logger(Subsystem.DataFlow);
|
||||
public static Logger ClientSdk => new Logger(Subsystem.ClientSdk);
|
||||
internal static Logger FIX => new Logger(Subsystem.Fix);
|
||||
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
|
||||
+3
-2
@@ -4,11 +4,12 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace mbts.spark
|
||||
namespace bts.api.core
|
||||
{
|
||||
class AdminModelWrapper
|
||||
public class AdminModelWrapper
|
||||
{
|
||||
readonly AdminDataImmutable? _admin_data;
|
||||
public AdminDataImmutable? admin_data => _admin_data;
|
||||
readonly string _user_name;
|
||||
readonly List<BTSAccountImmutable> _allowed_accounts;
|
||||
readonly Dictionary<string, string> _allowed_account_dict = new Dictionary<string, string>();
|
||||
+11
-13
@@ -4,10 +4,6 @@ using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.api.position;
|
||||
using bts.spark;
|
||||
using mbts.collections;
|
||||
using mbts.spark;
|
||||
using mbts.spark.utilities;
|
||||
using mbts.utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
@@ -18,14 +14,14 @@ using System.Reactive.Linq;
|
||||
|
||||
namespace bts.api.core
|
||||
{
|
||||
|
||||
static class PermissionFilters
|
||||
public static class PermissionFilters
|
||||
{
|
||||
public static IObservable<Update<PositionUnitImmutable, int>> PermissionFilter(this IObservable<Update<PositionUnitImmutable, int>> source, AdminModel am)
|
||||
public static IObservable<Update<PositionUnitImmutable, int>>
|
||||
PermissionFilter(this IObservable<Update<PositionUnitImmutable, int>> source, IObservable<AdminModelWrapper> am)
|
||||
{
|
||||
var pred = Observable.Create<Func<PositionUnitImmutable, bool>>( observer =>
|
||||
{
|
||||
return am.on_admin_data.Subscribe(x =>
|
||||
return am.Subscribe(x =>
|
||||
{
|
||||
Func<PositionUnitImmutable, bool> filter = (z => x.can_view_account(z.Account));
|
||||
observer.OnNext(filter);
|
||||
@@ -35,13 +31,14 @@ namespace bts.api.core
|
||||
return source.Filter(pred);
|
||||
}
|
||||
|
||||
public static IObservable<Update<OrderRecordImmutable, uint>> PermissionFilter(this IObservable<Update<OrderRecordImmutable, uint>> source, AdminModel am)
|
||||
public static IObservable<Update<OrderRecordImmutable, uint>>
|
||||
PermissionFilter(this IObservable<Update<OrderRecordImmutable, uint>> source, IObservable<AdminModelWrapper> am)
|
||||
{
|
||||
var pred = Observable.Create<Func<OrderRecordImmutable, bool>>(observer =>
|
||||
{
|
||||
return am.on_admin_data.Subscribe(x =>
|
||||
return am.Subscribe(x =>
|
||||
{
|
||||
Func<OrderRecordImmutable, bool> filter = (z => x.can_view_account(z.account()));
|
||||
Func<OrderRecordImmutable, bool> filter = (z => x.can_view_account(z.Def.Account ?? string.Empty));
|
||||
observer.OnNext(filter);
|
||||
});
|
||||
});
|
||||
@@ -49,11 +46,12 @@ namespace bts.api.core
|
||||
return source.Filter(pred);
|
||||
}
|
||||
|
||||
public static IObservable<Update<FillImmutable, string>> PermissionFilter(this IObservable<Update<FillImmutable, string>> source, AdminModel am)
|
||||
public static IObservable<Update<FillImmutable, string>>
|
||||
PermissionFilter(this IObservable<Update<FillImmutable, string>> source, IObservable<AdminModelWrapper> am)
|
||||
{
|
||||
var pred = Observable.Create<Func<FillImmutable, bool>>(observer =>
|
||||
{
|
||||
return am.on_admin_data.Subscribe(x =>
|
||||
return am.Subscribe(x =>
|
||||
{
|
||||
Func<FillImmutable, bool> filter = (z => x.can_view_account(z.Account));
|
||||
observer.OnNext(filter);
|
||||
@@ -69,12 +69,5 @@ namespace mbts {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static T? TryFirst<T>(this IEnumerable<T> src) where T : struct
|
||||
{
|
||||
foreach(var v in src)
|
||||
return v;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using QuickFix;
|
||||
using QuickFix.Fields;
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
public class FixInit
|
||||
{
|
||||
public static int start_acceptor(string settings_file, bool orders_allowed, string http_address = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
SessionSettings settings = new SessionSettings(settings_file);
|
||||
IApplication app = new FixRouter( (th, sess) =>
|
||||
{
|
||||
if(orders_allowed)
|
||||
return new OrderSession(th, sess);
|
||||
else
|
||||
return new DropCopySession(th, sess);
|
||||
});
|
||||
IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
|
||||
ILogFactory logFactory = new FileLogFactory(settings);
|
||||
IAcceptor acceptor = new ThreadedSocketAcceptor(app, storeFactory, settings, logFactory);
|
||||
|
||||
acceptor.Start();
|
||||
HttpServer srv = null;
|
||||
if (!string.IsNullOrEmpty(http_address))
|
||||
{
|
||||
if(!http_address.StartsWith("http"))
|
||||
http_address = "http://127.0.0.1:5080/";
|
||||
srv = new HttpServer(http_address, settings);
|
||||
srv.Start();
|
||||
}
|
||||
Console.WriteLine("press <q> to quit");
|
||||
while (Console.Read() != 'q') { }
|
||||
acceptor.Stop();
|
||||
if(srv != null)
|
||||
srv.Stop();
|
||||
return 0;
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
bts.Log.FIX.fatal(e.ToString());
|
||||
Console.WriteLine("==FATAL ERROR==");
|
||||
Console.WriteLine(e.ToString());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Concurrency;
|
||||
using System.Text;
|
||||
|
||||
using QuickFix;
|
||||
using QuickFix.Fields;
|
||||
|
||||
using bts.api;
|
||||
using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.api.user;
|
||||
using bts.api.md;
|
||||
using bts.api.admin;
|
||||
|
||||
using security_key = System.UInt32;
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
interface IFixRouter
|
||||
{
|
||||
IEnumerable<SecurityImmutable> get_securities();
|
||||
SecurityImmutable? lookup(security_key key);
|
||||
SecurityImmutable? lookup(string desc);
|
||||
}
|
||||
|
||||
class FixRouter : QuickFix.MessageCracker, QuickFix.IApplication, IFixRouter
|
||||
{
|
||||
readonly ConcurrentDictionary<SessionID, QuickFix.IApplication> _sessions = new ConcurrentDictionary<SessionID, IApplication>();
|
||||
readonly Func<IFixRouter, SessionID, IApplication> _factory;
|
||||
readonly MarketDataClient _mdglobal = new MarketDataClient();
|
||||
|
||||
public FixRouter(Func<IFixRouter, SessionID, IApplication> factory)
|
||||
{
|
||||
_factory = factory;
|
||||
_mdglobal.pump_once(); //get securities
|
||||
}
|
||||
|
||||
public IApplication session(SessionID sessionID)
|
||||
{
|
||||
IApplication app;
|
||||
if (!_sessions.TryGetValue(sessionID, out app))
|
||||
{
|
||||
app = _factory(this, sessionID);
|
||||
_sessions[sessionID] = app;
|
||||
}
|
||||
return app;
|
||||
}
|
||||
|
||||
public void FromAdmin(Message message, SessionID sessionID)
|
||||
{
|
||||
session(sessionID).FromAdmin(message, sessionID);
|
||||
}
|
||||
|
||||
public void FromApp(Message message, SessionID sessionID)
|
||||
{
|
||||
session(sessionID).FromApp(message, sessionID);
|
||||
}
|
||||
|
||||
public void OnCreate(SessionID sessionID)
|
||||
{
|
||||
session(sessionID).OnCreate(sessionID);
|
||||
}
|
||||
|
||||
public void OnLogon(SessionID sessionID)
|
||||
{
|
||||
session(sessionID).OnLogon(sessionID);
|
||||
}
|
||||
|
||||
public void OnLogout(SessionID sessionID)
|
||||
{
|
||||
session(sessionID).OnLogout(sessionID);
|
||||
}
|
||||
|
||||
public void ToAdmin(Message message, SessionID sessionID)
|
||||
{
|
||||
session(sessionID).ToAdmin(message, sessionID);
|
||||
}
|
||||
|
||||
public void ToApp(Message message, SessionID sessionID)
|
||||
{
|
||||
session(sessionID).ToApp(message, sessionID);
|
||||
}
|
||||
|
||||
IEnumerable<SecurityImmutable> IFixRouter.get_securities()
|
||||
{
|
||||
return _mdglobal.get_securities();
|
||||
}
|
||||
|
||||
SecurityImmutable? IFixRouter.lookup(uint key)
|
||||
{
|
||||
return _mdglobal.lookup(key);
|
||||
}
|
||||
|
||||
SecurityImmutable? IFixRouter.lookup(string desc)
|
||||
{
|
||||
if (_mdglobal.lookup_security_key_from_desc(desc, out uint key))
|
||||
return _mdglobal.lookup(key);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,585 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using QuickFix;
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
public class HttpServer : IDisposable
|
||||
{
|
||||
private readonly HttpListener _httpListener;
|
||||
private Thread _connectionThread;
|
||||
private Boolean _running, _disposed;
|
||||
private readonly SessionSettings _sessionSettings;
|
||||
private StringBuilder _sbHtmlHeader;
|
||||
|
||||
|
||||
public HttpServer(string prefix, SessionSettings settings)
|
||||
{
|
||||
if (!HttpListener.IsSupported)
|
||||
{
|
||||
// Requires at least a Windows XP with Service Pack 2
|
||||
throw new NotSupportedException(
|
||||
"The Http Server cannot run on this operating system.");
|
||||
}
|
||||
|
||||
_httpListener = new HttpListener();
|
||||
_httpListener.Prefixes.Add(prefix);
|
||||
_sessionSettings = settings;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (!_httpListener.IsListening)
|
||||
{
|
||||
_httpListener.Start();
|
||||
_running = true;
|
||||
// Use a thread to listen to the Http requests
|
||||
_connectionThread = new Thread(ConnectionThreadStart);
|
||||
_connectionThread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (_httpListener.IsListening)
|
||||
{
|
||||
_running = false;
|
||||
_httpListener.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void ConnectionThreadStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (_running)
|
||||
{
|
||||
// Grab the context and pass it to the processor methods to handle it
|
||||
HttpListenerContext context = _httpListener.GetContext();
|
||||
HttpListenerRequest request = context.Request;
|
||||
HttpListenerResponse response = context.Response;
|
||||
string responseString;
|
||||
|
||||
_sbHtmlHeader = new StringBuilder(@"<HEAD><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>");
|
||||
_sbHtmlHeader.AppendFormat(@"<CENTER>[<A HREF='/'>HOME</A>] [<A HREF='{0}'>RELOAD</A>]</CENTER><HR/></HEADER><BODY>", request.Url.OriginalString);
|
||||
|
||||
switch (request.Url.AbsolutePath)
|
||||
{
|
||||
case "/":
|
||||
responseString = ProcessRoot(request);
|
||||
break;
|
||||
case "/session":
|
||||
responseString = SessionDetails(request);
|
||||
break;
|
||||
case "/resetSession":
|
||||
responseString = ResetSession(request);
|
||||
break;
|
||||
case "/resetSessions":
|
||||
responseString = ResetSessions(request);
|
||||
break;
|
||||
case "/refreshSession":
|
||||
responseString = RefreshSession(request);
|
||||
break;
|
||||
case "/refreshSessions":
|
||||
responseString = RefreshSessions(request);
|
||||
break;
|
||||
case "/enableSessions":
|
||||
responseString = EnableSessions(request);
|
||||
break;
|
||||
case "/disableSessions":
|
||||
responseString = DisableSessions(request);
|
||||
break;
|
||||
default:
|
||||
responseString = ProcessRoot(request);
|
||||
break;
|
||||
}
|
||||
|
||||
byte[] buffer = Encoding.UTF8.GetBytes(responseString);
|
||||
response.ContentLength64 = buffer.Length;
|
||||
Stream output = response.OutputStream;
|
||||
output.Write(buffer, 0, buffer.Length);
|
||||
output.Close();
|
||||
}
|
||||
}
|
||||
catch (HttpListenerException)
|
||||
{
|
||||
Console.WriteLine("HTTP server was shut down.");
|
||||
}
|
||||
}
|
||||
|
||||
private string DisableSessions(HttpListenerRequest request)
|
||||
{
|
||||
bool confirm = false;
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
foreach (SessionID session in _sessionSettings.GetSessions())
|
||||
{
|
||||
Session sessionDetails = Session.LookupSession(session);
|
||||
sessionDetails.Logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL={0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", "/");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='{0}'>Sessions</A> have been disabled</h2></CENTER>", "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.Append("<CENTER><h2>Are you sure you want to disable all sessions ?</h2></CENTER>");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}?confirm=1'>YES, disable sessions</A>] [<A HREF='/'>NO, do not disable sessions</A>]</CENTER>", request.Url.OriginalString);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
private string EnableSessions(HttpListenerRequest request)
|
||||
{
|
||||
bool confirm = false;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
foreach (SessionID session in _sessionSettings.GetSessions())
|
||||
{
|
||||
Session sessionDetails = Session.LookupSession(session);
|
||||
sessionDetails.Logon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL={0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", "/");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='{0}'>Sessions</A> have been enabled</h2></CENTER>", "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.Append("<CENTER><h2>Are you sure you want to enable all sessions ?</h2></CENTER>");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}?confirm=1'>YES, enable sessions</A>] [<A HREF='/'>NO, do not enable sessions</A>]</CENTER>", urlOriginalString);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
private string RefreshSession(HttpListenerRequest request)
|
||||
{
|
||||
SessionID sessionId = new SessionID(request.QueryString["beginstring"], request.QueryString["sendercompid"], request.QueryString["targetcompid"]);
|
||||
Session sessionDetails = Session.LookupSession(sessionId);
|
||||
if (sessionDetails == null) throw new Exception("Session not found");
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
bool confirm = false;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
|
||||
string url = "/session?" + GetParameterList(urlOriginalString);
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
sessionDetails.Refresh();
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "confirm");
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL=/session?{0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", GetParameterList(urlOriginalString));
|
||||
sbHtmlPageBody.AppendFormat(@"<CENTER>[<A HREF='/'>HOME</A>] [<A HREF='{0}'>RELOAD</A>]</CENTER><HR/></HEAD><BODY>", urlOriginalString);
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='/session?{0}'>{1}</A> has been refreshed</h2></CENTER>", GetParameterList(url), sessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2>Are you sure you want to refresh session <A HREF='{0}'>{1}</A>?</h2></CENTER>", url, sessionId);
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}&confirm=1'>YES, refresh session</A>] [<A HREF='{0}'>NO, do not refresh session</A>]</CENTER>", url);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
private string RefreshSessions(HttpListenerRequest request)
|
||||
{
|
||||
bool confirm = false;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
foreach (SessionID session in _sessionSettings.GetSessions())
|
||||
{
|
||||
Session sessionDetails = Session.LookupSession(session);
|
||||
sessionDetails.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL={0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", "/");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='{0}'>Sessions</A> have been refreshed</h2></CENTER>", "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.Append("<CENTER><h2>Are you sure you want to refresh all sessions ?</h2></CENTER>");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}?confirm=1'>YES, refresh sessions</A>] [<A HREF='/'>NO, do not refresh sessions</A>]</CENTER>", urlOriginalString);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
private string ResetSessions(HttpListenerRequest request)
|
||||
{
|
||||
bool confirm = false;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
foreach (SessionID session in _sessionSettings.GetSessions())
|
||||
{
|
||||
Session sessionDetails = Session.LookupSession(session);
|
||||
sessionDetails.Reset("Reset from WebInterface");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL={0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", "/");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='{0}'>Sessions</A> have been reset</h2></CENTER>", "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.Append("<CENTER><h2>Are you sure you want to reset all sessions ?</h2></CENTER>");
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}?confirm=1'>YES, reset sessions</A>] [<A HREF='/'>NO, do not reset sessions</A>]</CENTER>", urlOriginalString);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
private string ResetSession(HttpListenerRequest request)
|
||||
{
|
||||
SessionID sessionId = new SessionID(request.QueryString["beginstring"], request.QueryString["sendercompid"], request.QueryString["targetcompid"]);
|
||||
Session sessionDetails = Session.LookupSession(sessionId);
|
||||
if (sessionDetails == null) throw new Exception("Session not found");
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
bool confirm = false;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
|
||||
string url = "/session?" + GetParameterList(urlOriginalString);
|
||||
|
||||
if (request.QueryString["confirm"] != null)
|
||||
{
|
||||
if (Convert.ToInt16(request.QueryString["confirm"]) != 0)
|
||||
{
|
||||
confirm = true;
|
||||
sessionDetails.Reset("Reset from WebInterface");
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "confirm");
|
||||
}
|
||||
}
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
sbHtmlPageBody = new StringBuilder();
|
||||
sbHtmlPageBody.AppendFormat(@"<HEAD><META http-equiv='refresh' content=2;URL=/session?{0} /><CENTER><TITLE>QuickFIX Engine Web Interface</TITLE><H1>QuickFIX Engine Web Interface</H1></CENTER>", GetParameterList(urlOriginalString));
|
||||
sbHtmlPageBody.AppendFormat(@"<CENTER>[<A HREF='/'>HOME</A>] [<A HREF='{0}'>RELOAD</A>]</CENTER><HR/></HEAD><BODY>", urlOriginalString);
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2><A HREF='/session?{0}'>{1}</A> has been reset</h2></CENTER>", GetParameterList(url), sessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><h2>Are you sure you want to reset session <A HREF='{0}'>{1}</A>?</h2></CENTER>", url, sessionId);
|
||||
sbHtmlPageBody.AppendFormat("<CENTER>[<A HREF='{0}&confirm=1'>YES, reset session</A>] [<A HREF='{0}'>NO, do not reset session</A>]</CENTER>", url);
|
||||
}
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
|
||||
private string ProcessRoot(HttpListenerRequest request)
|
||||
{
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
//Session count
|
||||
sbHtmlPageBody.AppendFormat("<CENTER><b><i>{0} Sessions managed by QuickFIX</b></i></CENTER><HR/>", _sessionSettings.GetSessions().Count);
|
||||
|
||||
//session management links
|
||||
sbHtmlPageBody.AppendFormat(@"<CENTER><A HREF='/resetSessions{0}'>RESET</A> <A HREF='/refreshSessions'>REFRESH</A> <A HREF='/enableSessions'>ENABLE</A> <A HREF='/disableSessions'>DISABLE</A></CENTER><HR/></HEADER><BODY>", GetParameterList(request.Url.OriginalString));
|
||||
|
||||
//Start the table generation
|
||||
sbHtmlPageBody.Append("<table id=\"sessionlist\" style=\"border-width:1; padding:2; width:100%\">");
|
||||
|
||||
sbHtmlPageBody.Append("<tr>");
|
||||
sbHtmlPageBody.Append(AddCell("Session", true));
|
||||
sbHtmlPageBody.Append(AddCell("Type", true));
|
||||
sbHtmlPageBody.Append(AddCell("Enabled", true));
|
||||
sbHtmlPageBody.Append(AddCell("Session Time", true));
|
||||
sbHtmlPageBody.Append(AddCell("Logged On", true));
|
||||
sbHtmlPageBody.Append(AddCell("Next Incoming", true));
|
||||
sbHtmlPageBody.Append(AddCell("Next Outgoing", true));
|
||||
sbHtmlPageBody.Append("</tr>");
|
||||
|
||||
foreach (SessionID session in _sessionSettings.GetSessions())
|
||||
{
|
||||
Session sessionDetails = Session.LookupSession(session);
|
||||
sbHtmlPageBody.Append("<tr>");
|
||||
sbHtmlPageBody.Append(AddCell(String.Format(
|
||||
"<a href=\"session?BeginString={0}&SenderCompID={1}&TargetCompID={2}\">{0}:{1}->{2}</a>",
|
||||
session.BeginString, session.SenderCompID, session.TargetCompID)));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.IsInitiator ? "initiator" : "acceptor"));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.IsEnabled ? "yes" : "no"));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.IsSessionTime ? "yes" : "no"));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.IsLoggedOn ? "yes" : "no"));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.NextTargetMsgSeqNum.ToString()));
|
||||
sbHtmlPageBody.Append(AddCell(sessionDetails.NextSenderMsgSeqNum.ToString()));
|
||||
sbHtmlPageBody.Append("</tr>");
|
||||
}
|
||||
|
||||
sbHtmlPageBody.Append("</table>");
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
public string SessionDetails(HttpListenerRequest request)
|
||||
{
|
||||
SessionID sessionId = new SessionID(request.QueryString["beginstring"], request.QueryString["sendercompid"], request.QueryString["targetcompid"]);
|
||||
Session sessionDetails = Session.LookupSession(sessionId);
|
||||
if (sessionDetails == null) throw new Exception("Session not found");
|
||||
StringBuilder sbHtmlPageBody = _sbHtmlHeader;
|
||||
|
||||
string url = request.Url.OriginalString;
|
||||
string urlOriginalString = request.Url.OriginalString;
|
||||
|
||||
if (request.QueryString["enabled"] != null)
|
||||
{
|
||||
if (!Convert.ToBoolean(request.QueryString["enabled"]))
|
||||
sessionDetails.Logout();
|
||||
else
|
||||
sessionDetails.Logon();
|
||||
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "Enabled");
|
||||
}
|
||||
|
||||
if (request.QueryString["next incoming"] != null)
|
||||
{
|
||||
int value = Convert.ToInt16(request.QueryString["next incoming"]);
|
||||
sessionDetails.NextTargetMsgSeqNum = value <= 0 ? 1 : value;
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "next incoming");
|
||||
}
|
||||
|
||||
if (request.QueryString["Next Outgoing"] != null)
|
||||
{
|
||||
int value = Convert.ToInt16(request.QueryString["Next Outgoing"]);
|
||||
sessionDetails.NextSenderMsgSeqNum = value <= 0 ? 1 : value;
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "Next Outgoing");
|
||||
}
|
||||
|
||||
if (request.QueryString["SendRedundantResendRequests"] != null)
|
||||
{
|
||||
sessionDetails.SendRedundantResendRequests = Convert.ToBoolean(request.QueryString["SendRedundantResendRequests"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "SendRedundantResendRequests");
|
||||
}
|
||||
|
||||
if (request.QueryString["CheckCompId"] != null)
|
||||
{
|
||||
sessionDetails.CheckCompID = Convert.ToBoolean(request.QueryString["CheckCompId"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "CheckCompId");
|
||||
}
|
||||
|
||||
if (request.QueryString["CheckLatency"] != null)
|
||||
{
|
||||
sessionDetails.CheckLatency = Convert.ToBoolean(request.QueryString["CheckLatency"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "CheckLatency");
|
||||
}
|
||||
|
||||
if (request.QueryString["MaxLatency"] != null)
|
||||
{
|
||||
int value = Convert.ToInt16(request.QueryString["MaxLatency"]);
|
||||
sessionDetails.MaxLatency = value <= 0 ? 1 : value;
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "MaxLatency");
|
||||
}
|
||||
|
||||
if (request.QueryString["LogonTimeout"] != null)
|
||||
{
|
||||
int value = Convert.ToInt16(request.QueryString["LogonTimeout"]);
|
||||
sessionDetails.LogonTimeout = value <= 0 ? 1 : value;
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "LogonTimeout");
|
||||
}
|
||||
|
||||
if (request.QueryString["LogoutTimeout"] != null)
|
||||
{
|
||||
int value = Convert.ToInt16(request.QueryString["LogoutTimeout"]);
|
||||
sessionDetails.LogoutTimeout = value <= 0 ? 1 : value;
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "LogoutTimeout");
|
||||
}
|
||||
|
||||
if (request.QueryString["ResetOnLogon"] != null)
|
||||
{
|
||||
sessionDetails.ResetOnLogon = Convert.ToBoolean(request.QueryString["ResetOnLogon"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "ResetOnLogon");
|
||||
}
|
||||
|
||||
if (request.QueryString["ResetOnLogout"] != null)
|
||||
{
|
||||
sessionDetails.ResetOnLogout = Convert.ToBoolean(request.QueryString["ResetOnLogout"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "ResetOnLogout");
|
||||
}
|
||||
|
||||
if (request.QueryString["ResetOnDisconnect"] != null)
|
||||
{
|
||||
sessionDetails.ResetOnDisconnect = Convert.ToBoolean(request.QueryString["ResetOnDisconnect"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "ResetOnDisconnect");
|
||||
}
|
||||
|
||||
if (request.QueryString["RefreshOnLogon"] != null)
|
||||
{
|
||||
sessionDetails.RefreshOnLogon = Convert.ToBoolean(request.QueryString["RefreshOnLogon"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "RefreshOnLogon");
|
||||
}
|
||||
|
||||
if (request.QueryString["MillisecondsInTimestamp"] != null)
|
||||
{
|
||||
sessionDetails.MillisecondsInTimeStamp = Convert.ToBoolean(request.QueryString["MillisecondsInTimestamp"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "MillisecondsInTimestamp");
|
||||
}
|
||||
|
||||
if (request.QueryString["PersistMessages"] != null)
|
||||
{
|
||||
sessionDetails.PersistMessages = Convert.ToBoolean(request.QueryString["PersistMessages"]);
|
||||
url = RemoveQueryStringByKey(urlOriginalString, "PersistMessages");
|
||||
}
|
||||
|
||||
|
||||
sbHtmlPageBody.AppendFormat(@"<CENTER>{0}</CENTER><HR/>", sessionId);
|
||||
sbHtmlPageBody.AppendFormat(@"<CENTER>[<A HREF='/resetSession?{0}'>RESET</A>] [<A HREF='/refreshSession?{0}'>REFRESH</A>]</CENTER><HR/></HEADER><BODY>", GetParameterList(urlOriginalString));
|
||||
|
||||
sbHtmlPageBody.Append("<table id=\"session_details\" style=\"border-width:1; padding:2; width:100%\">");
|
||||
|
||||
sbHtmlPageBody.Append(AddRow("Enabled", sessionDetails.IsEnabled, url));
|
||||
sbHtmlPageBody.Append(AddRow("ConnectionType", sessionDetails.IsInitiator ? "initiator" : "acceptor"));
|
||||
sbHtmlPageBody.Append(AddRow("SessionTime", sessionDetails.IsSessionTime));
|
||||
sbHtmlPageBody.Append(AddRow("LoggedOn", sessionDetails.IsLoggedOn));
|
||||
sbHtmlPageBody.Append(AddRow("Next Incoming", sessionDetails.NextTargetMsgSeqNum, url));
|
||||
sbHtmlPageBody.Append(AddRow("Next Outgoing", sessionDetails.NextSenderMsgSeqNum, url));
|
||||
sbHtmlPageBody.Append(AddRow("SendRedundantResendRequests", sessionDetails.SendRedundantResendRequests, url));
|
||||
sbHtmlPageBody.Append(AddRow("CheckCompId", sessionDetails.CheckCompID, url));
|
||||
sbHtmlPageBody.Append(AddRow("CheckLatency", sessionDetails.CheckLatency, url));
|
||||
sbHtmlPageBody.Append(AddRow("MaxLatency", sessionDetails.MaxLatency, url));
|
||||
sbHtmlPageBody.Append(AddRow("LogonTimeout", sessionDetails.LogonTimeout, url));
|
||||
sbHtmlPageBody.Append(AddRow("LogoutTimeout", sessionDetails.LogoutTimeout, url));
|
||||
sbHtmlPageBody.Append(AddRow("ResetOnLogon", sessionDetails.ResetOnLogon, url));
|
||||
sbHtmlPageBody.Append(AddRow("ResetOnLogout", sessionDetails.ResetOnLogout, url));
|
||||
sbHtmlPageBody.Append(AddRow("ResetOnDisconnect", sessionDetails.ResetOnDisconnect, url));
|
||||
sbHtmlPageBody.Append(AddRow("RefreshOnLogon", sessionDetails.RefreshOnLogon, url));
|
||||
sbHtmlPageBody.Append(AddRow("MillisecondsInTimestamp", sessionDetails.MillisecondsInTimeStamp, url));
|
||||
sbHtmlPageBody.Append(AddRow("PersistMessages", sessionDetails.PersistMessages, url));
|
||||
|
||||
sbHtmlPageBody.Append("</table>");
|
||||
return sbHtmlPageBody.ToString();
|
||||
}
|
||||
|
||||
public static string RemoveQueryStringByKey(string url, string key)
|
||||
{
|
||||
var uri = new Uri(url);
|
||||
|
||||
// this gets all the query string key value pairs as a collection
|
||||
var newQueryString = HttpUtility.ParseQueryString(uri.Query);
|
||||
|
||||
// this removes the key if exists
|
||||
newQueryString.Remove(key);
|
||||
|
||||
// this gets the page path from root without QueryString
|
||||
string pagePathWithoutQueryString = uri.GetLeftPart(UriPartial.Path);
|
||||
|
||||
return newQueryString.Count > 0
|
||||
? $"{pagePathWithoutQueryString}?{newQueryString}"
|
||||
: pagePathWithoutQueryString;
|
||||
}
|
||||
|
||||
public static string GetParameterList(string url)
|
||||
{
|
||||
return HttpUtility.ParseQueryString((new Uri(url).Query)).ToString();
|
||||
}
|
||||
|
||||
private static string AddRow(string colName, bool value, string url = "")
|
||||
{
|
||||
string valueAsStr = value ? "yes" : "no";
|
||||
string innerHtml = url.Length > 0
|
||||
? $"<a href=\" {url}&{colName}={!value} \">toggle</a>"
|
||||
: "";
|
||||
return AddRow(colName, valueAsStr, innerHtml);
|
||||
}
|
||||
|
||||
private static string AddRow(string colName, int value, string url = "")
|
||||
{
|
||||
string innerHtml = $"<a href=\" {url}&{colName}={value - 10} \"> << </a>" +
|
||||
$"<a href=\" {url}&{colName}={value - 1} \"> < </a>" +
|
||||
" | " +
|
||||
$"<a href=\" {url}&{colName}={value + 1} \"> > </a>" +
|
||||
$"<a href=\" {url}&{colName}={value + 10} \"> >> </a>";
|
||||
return AddRow(colName, value.ToString(), innerHtml);
|
||||
}
|
||||
private static string AddRow(string colName, string value, string innerHtml = "")
|
||||
{
|
||||
StringBuilder row = new StringBuilder();
|
||||
row.Append("<tr>");
|
||||
row.Append(AddCell(colName));
|
||||
row.Append(AddCell(value));
|
||||
row.Append(AddCell(innerHtml));
|
||||
row.Append("</tr>");
|
||||
return row.ToString();
|
||||
}
|
||||
|
||||
private static string AddCell(string cellContent, bool header = false)
|
||||
{
|
||||
string entryType = header ? "th" : "td";
|
||||
return "<" + entryType + " align=\"left\">" + cellContent + "</" + entryType + ">";
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (disposing)
|
||||
{
|
||||
if (_running)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
if (_connectionThread != null)
|
||||
{
|
||||
_connectionThread.Abort();
|
||||
_connectionThread = null;
|
||||
}
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# BTS Spark FIX Adapter
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Concurrency;
|
||||
using System.Text;
|
||||
|
||||
using QuickFix;
|
||||
using QuickFix.Fields;
|
||||
|
||||
using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.api.user;
|
||||
using bts.api.admin;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
class DropCopySession : SessionBase, QuickFix.IApplication
|
||||
{
|
||||
protected IDisposable _fillsdisp;
|
||||
protected IDisposable _ordersdisp;
|
||||
|
||||
|
||||
protected readonly ConcurrentDictionary<uint, OrderRecordImmutable> _order_cache = new ConcurrentDictionary<uint, OrderRecordImmutable>();
|
||||
protected readonly ConcurrentDictionary<uint, string> _fix_clorderids = new ConcurrentDictionary<uint, string>();
|
||||
public DropCopySession(IFixRouter router, SessionID sess) : base(router, sess)
|
||||
{
|
||||
}
|
||||
|
||||
override public void OnLogon(SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
var msg = sessionID.ToString() + " Logged on";
|
||||
log_info(msg);
|
||||
|
||||
subscribe_fills_and_orders(sessionID);
|
||||
}
|
||||
override public void OnLogout(SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
var msg = sessionID.ToString() + " Logged out";
|
||||
log_info(msg);
|
||||
|
||||
if (_ordersdisp != null)
|
||||
_ordersdisp.Dispose();
|
||||
if (_fillsdisp != null)
|
||||
_fillsdisp.Dispose();
|
||||
}
|
||||
|
||||
override public void FromApp(Message message, SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
MsgType type = Message.IdentifyType(message.ToString());
|
||||
switch (type.getValue())
|
||||
{
|
||||
case MsgType.ORDER_STATUS_REQUEST:
|
||||
case MsgType.SECURITYDEFINITIONREQUEST:
|
||||
log_info("IN: " + message);
|
||||
Crack(message, sessionID);
|
||||
break;
|
||||
default:
|
||||
log_info("UNSUPPORTED MESSAGE IN: " + type.getValue());
|
||||
throw new UnsupportedMessageType();
|
||||
}
|
||||
}
|
||||
|
||||
virtual public void OnMessage(QuickFix.FIX44.OrderStatusRequest req, SessionID s)
|
||||
{
|
||||
if (req.IsSetOrderID() && req.IsSetOrdStatusReqID())
|
||||
{
|
||||
uint oid = uint.Parse(req.OrderID.getValue());
|
||||
if (_order_cache.TryGetValue(oid, out OrderRecordImmutable order))
|
||||
{
|
||||
var ostat = build_order_status(s, order);
|
||||
ostat.OrdStatusReqID = new OrdStatusReqID(req.OrdStatusReqID.getValue());
|
||||
send(ostat, s);
|
||||
}
|
||||
else
|
||||
send_reject(s, "Can't find order " + oid, req);
|
||||
}
|
||||
else
|
||||
send_reject(s, "clorderid null", req);
|
||||
}
|
||||
|
||||
virtual public void OnMessage(QuickFix.FIX44.SecurityDefinitionRequest req, SessionID s)
|
||||
{
|
||||
if (req.IsSetSecurityReqID() && req.IsSetSecurityRequestType() &&
|
||||
req.SecurityRequestType.getValue() == SecurityRequestType.REQUEST_LIST_SECURITIES)
|
||||
{
|
||||
var secs = _router.get_securities();
|
||||
if (req.IsSetSymbol())
|
||||
secs = secs.Where(x => x.Symbol.ToLower() == req.Symbol.getValue().ToLower());
|
||||
if (req.IsSetSecurityType())
|
||||
secs = secs.Where(x => security_types_equal(x.security_type(), req.SecurityType));
|
||||
if (req.IsSetSecurityExchange())
|
||||
secs = secs.Where(x => exchanges_equal(x.Exchange, req.SecurityExchange));
|
||||
|
||||
var def = new QuickFix.FIX44.SecurityDefinition(req.SecurityReqID,
|
||||
new SecurityResponseID(Guid.NewGuid().ToString()),
|
||||
new SecurityResponseType(SecurityResponseType.LIST_OF_SECURITIES_RETURNED_PER_REQUEST));
|
||||
send(def, s);
|
||||
}
|
||||
else
|
||||
send_reject(s, "Can't parse secdef request", req);
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual protected void subscribe_fills_and_orders(SessionID sessionID)
|
||||
{
|
||||
|
||||
|
||||
var scheduler = TaskPoolScheduler.Default;
|
||||
var interval = TimeSpan.FromMilliseconds(500);
|
||||
var on_orders = _orderservice.subscribei_orders().Naggle(interval, scheduler).PermissionFilter(_adminobservable).Table().Cache();
|
||||
var on_fills = _orderservice.subscribei_fills().Naggle(interval, scheduler).PermissionFilter(_adminobservable).Table().Cache();
|
||||
|
||||
_ordersdisp = on_orders.Subscribe(o =>
|
||||
{
|
||||
foreach (var order in o.added)
|
||||
{
|
||||
var ostat = build_order_status(sessionID, order);
|
||||
_order_cache[order.Key] = order;
|
||||
send(ostat, sessionID);
|
||||
}
|
||||
foreach (var order in o.changed)
|
||||
{
|
||||
var ostat = build_order_status(sessionID, order, true);
|
||||
send(ostat, sessionID);
|
||||
}
|
||||
});
|
||||
|
||||
_fillsdisp = on_fills.Subscribe(f =>
|
||||
{
|
||||
foreach (var fill in f.added)
|
||||
{
|
||||
var fi = build_fill(sessionID, fill);
|
||||
send(fi, sessionID);
|
||||
}
|
||||
foreach (var fill in f.changed)
|
||||
{
|
||||
var fi = build_fill(sessionID, fill);
|
||||
send(fi, sessionID);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
virtual protected void process_order_state(in OrderStateImmutable state, ref uint filled, ref uint leaves, ref double avgprx,
|
||||
ref QuickFix.Fields.OrdStatus fstatus, ref NativeOrderStateImmutable? native)
|
||||
{
|
||||
filled = state.FilledQuantity;
|
||||
leaves = state.Quantity - state.FilledQuantity;
|
||||
avgprx = state.AvgPrice;
|
||||
fstatus = translate_status(state, ref native);
|
||||
}
|
||||
|
||||
protected bts.api.SecurityImmutable? resolve_execution_report_security(bts.api.SecurityImmutable? sec, QuickFix.FIX44.ExecutionReport report)
|
||||
{
|
||||
report.SecurityExchange = convert_exchange(sec.Value.Exchange);
|
||||
var sectype = sec.Value.security_type();
|
||||
report.SecurityType = convert_security_type(sectype);
|
||||
if (sec.Value.HasGlbx)
|
||||
report.SecurityDesc = new SecurityDesc(sec.Value.Glbx.SecurityDesc);
|
||||
|
||||
switch (sectype)
|
||||
{
|
||||
case bts.api.SecurityType.Future:
|
||||
report.MaturityMonthYear = new MaturityMonthYear(bts.api.SecurityHelper.expiration_date(sec.Value.Future).ToString("yyyyMMdd"));
|
||||
break;
|
||||
case bts.api.SecurityType.Option:
|
||||
throw new NotSupportedException("No options yet");
|
||||
case bts.api.SecurityType.Spread:
|
||||
//report.MaturityMonthYear = new MaturityMonthYear(bts.api.SecurityHelper.EarliestExpiration(sec.Value).ToString("yyyyMMdd"));
|
||||
//TODO
|
||||
//bug here need to kill MDCLIENT
|
||||
break;
|
||||
default:
|
||||
report.MaturityMonthYear = new MaturityMonthYear(bts.api.SecurityHelper.EarliestExpiration(sec.Value).ToString("yyyyMMdd"));
|
||||
break;
|
||||
}
|
||||
return sec;
|
||||
}
|
||||
|
||||
virtual protected QuickFix.FIX44.ExecutionReport build_fill(SessionID sess, in FillImmutable fill, bool change = false)
|
||||
{
|
||||
var exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.FILL);
|
||||
QuickFix.Fields.OrdStatus status = new QuickFix.Fields.OrdStatus();
|
||||
uint filled = 0; uint leaves = 0; double prx = 0.0;
|
||||
OrderRecordImmutable order; NativeOrderStateImmutable? native = null;
|
||||
if (_order_cache.TryGetValue(fill.OrderKey, out order))
|
||||
{
|
||||
process_order_state(order.State, ref filled, ref leaves, ref prx, ref status, ref native);
|
||||
if (leaves > 0)
|
||||
exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.PARTIAL_FILL);
|
||||
}
|
||||
if (change)
|
||||
exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.TRADE_CORRECT);
|
||||
|
||||
var sec = _router.lookup(fill.SecurityKey);
|
||||
QuickFix.FIX44.ExecutionReport report = new QuickFix.FIX44.ExecutionReport(
|
||||
new OrderID(fill.OrderKey.ToString()),
|
||||
new ExecID(fill.FillKey.ToString()),
|
||||
exec,
|
||||
status,
|
||||
new Symbol(sec?.Symbol ?? string.Empty),
|
||||
new Side(fill.Side == bts.api.Side.Buy ? Side.BUY : Side.SELL),
|
||||
new LeavesQty(leaves),
|
||||
new CumQty(filled),
|
||||
new AvgPx(Convert.ToDecimal(prx)));
|
||||
|
||||
report.Account = new Account(fill.Account);
|
||||
report.LastQty = new LastQty(Convert.ToDecimal(fill.LastShares));
|
||||
report.LastPx = new LastPx(Convert.ToDecimal(fill.LastPrice));
|
||||
var ts = fill.HasTimestamp ? fill.Timestamp.ToDateTime() : DateTime.MinValue;
|
||||
report.TransactTime = new TransactTime(ts, true);
|
||||
report.TradeDate = new TradeDate(ts.ToString("yyyyMMdd"));
|
||||
sec = resolve_execution_report_security(sec, report);
|
||||
if (native.HasValue)
|
||||
report.SecondaryOrderID = new SecondaryOrderID(native.Value.ExchangeOrderId);
|
||||
|
||||
if (sec.HasValue && sec.Value.security_type() == bts.api.SecurityType.Spread ||
|
||||
sec.Value.security_type() == bts.api.SecurityType.Synthetic)
|
||||
{
|
||||
if (fill.FillKind == bts.api.orderman.Fill.Types.FillKind.Leg)
|
||||
report.MultiLegReportingType = new MultiLegReportingType('2');
|
||||
else
|
||||
report.MultiLegReportingType = new MultiLegReportingType('3');
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
virtual protected QuickFix.FIX44.ExecutionReport build_order_status(SessionID sess, in OrderRecordImmutable order, bool change = false)
|
||||
{
|
||||
var exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.NEW);
|
||||
if (_order_cache.TryGetValue(order.Key, out OrderRecordImmutable _))
|
||||
exec = new QuickFix.Fields.ExecType(QuickFix.Fields.ExecType.ORDER_STATUS);
|
||||
|
||||
QuickFix.Fields.OrdStatus status = new QuickFix.Fields.OrdStatus();
|
||||
uint filled = 0; uint leaves = 0; double prx = 0.0; NativeOrderStateImmutable? native = null;
|
||||
process_order_state(order.State, ref filled, ref leaves, ref prx, ref status, ref native);
|
||||
|
||||
var sec = _router.lookup(order.Def.SecurityKey);
|
||||
QuickFix.FIX44.ExecutionReport report = new QuickFix.FIX44.ExecutionReport(
|
||||
new OrderID(order.Key.ToString()),
|
||||
new ExecID("0"),
|
||||
exec,
|
||||
status,
|
||||
new Symbol(sec?.Symbol ?? string.Empty),
|
||||
new Side(order.Def.Side == bts.api.Side.Buy ? Side.BUY : Side.SELL),
|
||||
new LeavesQty(leaves),
|
||||
new CumQty(filled),
|
||||
new AvgPx(Convert.ToDecimal(prx)));
|
||||
|
||||
report.Account = new Account(order.Def.Account);
|
||||
report.OrderQty = new OrderQty(order.State.Quantity);
|
||||
report.Price = new Price(Convert.ToDecimal(order.State.Price));
|
||||
report.TimeInForce = new QuickFix.Fields.TimeInForce((char)order.Def.TimeInForce);
|
||||
var ts = order.State.LastChange.ToDateTime();
|
||||
report.TransactTime = new TransactTime(ts, true);
|
||||
if(!string.IsNullOrEmpty(order.State.LastMsg))
|
||||
report.Text = new Text(order.State.LastMsg);
|
||||
|
||||
sec = resolve_execution_report_security(sec, report);
|
||||
if (native.HasValue)
|
||||
{
|
||||
report.SecondaryOrderID = new SecondaryOrderID(native.Value.ExchangeOrderId);
|
||||
report.OrdType = new OrdType((char)native.Value.NativeType);
|
||||
}
|
||||
//TODO Big race here, we need a correlation id of some sort
|
||||
if (_fix_clorderids.TryGetValue(order.Key, out string clorderid))
|
||||
{
|
||||
report.ClOrdID = new ClOrdID(clorderid);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using QuickFix;
|
||||
using QuickFix.Fields;
|
||||
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
class OrderSession : DropCopySession, QuickFix.IApplication
|
||||
{
|
||||
public OrderSession(IFixRouter router, SessionID sess) : base(router, sess)
|
||||
{
|
||||
}
|
||||
|
||||
override public void FromApp(Message message, SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
MsgType type = Message.IdentifyType(message.ToString());
|
||||
switch (type.getValue())
|
||||
{
|
||||
case MsgType.ORDER_STATUS_REQUEST:
|
||||
case MsgType.SECURITYDEFINITIONREQUEST:
|
||||
|
||||
case MsgType.NEWORDERSINGLE:
|
||||
case MsgType.ORDERCANCELREPLACEREQUEST:
|
||||
case MsgType.ORDERCANCELREQUEST:
|
||||
log_info("IN: " + message);
|
||||
Crack(message, sessionID);
|
||||
break;
|
||||
default:
|
||||
log_info("UNSUPPORTED MESSAGE IN: " + type.getValue());
|
||||
throw new UnsupportedMessageType();
|
||||
}
|
||||
}
|
||||
|
||||
virtual public void OnMessage(QuickFix.FIX44.NewOrderSingle req, SessionID s)
|
||||
{
|
||||
Venue ven = convert_exchange(req.SecurityExchange);
|
||||
if(ven != Venue.Glbx)
|
||||
throw new IncorrectTagValue(req.SecurityExchange.Tag);
|
||||
|
||||
var sec = _router.lookup(req.Symbol.getValue());
|
||||
if(sec == null)
|
||||
sec = _router.lookup(req.SecurityDesc.getValue());
|
||||
if(!sec.HasValue)
|
||||
throw new IncorrectTagValue(req.SecurityDesc.Tag);
|
||||
|
||||
OrderDefinition def = new OrderDefinition()
|
||||
{
|
||||
Account = req.Account.getValue(),
|
||||
AccountId = lookup_account(req.Account.getValue()),
|
||||
SecurityKey = sec.Value.Id,
|
||||
Side = (api.Side)int.Parse(req.Side.getValue().ToString()),
|
||||
TimeInForce = (api.orderman.TimeInForce)int.Parse(req.TimeInForce.getValue().ToString()),
|
||||
User = _user_name,
|
||||
UserId = lookup_user(_user_name),
|
||||
ManualOrderIndicator = bts.api.orderman.ManualOrderIndicator.Yes,
|
||||
};
|
||||
|
||||
set_ordertype(def, req, out bool price_req);
|
||||
Create cr = new Create();
|
||||
if(price_req)
|
||||
cr.Price = Convert.ToDouble(req.Price.getValue());
|
||||
cr.NewOrder = def;
|
||||
cr.Quantity = Convert.ToUInt32(Math.Abs(req.OrderQty.getValue()));
|
||||
|
||||
_orderservice.create_order_async(cr);
|
||||
}
|
||||
|
||||
private void set_ordertype(OrderDefinition def, QuickFix.FIX44.NewOrderSingle req, out bool price_req)
|
||||
{
|
||||
price_req = false;
|
||||
switch (req.OrdType.getValue())
|
||||
{
|
||||
case '1':
|
||||
def.CustomDef = new CustomOrderDefinition { Market = new MarketOrderDefinition() };
|
||||
break;
|
||||
case '2':
|
||||
def.CustomDef = new CustomOrderDefinition { Limit = new LimitOrderDefinition() };
|
||||
price_req = true;
|
||||
break;
|
||||
case '3':
|
||||
def.CustomDef = new CustomOrderDefinition { Stop = new StopOrderDefinition() {StopPrice = Convert.ToDouble(req.StopPx.getValue()) } };
|
||||
break;
|
||||
case '4':
|
||||
def.CustomDef = new CustomOrderDefinition { StopLimit = new StopLimitOrderDefinition() { StopPrice = Convert.ToDouble(req.StopPx.getValue()) } };
|
||||
price_req = true;
|
||||
break;
|
||||
default:
|
||||
throw new IncorrectTagValue(req.OrdType.Tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Concurrency;
|
||||
using System.Text;
|
||||
|
||||
using QuickFix;
|
||||
using QuickFix.Fields;
|
||||
|
||||
|
||||
using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.api.user;
|
||||
using bts.api.admin;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
namespace bts.fix
|
||||
{
|
||||
abstract class SessionBase : QuickFix.MessageCracker, QuickFix.IApplication
|
||||
{
|
||||
protected static UserService _userservice = bts.api.Locator.locate<UserService>();
|
||||
protected static OrderService _orderservice = bts.api.Locator.locate<OrderService>();
|
||||
protected static AdminService _adminservice = bts.api.Locator.locate<AdminService>();
|
||||
protected static bts.metrics.ShellLatencyService _latencyservice = bts.api.Locator.locate<bts.metrics.ShellLatencyService>();
|
||||
|
||||
protected string _user_name;
|
||||
protected AuthToken _token;
|
||||
|
||||
protected IDisposable _admindisp;
|
||||
protected IObservable<AdminModelWrapper> _adminobservable;
|
||||
protected AdminDataImmutable? _admin_data;
|
||||
|
||||
protected readonly IFixRouter _router;
|
||||
protected readonly SessionID _sess;
|
||||
|
||||
public SessionBase(IFixRouter router, SessionID sess)
|
||||
{
|
||||
_router = router;
|
||||
_sess = sess;
|
||||
|
||||
_clockdisp = _latencyservice.subscribe_clock().Subscribe(x =>
|
||||
{
|
||||
var t = x.all.FirstOrDefault();
|
||||
if(t != null)
|
||||
_clock = t.Timestamp;
|
||||
});
|
||||
|
||||
_adminobservable = _adminservice.subscribei_admin_data().Select(x =>
|
||||
{
|
||||
return new AdminModelWrapper(x.all.TryFirst(), _user_name);
|
||||
});
|
||||
_admindisp = _adminobservable.Subscribe(x => _admin_data = x.admin_data);
|
||||
}
|
||||
|
||||
abstract public void FromApp(Message message, SessionID sessionID);
|
||||
abstract public void OnLogon(SessionID sessionID); //subscribe to your stuff
|
||||
abstract public void OnLogout(SessionID sessionID); //unsub
|
||||
|
||||
virtual public void ToApp(Message message, SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
log_info("OUT: " + message);
|
||||
}
|
||||
|
||||
readonly IDisposable _clockdisp; ulong _clock = 0;
|
||||
virtual public void FromAdmin(Message message, SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
|
||||
MsgType type = Message.IdentifyType(message.ToString());
|
||||
switch (type.getValue())
|
||||
{
|
||||
case MsgType.LOGON:
|
||||
{
|
||||
try
|
||||
{
|
||||
QuickFix.FIX44.Logon msg = (QuickFix.FIX44.Logon)message;
|
||||
_user_name = msg.Username.getValue();
|
||||
string pass = string.Empty;
|
||||
if(msg.IsSetPassword())
|
||||
pass = msg.Password.getValue();
|
||||
var resp = _userservice.authenticate_login(new AuthenticateLoginRequest {
|
||||
Login = msg.Username.getValue(), Password = pass});
|
||||
if (resp != null && resp.IsValid)
|
||||
_token = resp.Token;
|
||||
else
|
||||
throw new RejectLogon("Logon rejected " + resp?.Reason ?? string.Empty);
|
||||
}
|
||||
catch (RejectLogon)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new RejectLogon("Logon rejected " + ex.ToString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MsgType.HEARTBEAT:
|
||||
{
|
||||
QuickFix.FIX44.Heartbeat hb = (QuickFix.FIX44.Heartbeat)message;
|
||||
handle_heartbeat(hb, sessionID);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
log_info("ADMININ: " + message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async protected void handle_heartbeat(QuickFix.FIX44.Heartbeat hb, SessionID sessionID)
|
||||
{
|
||||
var resp = await _latencyservice.report_async(new bts.metrics.Report { HostName = "BTSFIX_" + sessionID.ToString(),
|
||||
Timestamp = _clock, User = _user_name });
|
||||
if (resp.success)
|
||||
send(hb, sessionID);
|
||||
}
|
||||
|
||||
virtual public void ToAdmin(Message message, SessionID sessionID)
|
||||
{
|
||||
Log.assert_d(sessionID.Equals(_sess));
|
||||
log_info("ADMINOUT: " + message);
|
||||
}
|
||||
|
||||
virtual public void OnCreate(SessionID sessionID)
|
||||
{
|
||||
log_info("CREATE");
|
||||
}
|
||||
|
||||
virtual public void OnMessage(QuickFix.FIX44.BusinessMessageReject n, SessionID s)
|
||||
{
|
||||
//Log.assert(false, "biz reject wtf " + n.EncodedText.getValue());
|
||||
Log.FIX.warn(_sess.ToString() + " Business Reject " + n.BusinessRejectReason.getValue() + " " + n.Text.getValue());
|
||||
}
|
||||
virtual public void OnMessage(QuickFix.FIX44.News n, SessionID s)
|
||||
{
|
||||
log_info("news " + n.EncodedHeadline.getValue());
|
||||
}
|
||||
|
||||
|
||||
protected void log_info(string message, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
|
||||
{
|
||||
Log.FIX.info(_sess.ToString() + " " + message, file, line);
|
||||
}
|
||||
|
||||
protected void log_error(string message, [CallerFilePath] string file = "", [CallerLineNumber] int line = 0)
|
||||
{
|
||||
Log.FIX.error(_sess.ToString() + " " + message, file, line);
|
||||
}
|
||||
|
||||
protected void send(Message mess, SessionID sess)
|
||||
{
|
||||
try
|
||||
{
|
||||
Session.SendToTarget(mess, sess);
|
||||
}
|
||||
catch (SessionNotFound ex)
|
||||
{
|
||||
log_error("==session not found exception!==");
|
||||
log_error(ex.ToString());
|
||||
Log.assert(false, "session not found " + sess);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log_error("==exception sending to " + sess + " " + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void send_reject(SessionID sess, string text, Message refmessage = null)
|
||||
{
|
||||
var seq = new QuickFix.Fields.MsgSeqNum();
|
||||
QuickFix.FIX44.Reject rej = null;
|
||||
if (refmessage.Header.IsSetField(seq))
|
||||
rej = new QuickFix.FIX44.Reject(new QuickFix.Fields.RefSeqNum(seq.getValue()));
|
||||
else
|
||||
rej = new QuickFix.FIX44.Reject();
|
||||
rej.Text = new Text(text);
|
||||
send(rej, sess);
|
||||
}
|
||||
|
||||
protected bool security_types_equal(bts.api.SecurityType btstype, QuickFix.Fields.SecurityType fixtype)
|
||||
{
|
||||
return btstype == convert_security_type(fixtype);
|
||||
}
|
||||
|
||||
protected QuickFix.Fields.SecurityType convert_security_type(bts.api.SecurityType btstype)
|
||||
{
|
||||
switch (btstype)
|
||||
{
|
||||
case bts.api.SecurityType.Future:
|
||||
return new QuickFix.Fields.SecurityType("FUT");
|
||||
case bts.api.SecurityType.Option:
|
||||
return new QuickFix.Fields.SecurityType("OPT");
|
||||
case bts.api.SecurityType.Spread:
|
||||
return new QuickFix.Fields.SecurityType("MLEG");
|
||||
case bts.api.SecurityType.Stock:
|
||||
return new QuickFix.Fields.SecurityType("CS");
|
||||
case bts.api.SecurityType.Synthetic:
|
||||
return new QuickFix.Fields.SecurityType("SYNTH");
|
||||
default:
|
||||
return new QuickFix.Fields.SecurityType();
|
||||
}
|
||||
}
|
||||
|
||||
protected bts.api.SecurityType convert_security_type(QuickFix.Fields.SecurityType fixtype)
|
||||
{
|
||||
switch (fixtype.getValue())
|
||||
{
|
||||
case "FUT":
|
||||
return bts.api.SecurityType.Future;
|
||||
case "OPT":
|
||||
return bts.api.SecurityType.Option;
|
||||
case "MLEG":
|
||||
return bts.api.SecurityType.Spread;
|
||||
case "CS":
|
||||
return bts.api.SecurityType.Stock;
|
||||
case "SYNTH":
|
||||
return bts.api.SecurityType.Synthetic;
|
||||
default:
|
||||
return bts.api.SecurityType.Unset;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool exchanges_equal(bts.api.Venue btstype, QuickFix.Fields.SecurityExchange fixtype)
|
||||
{
|
||||
return btstype == convert_exchange(fixtype);
|
||||
}
|
||||
|
||||
protected QuickFix.Fields.SecurityExchange convert_exchange(bts.api.Venue btstype)
|
||||
{
|
||||
switch (btstype)
|
||||
{
|
||||
case bts.api.Venue.Bts:
|
||||
return new QuickFix.Fields.SecurityExchange("BTS");
|
||||
case bts.api.Venue.Cboe:
|
||||
return new QuickFix.Fields.SecurityExchange("XCBO");
|
||||
case bts.api.Venue.Cboecfe:
|
||||
return new QuickFix.Fields.SecurityExchange("XCBF");
|
||||
case bts.api.Venue.Glbx:
|
||||
return new QuickFix.Fields.SecurityExchange("XCME");
|
||||
case bts.api.Venue.Ice:
|
||||
return new QuickFix.Fields.SecurityExchange("IEPA");
|
||||
case bts.api.Venue.Sim:
|
||||
return new QuickFix.Fields.SecurityExchange("SIM");
|
||||
default:
|
||||
return new QuickFix.Fields.SecurityExchange();
|
||||
}
|
||||
}
|
||||
|
||||
protected bts.api.Venue convert_exchange(QuickFix.Fields.SecurityExchange fixtype)
|
||||
{
|
||||
switch (fixtype.getValue())
|
||||
{
|
||||
case "BTS":
|
||||
return bts.api.Venue.Bts;
|
||||
case "XCBO":
|
||||
return bts.api.Venue.Cboe;
|
||||
case "XCBF":
|
||||
return bts.api.Venue.Cboecfe;
|
||||
case "XCME":
|
||||
case "XCBT":
|
||||
case "XCEC":
|
||||
case "XNYM":
|
||||
return bts.api.Venue.Glbx;
|
||||
case "IEPA":
|
||||
case "IFUS":
|
||||
case "IFEU":
|
||||
case "IFLL":
|
||||
return bts.api.Venue.Ice;
|
||||
case "SIM":
|
||||
return bts.api.Venue.Sim;
|
||||
default:
|
||||
return bts.api.Venue.Unset;
|
||||
}
|
||||
}
|
||||
|
||||
protected QuickFix.Fields.OrdStatus translate_status(in bts.api.orderman.OrderStateImmutable state,
|
||||
ref bts.api.orderman.NativeOrderStateImmutable? native)
|
||||
{
|
||||
native = null;
|
||||
if (state.HasMarket)
|
||||
{
|
||||
native = state.Market.NativeState;
|
||||
return new OrdStatus((char)native?.NativeStatus);
|
||||
}
|
||||
else if (state.HasLimit)
|
||||
{
|
||||
native = state.Limit.NativeState;
|
||||
return new OrdStatus((char)native?.NativeStatus);
|
||||
}
|
||||
else if (state.HasStop)
|
||||
{
|
||||
native = state.Stop.NativeState;
|
||||
return new OrdStatus((char)native?.NativeStatus);
|
||||
}
|
||||
else if (state.HasStopLimit)
|
||||
{
|
||||
native = state.StopLimit.NativeState;
|
||||
return new OrdStatus((char)native?.NativeStatus);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (state.Status)
|
||||
{
|
||||
case OrderStatus.Canceled:
|
||||
return new OrdStatus(OrdStatus.CANCELED);
|
||||
case OrderStatus.Completed:
|
||||
return new OrdStatus(OrdStatus.FILLED);
|
||||
case OrderStatus.Disconnected:
|
||||
return new OrdStatus(OrdStatus.STOPPED);
|
||||
case OrderStatus.Error:
|
||||
return new OrdStatus(OrdStatus.REJECTED);
|
||||
case OrderStatus.Inactive:
|
||||
return new OrdStatus(OrdStatus.PENDING_NEW);
|
||||
case OrderStatus.PendingWorking:
|
||||
return new OrdStatus(OrdStatus.PENDING_NEW);
|
||||
case OrderStatus.RejectedBySpark:
|
||||
return new OrdStatus(OrdStatus.REJECTED);
|
||||
case OrderStatus.Working:
|
||||
{
|
||||
if (state.FilledQuantity < state.Quantity)
|
||||
return new OrdStatus(OrdStatus.PARTIALLY_FILLED);
|
||||
else
|
||||
return new OrdStatus(OrdStatus.NEW);
|
||||
}
|
||||
default:
|
||||
return new OrdStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected uint lookup_account(string acct)
|
||||
{
|
||||
if (_admin_data.HasValue)
|
||||
{
|
||||
var ac = _admin_data.Value.Accounts.Where(x => x.Name == acct).TryFirst();
|
||||
if(ac.HasValue)
|
||||
return ac.Value.Id;
|
||||
}
|
||||
throw new IncorrectTagValue(new Account().Tag);
|
||||
}
|
||||
|
||||
protected uint lookup_user(string user)
|
||||
{
|
||||
if (_admin_data.HasValue)
|
||||
{
|
||||
var ac = _admin_data.Value.Users.Where(x => x.Name == user).TryFirst();
|
||||
if (ac.HasValue)
|
||||
return ac.Value.Id;
|
||||
}
|
||||
throw new IncorrectTagValue(new Username().Tag);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#http://www.quickfixengine.org/quickfix/doc/html/configuration.html
|
||||
#https://www.onixs.biz/fix-dictionary.html
|
||||
|
||||
[DEFAULT]
|
||||
ConnectionType=acceptor
|
||||
SocketAcceptPort=5001
|
||||
SocketReuseAddress=Y
|
||||
StartTime=00:00:00
|
||||
EndTime=00:00:00
|
||||
FileLogPath=log
|
||||
UseDataDictionary=Y
|
||||
ResetOnLogon=Y
|
||||
ResetOnLogout=Y
|
||||
ResetOnDisconnect=Y
|
||||
|
||||
HeartBtInt=30
|
||||
LogonTimeout=30
|
||||
|
||||
SSLEnable=N
|
||||
# SSLEnable=Y
|
||||
# # It is recommended to install the certificate and refer to it by name instead of using filename + password
|
||||
# SSLCertificate=QuickFixn-TestServer.pfx
|
||||
# SSLCertificatePassword=QuickFixn-TestServer
|
||||
# # For production refer to certificate by name instead: SSLCertificate=CN=QuickFixn-TestServer
|
||||
# SSLCACertificate=QuickFixn-TestCA.cer
|
||||
# SSLCheckCertificateRevocation=N
|
||||
|
||||
|
||||
[SESSION]
|
||||
BeginString=FIX.4.4
|
||||
SenderCompID=SPARK
|
||||
TargetCompID=CLIENT1
|
||||
FileStorePath=store
|
||||
DataDictionary=./spec/fix/FIX44.xml
|
||||
|
||||
[SESSION]
|
||||
BeginString=FIX.4.4
|
||||
SenderCompID=SPARK
|
||||
TargetCompID=CLIENT2
|
||||
FileStorePath=store
|
||||
DataDictionary=./spec/fix/FIX44.xml
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
|
||||
<Authors>Blue Trading Systems</Authors>
|
||||
<Company>Blue Trading Systems</Company>
|
||||
<Product>Spark</Product>
|
||||
<Description />
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<WarningsAsErrors />
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<Version>1.0.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.4.0" />
|
||||
<PackageReference Include="System.Reactive" Version="3.1.1" />
|
||||
<PackageReference Include="System.Reactive.PlatformServices" Version="3.1.1" />
|
||||
<PackageReference Include="NUnit" Version="3.10.1" />
|
||||
|
||||
<PackageReference Include="QuickFix.Net.NETCore" Version="1.8.1" />
|
||||
<PackageReference Include="QuickFix.Net.NETCore.FIX44" Version="1.8.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../spark_api/spark_api.csproj"/>
|
||||
<ProjectReference Include="../spark_core/spark_core.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="copy_fix" AfterTargets="PostBuildEvent" >
|
||||
<Copy SourceFiles="./spark_fix.cfg" DestinationFolder="$(OutputPath)\" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="./spec/fix/FIX44.xml" DestinationFolder="$(OutputPath)/spec/fix/" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="copy_fix471" AfterTargets="PostBuildEvent" >
|
||||
<Copy SourceFiles="./spark_fix.cfg" DestinationFolder="$(OutputPath)/../net471" SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="./spec/fix/FIX44.xml" DestinationFolder="$(OutputPath)/../net471/spec/fix/" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,828 @@
|
||||
<fix major="4" minor="0">
|
||||
<header>
|
||||
<field name="BeginString" required="Y"/>
|
||||
<field name="BodyLength" required="Y"/>
|
||||
<field name="MsgType" required="Y"/>
|
||||
<field name="SenderCompID" required="Y"/>
|
||||
<field name="TargetCompID" required="Y"/>
|
||||
<field name="OnBehalfOfCompID" required="N"/>
|
||||
<field name="DeliverToCompID" required="N"/>
|
||||
<field name="SecureDataLen" required="N"/>
|
||||
<field name="SecureData" required="N"/>
|
||||
<field name="MsgSeqNum" required="Y"/>
|
||||
<field name="SenderSubID" required="N"/>
|
||||
<field name="TargetSubID" required="N"/>
|
||||
<field name="OnBehalfOfSubID" required="N"/>
|
||||
<field name="DeliverToSubID" required="N"/>
|
||||
<field name="PossDupFlag" required="N"/>
|
||||
<field name="PossResend" required="N"/>
|
||||
<field name="SendingTime" required="Y"/>
|
||||
<field name="OrigSendingTime" required="N"/>
|
||||
</header>
|
||||
<trailer>
|
||||
<field name="SignatureLength" required="N"/>
|
||||
<field name="Signature" required="N"/>
|
||||
<field name="CheckSum" required="Y"/>
|
||||
</trailer>
|
||||
<messages>
|
||||
<message name="Heartbeat" msgtype="0" msgcat="admin">
|
||||
<field name="TestReqID" required="N"/>
|
||||
</message>
|
||||
<message name="Logon" msgtype="A" msgcat="admin">
|
||||
<field name="EncryptMethod" required="Y"/>
|
||||
<field name="HeartBtInt" required="Y"/>
|
||||
<field name="RawDataLength" required="N"/>
|
||||
<field name="RawData" required="N"/>
|
||||
</message>
|
||||
<message name="TestRequest" msgtype="1" msgcat="admin">
|
||||
<field name="TestReqID" required="Y"/>
|
||||
</message>
|
||||
<message name="ResendRequest" msgtype="2" msgcat="admin">
|
||||
<field name="BeginSeqNo" required="Y"/>
|
||||
<field name="EndSeqNo" required="Y"/>
|
||||
</message>
|
||||
<message name="Reject" msgtype="3" msgcat="admin">
|
||||
<field name="RefSeqNum" required="Y"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="SequenceReset" msgtype="4" msgcat="admin">
|
||||
<field name="GapFillFlag" required="N"/>
|
||||
<field name="NewSeqNo" required="Y"/>
|
||||
</message>
|
||||
<message name="Logout" msgtype="5" msgcat="admin">
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="Advertisement" msgtype="7" msgcat="app">
|
||||
<field name="AdvId" required="Y"/>
|
||||
<field name="AdvTransType" required="Y"/>
|
||||
<field name="AdvRefID" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="AdvSide" required="Y"/>
|
||||
<field name="Shares" required="Y"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="TransactTime" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="IndicationofInterest" msgtype="6" msgcat="app">
|
||||
<field name="IOIid" required="Y"/>
|
||||
<field name="IOITransType" required="Y"/>
|
||||
<field name="IOIRefID" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="IOIShares" required="Y"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="ValidUntilTime" required="N"/>
|
||||
<field name="IOIQltyInd" required="N"/>
|
||||
<field name="IOIOthSvc" required="N"/>
|
||||
<field name="IOINaturalFlag" required="N"/>
|
||||
<field name="IOIQualifier" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="News" msgtype="B" msgcat="app">
|
||||
<field name="OrigTime" required="N"/>
|
||||
<field name="Urgency" required="N"/>
|
||||
<field name="RelatdSym" required="N" repeating="Y"/>
|
||||
<group name="LinesOfText" required="Y">
|
||||
<field name="Text" required="Y"/>
|
||||
</group>
|
||||
<field name="RawDataLength" required="N"/>
|
||||
<field name="RawData" required="N"/>
|
||||
</message>
|
||||
<message name="Email" msgtype="C" msgcat="app">
|
||||
<field name="EmailType" required="Y"/>
|
||||
<field name="OrigTime" required="N"/>
|
||||
<field name="RelatdSym" required="N" repeating="Y"/>
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ClOrdID" required="N"/>
|
||||
<group name="LinesOfText" required="Y">
|
||||
<field name="Text" required="Y"/>
|
||||
</group>
|
||||
<field name="RawDataLength" required="N"/>
|
||||
<field name="RawData" required="N"/>
|
||||
</message>
|
||||
<message name="QuoteRequest" msgtype="R" msgcat="app">
|
||||
<field name="QuoteReqID" required="Y"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="PrevClosePx" required="N"/>
|
||||
<field name="Side" required="N"/>
|
||||
<field name="OrderQty" required="N"/>
|
||||
</message>
|
||||
<message name="Quote" msgtype="S" msgcat="app">
|
||||
<field name="QuoteReqID" required="N"/>
|
||||
<field name="QuoteID" required="Y"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="BidPx" required="Y"/>
|
||||
<field name="OfferPx" required="N"/>
|
||||
<field name="BidSize" required="N"/>
|
||||
<field name="OfferSize" required="N"/>
|
||||
<field name="ValidUntilTime" required="N"/>
|
||||
</message>
|
||||
<message name="NewOrderSingle" msgtype="D" msgcat="app">
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="Account" required="N"/>
|
||||
<field name="SettlmntTyp" required="N"/>
|
||||
<field name="FutSettDate" required="N"/>
|
||||
<field name="HandlInst" required="Y"/>
|
||||
<field name="ExecInst" required="N"/>
|
||||
<field name="MinQty" required="N"/>
|
||||
<field name="MaxFloor" required="N"/>
|
||||
<field name="ExDestination" required="N"/>
|
||||
<field name="ProcessCode" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="PrevClosePx" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="LocateReqd" required="N"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="OrdType" required="Y"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="StopPx" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="IOIid" required="N"/>
|
||||
<field name="QuoteID" required="N"/>
|
||||
<field name="TimeInForce" required="N"/>
|
||||
<field name="ExpireTime" required="N"/>
|
||||
<field name="Commission" required="N"/>
|
||||
<field name="CommType" required="N"/>
|
||||
<field name="Rule80A" required="N"/>
|
||||
<field name="ForexReq" required="N"/>
|
||||
<field name="SettlCurrency" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="ExecutionReport" msgtype="8" msgcat="app">
|
||||
<field name="OrderID" required="Y"/>
|
||||
<field name="ClOrdID" required="N"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="ListID" required="N"/>
|
||||
<field name="ExecID" required="Y"/>
|
||||
<field name="ExecTransType" required="Y"/>
|
||||
<field name="ExecRefID" required="N"/>
|
||||
<field name="OrdStatus" required="Y"/>
|
||||
<field name="OrdRejReason" required="N"/>
|
||||
<field name="Account" required="N"/>
|
||||
<field name="SettlmntTyp" required="N"/>
|
||||
<field name="FutSettDate" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="OrdType" required="N"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="StopPx" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="TimeInForce" required="N"/>
|
||||
<field name="ExpireTime" required="N"/>
|
||||
<field name="ExecInst" required="N"/>
|
||||
<field name="Rule80A" required="N"/>
|
||||
<field name="LastShares" required="Y"/>
|
||||
<field name="LastPx" required="Y"/>
|
||||
<field name="LastMkt" required="N"/>
|
||||
<field name="LastCapacity" required="N"/>
|
||||
<field name="CumQty" required="Y"/>
|
||||
<field name="AvgPx" required="Y"/>
|
||||
<field name="TradeDate" required="N"/>
|
||||
<field name="TransactTime" required="N"/>
|
||||
<field name="ReportToExch" required="N"/>
|
||||
<field name="Commission" required="N"/>
|
||||
<field name="CommType" required="N"/>
|
||||
<group name="NoMiscFees" required="N">
|
||||
<field name="MiscFeeAmt" required="N"/>
|
||||
<field name="MiscFeeCurr" required="N"/>
|
||||
<field name="MiscFeeType" required="N"/>
|
||||
</group>
|
||||
<field name="NetMoney" required="N"/>
|
||||
<field name="SettlCurrAmt" required="N"/>
|
||||
<field name="SettlCurrency" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="DontKnowTrade" msgtype="Q" msgcat="app">
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ExecID" required="N"/>
|
||||
<field name="DKReason" required="Y"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="LastShares" required="Y"/>
|
||||
<field name="LastPx" required="Y"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="OrderCancelReplaceRequest" msgtype="G" msgcat="app">
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="OrigClOrdID" required="Y"/>
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ListID" required="N"/>
|
||||
<field name="Account" required="N"/>
|
||||
<field name="SettlmntTyp" required="N"/>
|
||||
<field name="FutSettDate" required="N"/>
|
||||
<field name="HandlInst" required="Y"/>
|
||||
<field name="ExecInst" required="N"/>
|
||||
<field name="MinQty" required="N"/>
|
||||
<field name="MaxFloor" required="N"/>
|
||||
<field name="ExDestination" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="OrdType" required="Y"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="StopPx" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="TimeInForce" required="N"/>
|
||||
<field name="ExpireTime" required="N"/>
|
||||
<field name="Commission" required="N"/>
|
||||
<field name="CommType" required="N"/>
|
||||
<field name="Rule80A" required="N"/>
|
||||
<field name="ForexReq" required="N"/>
|
||||
<field name="SettlCurrency" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="OrderCancelRequest" msgtype="F" msgcat="app">
|
||||
<field name="OrigClOrdID" required="Y"/>
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ListID" required="N"/>
|
||||
<field name="CxlType" required="Y"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="OrderCancelReject" msgtype="9" msgcat="app">
|
||||
<field name="OrderID" required="Y"/>
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="ListID" required="N"/>
|
||||
<field name="CxlRejReason" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="OrderStatusRequest" msgtype="H" msgcat="app">
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
</message>
|
||||
<message name="Allocation" msgtype="J" msgcat="app">
|
||||
<field name="AllocID" required="Y"/>
|
||||
<field name="AllocTransType" required="Y"/>
|
||||
<field name="RefAllocID" required="N"/>
|
||||
<group name="NoOrders" required="Y">
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="OrderID" required="N"/>
|
||||
<field name="ListID" required="N"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
</group>
|
||||
<group name="NoExecs" required="N">
|
||||
<field name="ExecID" required="N"/>
|
||||
<field name="LastShares" required="N"/>
|
||||
<field name="LastPx" required="N"/>
|
||||
<field name="LastMkt" required="N"/>
|
||||
</group>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="Shares" required="Y"/>
|
||||
<field name="AvgPx" required="Y"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="AvgPrxPrecision" required="N"/>
|
||||
<field name="TradeDate" required="Y"/>
|
||||
<field name="TransactTime" required="N"/>
|
||||
<field name="SettlmntTyp" required="N"/>
|
||||
<field name="FutSettDate" required="N"/>
|
||||
<field name="NetMoney" required="N"/>
|
||||
<group name="NoMiscFees" required="N">
|
||||
<field name="MiscFeeAmt" required="N"/>
|
||||
<field name="MiscFeeCurr" required="N"/>
|
||||
<field name="MiscFeeType" required="N"/>
|
||||
</group>
|
||||
<field name="SettlCurrAmt" required="N"/>
|
||||
<field name="SettlCurrency" required="N"/>
|
||||
<field name="OpenClose" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
<group name="NoAllocs" required="Y">
|
||||
<field name="AllocAccount" required="Y"/>
|
||||
<field name="AllocShares" required="Y"/>
|
||||
<field name="ProcessCode" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="Commission" required="N"/>
|
||||
<field name="CommType" required="N"/>
|
||||
<group name="NoDlvyInst" required="N">
|
||||
<field name="BrokerOfCredit" required="N"/>
|
||||
<field name="DlvyInst" required="N"/>
|
||||
</group>
|
||||
</group>
|
||||
</message>
|
||||
<message name="AllocationACK" msgtype="P" msgcat="app">
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="AllocID" required="Y"/>
|
||||
<field name="TradeDate" required="Y"/>
|
||||
<field name="TransactTime" required="N"/>
|
||||
<field name="AllocStatus" required="Y"/>
|
||||
<field name="AllocRejCode" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="NewOrderList" msgtype="E" msgcat="app">
|
||||
<field name="ListID" required="Y"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
<field name="ListSeqNo" required="Y"/>
|
||||
<field name="ListNoOrds" required="Y"/>
|
||||
<field name="ListExecInst" required="N"/>
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="ClientID" required="N"/>
|
||||
<field name="ExecBroker" required="N"/>
|
||||
<field name="Account" required="N"/>
|
||||
<field name="SettlmntTyp" required="N"/>
|
||||
<field name="FutSettDate" required="N"/>
|
||||
<field name="HandlInst" required="Y"/>
|
||||
<field name="ExecInst" required="N"/>
|
||||
<field name="MinQty" required="N"/>
|
||||
<field name="MaxFloor" required="N"/>
|
||||
<field name="ExDestination" required="N"/>
|
||||
<field name="ProcessCode" required="N"/>
|
||||
<field name="Symbol" required="Y"/>
|
||||
<field name="SymbolSfx" required="N"/>
|
||||
<field name="SecurityID" required="N"/>
|
||||
<field name="IDSource" required="N"/>
|
||||
<field name="Issuer" required="N"/>
|
||||
<field name="SecurityDesc" required="N"/>
|
||||
<field name="PrevClosePx" required="N"/>
|
||||
<field name="Side" required="Y"/>
|
||||
<field name="LocateReqd" required="N"/>
|
||||
<field name="OrderQty" required="Y"/>
|
||||
<field name="OrdType" required="Y"/>
|
||||
<field name="Price" required="N"/>
|
||||
<field name="StopPx" required="N"/>
|
||||
<field name="Currency" required="N"/>
|
||||
<field name="TimeInForce" required="N"/>
|
||||
<field name="ExpireTime" required="N"/>
|
||||
<field name="Commission" required="N"/>
|
||||
<field name="CommType" required="N"/>
|
||||
<field name="Rule80A" required="N"/>
|
||||
<field name="ForexReq" required="N"/>
|
||||
<field name="SettlCurrency" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="ListStatus" msgtype="N" msgcat="app">
|
||||
<field name="ListID" required="Y"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
<field name="NoRpts" required="Y"/>
|
||||
<field name="RptSeq" required="Y"/>
|
||||
<group name="NoOrders" required="Y">
|
||||
<field name="ClOrdID" required="Y"/>
|
||||
<field name="CumQty" required="Y"/>
|
||||
<field name="CxlQty" required="Y"/>
|
||||
<field name="AvgPx" required="Y"/>
|
||||
</group>
|
||||
</message>
|
||||
<message name="ListExecute" msgtype="L" msgcat="app">
|
||||
<field name="ListID" required="Y"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="ListCancelRequest" msgtype="K" msgcat="app">
|
||||
<field name="ListID" required="Y"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
<message name="ListStatusRequest" msgtype="M" msgcat="app">
|
||||
<field name="ListID" required="Y"/>
|
||||
<field name="WaveNo" required="N"/>
|
||||
<field name="Text" required="N"/>
|
||||
</message>
|
||||
</messages>
|
||||
<fields>
|
||||
<field number="1" name="Account" type="STRING"/>
|
||||
<field number="2" name="AdvId" type="INT"/>
|
||||
<field number="3" name="AdvRefID" type="INT"/>
|
||||
<field number="4" name="AdvSide" type="STRING">
|
||||
<value enum="B" description="BUY"/>
|
||||
<value enum="S" description="SELL"/>
|
||||
<value enum="X" description="CROSS"/>
|
||||
<value enum="T" description="TRADE"/>
|
||||
</field>
|
||||
<field number="5" name="AdvTransType" type="STRING">
|
||||
<value enum="N" description="NEW"/>
|
||||
<value enum="C" description="CANCEL"/>
|
||||
<value enum="R" description="REPLACE"/>
|
||||
</field>
|
||||
<field number="6" name="AvgPx" type="FLOAT"/>
|
||||
<field number="7" name="BeginSeqNo" type="INT"/>
|
||||
<field number="8" name="BeginString" type="STRING"/>
|
||||
<field number="9" name="BodyLength" type="INT"/>
|
||||
<field number="10" name="CheckSum" type="STRING"/>
|
||||
<field number="11" name="ClOrdID" type="STRING"/>
|
||||
<field number="12" name="Commission" type="FLOAT"/>
|
||||
<field number="13" name="CommType" type="STRING">
|
||||
<value enum="1" description="PER_SHARE"/>
|
||||
<value enum="2" description="PERCENTAGE"/>
|
||||
<value enum="3" description="ABSOLUTE"/>
|
||||
</field>
|
||||
<field number="14" name="CumQty" type="INT"/>
|
||||
<field number="15" name="Currency" type="STRING"/>
|
||||
<field number="16" name="EndSeqNo" type="INT"/>
|
||||
<field number="17" name="ExecID" type="INT"/>
|
||||
<field number="18" name="ExecInst" type="MULTIPLEVALUESTRING">
|
||||
<value enum="1" description="NOT_HELD"/>
|
||||
<value enum="2" description="WORK"/>
|
||||
<value enum="3" description="GO_ALONG"/>
|
||||
<value enum="4" description="OVER_THE_DAY"/>
|
||||
<value enum="5" description="HELD"/>
|
||||
<value enum="6" description="PARTICIPATE_DONT_INITIATE"/>
|
||||
<value enum="7" description="STRICT_SCALE"/>
|
||||
<value enum="8" description="TRY_TO_SCALE"/>
|
||||
<value enum="9" description="STAY_ON_BIDSIDE"/>
|
||||
<value enum="0" description="STAY_ON_OFFERSIDE"/>
|
||||
<value enum="A" description="NO_CROSS"/>
|
||||
<value enum="B" description="OK_TO_CROSS"/>
|
||||
<value enum="C" description="CALL_FIRST"/>
|
||||
<value enum="D" description="PERCENT_OF_VOLUME"/>
|
||||
<value enum="E" description="DO_NOT_INCREASE_DNI"/>
|
||||
<value enum="F" description="DO_NOT_REDUCE_DNR"/>
|
||||
<value enum="G" description="ALL_OR_NONE_AON"/>
|
||||
<value enum="I" description="INSTITUTIONS_ONLY"/>
|
||||
<value enum="L" description="LAST_PEG"/>
|
||||
<value enum="M" description="MIDPRICE_PEG"/>
|
||||
<value enum="N" description="NONNEGOTIABLE"/>
|
||||
<value enum="O" description="OPENING_PEG"/>
|
||||
<value enum="P" description="MARKET_PEG"/>
|
||||
<value enum="R" description="PRIMARY_PEG"/>
|
||||
<value enum="S" description="SUSPEND"/>
|
||||
</field>
|
||||
<field number="19" name="ExecRefID" type="INT"/>
|
||||
<field number="20" name="ExecTransType" type="STRING">
|
||||
<value enum="0" description="NEW"/>
|
||||
<value enum="1" description="CANCEL"/>
|
||||
<value enum="2" description="CORRECT"/>
|
||||
<value enum="3" description="STATUS"/>
|
||||
</field>
|
||||
<field number="21" name="HandlInst" type="STRING">
|
||||
<value enum="1" description="AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION"/>
|
||||
<value enum="2" description="AUTOMATED_EXECUTION_ORDER_PUBLIC_BROKER_INTERVENTION_OK"/>
|
||||
<value enum="3" description="MANUAL_ORDER_BEST_EXECUTION"/>
|
||||
</field>
|
||||
<field number="22" name="IDSource" type="STRING">
|
||||
<value enum="1" description="CUSIP"/>
|
||||
<value enum="2" description="SEDOL"/>
|
||||
<value enum="3" description="QUIK"/>
|
||||
<value enum="4" description="ISIN_NUMBER"/>
|
||||
<value enum="5" description="RIC_CODE"/>
|
||||
</field>
|
||||
<field number="23" name="IOIid" type="INT"/>
|
||||
<field number="24" name="IOIOthSvc" type="STRING"/>
|
||||
<field number="25" name="IOIQltyInd" type="STRING">
|
||||
<value enum="L" description="LOW"/>
|
||||
<value enum="M" description="MEDIUM"/>
|
||||
<value enum="H" description="HIGH"/>
|
||||
</field>
|
||||
<field number="26" name="IOIRefID" type="INT"/>
|
||||
<field number="27" name="IOIShares" type="STRING"/>
|
||||
<field number="28" name="IOITransType" type="STRING">
|
||||
<value enum="N" description="NEW"/>
|
||||
<value enum="C" description="CANCEL"/>
|
||||
<value enum="R" description="REPLACE"/>
|
||||
</field>
|
||||
<field number="29" name="LastCapacity" type="STRING">
|
||||
<value enum="1" description="AGENT"/>
|
||||
<value enum="2" description="CROSS_AS_AGENT"/>
|
||||
<value enum="3" description="CROSS_AS_PRINCIPAL"/>
|
||||
<value enum="4" description="PRINCIPAL"/>
|
||||
</field>
|
||||
<field number="30" name="LastMkt" type="STRING"/>
|
||||
<field number="31" name="LastPx" type="FLOAT"/>
|
||||
<field number="32" name="LastShares" type="INT"/>
|
||||
<field number="33" name="LinesOfText" type="INT"/>
|
||||
<field number="34" name="MsgSeqNum" type="INT"/>
|
||||
<field number="35" name="MsgType" type="STRING"/>
|
||||
<field number="36" name="NewSeqNo" type="INT"/>
|
||||
<field number="37" name="OrderID" type="STRING"/>
|
||||
<field number="38" name="OrderQty" type="INT"/>
|
||||
<field number="39" name="OrdStatus" type="STRING">
|
||||
<value enum="0" description="NEW"/>
|
||||
<value enum="1" description="PARTIALLY_FILLED"/>
|
||||
<value enum="2" description="FILLED"/>
|
||||
<value enum="3" description="DONE_FOR_DAY"/>
|
||||
<value enum="4" description="CANCELED"/>
|
||||
<value enum="5" description="REPLACED"/>
|
||||
<value enum="6" description="PENDING_CANCELREPLACE"/>
|
||||
<value enum="7" description="STOPPED"/>
|
||||
<value enum="8" description="REJECTED"/>
|
||||
<value enum="9" description="SUSPENDED"/>
|
||||
<value enum="A" description="PENDING_NEW"/>
|
||||
<value enum="B" description="CALCULATED"/>
|
||||
<value enum="C" description="EXPIRED"/>
|
||||
</field>
|
||||
<field number="40" name="OrdType" type="STRING">
|
||||
<value enum="1" description="MARKET"/>
|
||||
<value enum="2" description="LIMIT"/>
|
||||
<value enum="3" description="STOP"/>
|
||||
<value enum="4" description="STOP_LIMIT"/>
|
||||
<value enum="5" description="MARKET_ON_CLOSE"/>
|
||||
<value enum="6" description="WITH_OR_WITHOUT"/>
|
||||
<value enum="7" description="LIMIT_OR_BETTER"/>
|
||||
<value enum="8" description="LIMIT_WITH_OR_WITHOUT"/>
|
||||
<value enum="9" description="ON_BASIS"/>
|
||||
<value enum="A" description="ON_CLOSE"/>
|
||||
<value enum="B" description="LIMIT_ON_CLOSE"/>
|
||||
<value enum="C" description="FOREX"/>
|
||||
<value enum="D" description="PREVIOUSLY_QUOTED"/>
|
||||
<value enum="E" description="PREVIOUSLY_INDICATED"/>
|
||||
<value enum="P" description="PEGGED"/>
|
||||
</field>
|
||||
<field number="41" name="OrigClOrdID" type="STRING"/>
|
||||
<field number="42" name="OrigTime" type="TIME"/>
|
||||
<field number="43" name="PossDupFlag" type="STRING">
|
||||
<value enum="Y" description="POSSIBLE_DUPLICATE"/>
|
||||
<value enum="N" description="ORIGINAL_TRANSMISSION"/>
|
||||
</field>
|
||||
<field number="44" name="Price" type="FLOAT"/>
|
||||
<field number="45" name="RefSeqNum" type="INT"/>
|
||||
<field number="46" name="RelatdSym" type="STRING"/>
|
||||
<field number="47" name="Rule80A" type="STRING">
|
||||
<value enum="A" description="AGENCY_SINGLE_ORDER"/>
|
||||
<value enum="D" description="PROGRAM_ORDER_INDEX_ARB_FOR_MEMBER_FIRMORG"/>
|
||||
<value enum="C" description="PROGRAM_ORDER_NONINDEX_ARB_FOR_MEMBER_FIRMORG"/>
|
||||
<value enum="J" description="PROGRAM_ORDER_INDEX_ARB_FOR_INDIVIDUAL_CUSTOMER"/>
|
||||
<value enum="K" description="PROGRAM_ORDER_NONINDEX_ARB_FOR_INDIVIDUAL_CUSTOMER"/>
|
||||
<value enum="U" description="PROGRAM_ORDER_INDEX_ARB_FOR_OTHER_AGENCY"/>
|
||||
<value enum="Y" description="PROGRAM_ORDER_NONINDEX_ARB_FOR_OTHER_AGENCY"/>
|
||||
<value enum="M" description="PROGRAM_ORDER_INDEX_ARB_FOR_OTHER_MEMBER"/>
|
||||
<value enum="N" description="PROGRAM_ORDER_NONINDEX_ARB_FOR_OTHER_MEMBER"/>
|
||||
<value enum="W" description="ALL_OTHER_ORDERS_AS_AGENT_FOR_OTHER_MEMBER"/>
|
||||
</field>
|
||||
<field number="48" name="SecurityID" type="STRING"/>
|
||||
<field number="49" name="SenderCompID" type="STRING"/>
|
||||
<field number="50" name="SenderSubID" type="STRING"/>
|
||||
<field number="52" name="SendingTime" type="TIME"/>
|
||||
<field number="53" name="Shares" type="INT"/>
|
||||
<field number="54" name="Side" type="STRING">
|
||||
<value enum="1" description="BUY"/>
|
||||
<value enum="2" description="SELL"/>
|
||||
<value enum="3" description="BUY_MINUS"/>
|
||||
<value enum="4" description="SELL_PLUS"/>
|
||||
<value enum="5" description="SELL_SHORT"/>
|
||||
<value enum="6" description="SELL_SHORT_EXEMPT"/>
|
||||
</field>
|
||||
<field number="55" name="Symbol" type="STRING"/>
|
||||
<field number="56" name="TargetCompID" type="STRING"/>
|
||||
<field number="57" name="TargetSubID" type="STRING"/>
|
||||
<field number="58" name="Text" type="STRING"/>
|
||||
<field number="59" name="TimeInForce" type="STRING">
|
||||
<value enum="0" description="DAY"/>
|
||||
<value enum="1" description="GOOD_TILL_CANCEL"/>
|
||||
<value enum="2" description="AT_THE_OPENING"/>
|
||||
<value enum="3" description="IMMEDIATE_OR_CANCEL"/>
|
||||
<value enum="4" description="FILL_OR_KILL"/>
|
||||
<value enum="5" description="GOOD_TILL_CROSSING"/>
|
||||
<value enum="6" description="GOOD_TILL_DATE"/>
|
||||
</field>
|
||||
<field number="60" name="TransactTime" type="TIME"/>
|
||||
<field number="61" name="Urgency" type="STRING">
|
||||
<value enum="0" description="NORMAL"/>
|
||||
<value enum="1" description="FLASH"/>
|
||||
<value enum="2" description="BACKGROUND"/>
|
||||
</field>
|
||||
<field number="62" name="ValidUntilTime" type="TIME"/>
|
||||
<field number="63" name="SettlmntTyp" type="STRING">
|
||||
<value enum="0" description="REGULAR"/>
|
||||
<value enum="1" description="CASH"/>
|
||||
<value enum="2" description="NEXT_DAY"/>
|
||||
<value enum="3" description="TPLUS2"/>
|
||||
<value enum="4" description="TPLUS3"/>
|
||||
<value enum="5" description="TPLUS4"/>
|
||||
<value enum="6" description="FUTURE"/>
|
||||
<value enum="7" description="WHEN_ISSUED"/>
|
||||
<value enum="8" description="SELLERS_OPTION"/>
|
||||
<value enum="9" description="TPLUS5"/>
|
||||
</field>
|
||||
<field number="64" name="FutSettDate" type="DATE"/>
|
||||
<field number="65" name="SymbolSfx" type="STRING"/>
|
||||
<field number="66" name="ListID" type="STRING"/>
|
||||
<field number="67" name="ListSeqNo" type="INT"/>
|
||||
<field number="68" name="ListNoOrds" type="INT"/>
|
||||
<field number="69" name="ListExecInst" type="STRING"/>
|
||||
<field number="70" name="AllocID" type="INT"/>
|
||||
<field number="71" name="AllocTransType" type="STRING">
|
||||
<value enum="0" description="NEW"/>
|
||||
<value enum="1" description="REPLACE"/>
|
||||
<value enum="2" description="CANCEL"/>
|
||||
</field>
|
||||
<field number="72" name="RefAllocID" type="INT"/>
|
||||
<field number="73" name="NoOrders" type="INT"/>
|
||||
<field number="74" name="AvgPrxPrecision" type="INT"/>
|
||||
<field number="75" name="TradeDate" type="DATE"/>
|
||||
<field number="76" name="ExecBroker" type="STRING"/>
|
||||
<field number="77" name="OpenClose" type="STRING"/>
|
||||
<field number="78" name="NoAllocs" type="INT"/>
|
||||
<field number="79" name="AllocAccount" type="STRING"/>
|
||||
<field number="80" name="AllocShares" type="INT"/>
|
||||
<field number="81" name="ProcessCode" type="STRING">
|
||||
<value enum="0" description="REGULAR"/>
|
||||
<value enum="1" description="SOFT_DOLLAR"/>
|
||||
<value enum="2" description="STEPIN"/>
|
||||
<value enum="3" description="STEPOUT"/>
|
||||
<value enum="4" description="SOFTDOLLAR_STEPIN"/>
|
||||
<value enum="5" description="SOFTDOLLAR_STEPOUT"/>
|
||||
<value enum="6" description="PLAN_SPONSOR"/>
|
||||
</field>
|
||||
<field number="82" name="NoRpts" type="INT"/>
|
||||
<field number="83" name="RptSeq" type="INT"/>
|
||||
<field number="84" name="CxlQty" type="INT"/>
|
||||
<field number="85" name="NoDlvyInst" type="INT"/>
|
||||
<field number="86" name="DlvyInst" type="STRING"/>
|
||||
<field number="87" name="AllocStatus" type="INT">
|
||||
<value enum="0" description="ACCEPTED"/>
|
||||
<value enum="1" description="REJECTED"/>
|
||||
<value enum="2" description="PARTIAL_ACCEPT"/>
|
||||
<value enum="3" description="RECEIVED"/>
|
||||
</field>
|
||||
<field number="88" name="AllocRejCode" type="INT">
|
||||
<value enum="0" description="UNKNOWN_ACCOUNT"/>
|
||||
<value enum="1" description="INCORRECT_QUANTITY"/>
|
||||
<value enum="2" description="INCORRECT_AVERAGE_PRICE"/>
|
||||
<value enum="3" description="UNKNOWN_EXECUTING_BROKER_MNEMONIC"/>
|
||||
<value enum="4" description="COMMISSION_DIFFERENCE"/>
|
||||
<value enum="5" description="UNKNOWN_ORDERID"/>
|
||||
<value enum="6" description="UNKNOWN_LISTID"/>
|
||||
<value enum="7" description="OTHER"/>
|
||||
</field>
|
||||
<field number="89" name="Signature" type="DATA"/>
|
||||
<field number="90" name="SecureDataLen" type="INT"/>
|
||||
<field number="91" name="SecureData" type="DATA"/>
|
||||
<field number="92" name="BrokerOfCredit" type="STRING"/>
|
||||
<field number="93" name="SignatureLength" type="INT"/>
|
||||
<field number="94" name="EmailType" type="STRING">
|
||||
<value enum="0" description="NEW"/>
|
||||
<value enum="1" description="REPLY"/>
|
||||
<value enum="2" description="ADMIN_REPLY"/>
|
||||
</field>
|
||||
<field number="95" name="RawDataLength" type="INT"/>
|
||||
<field number="96" name="RawData" type="DATA"/>
|
||||
<field number="97" name="PossResend" type="STRING"/>
|
||||
<field number="98" name="EncryptMethod" type="INT">
|
||||
<value enum="0" description="NONE_OTHER"/>
|
||||
<value enum="1" description="PKCS"/>
|
||||
<value enum="2" description="DES"/>
|
||||
<value enum="3" description="PKCSDES"/>
|
||||
<value enum="4" description="PGPDES"/>
|
||||
<value enum="5" description="PGPDESMD5"/>
|
||||
<value enum="6" description="PEMDESMD5"/>
|
||||
</field>
|
||||
<field number="99" name="StopPx" type="FLOAT"/>
|
||||
<field number="100" name="ExDestination" type="STRING">
|
||||
<value enum="0" description="NONE"/>
|
||||
<value enum="4" description="POSIT"/>
|
||||
</field>
|
||||
<field number="102" name="CxlRejReason" type="INT">
|
||||
<value enum="0" description="TOO_LATE_TO_CANCEL"/>
|
||||
<value enum="1" description="UNKNOWN_ORDER"/>
|
||||
</field>
|
||||
<field number="103" name="OrdRejReason" type="INT">
|
||||
<value enum="0" description="BROKER_OPTION"/>
|
||||
<value enum="1" description="UNKNOWN_SYMBOL"/>
|
||||
<value enum="2" description="EXCHANGE_CLOSED"/>
|
||||
<value enum="3" description="ORDER_EXCEEDS_LIMIT"/>
|
||||
<value enum="4" description="TOO_LATE_TO_ENTER"/>
|
||||
</field>
|
||||
<field number="104" name="IOIQualifier" type="STRING">
|
||||
<value enum="X" description="CROSSING_OPPORTUNITY"/>
|
||||
<value enum="O" description="AT_THE_OPEN"/>
|
||||
<value enum="M" description="MORE_BEHIND"/>
|
||||
<value enum="P" description="TAKING_A_POSITION"/>
|
||||
<value enum="V" description="VERSUS"/>
|
||||
<value enum="Q" description="CURRENT_QUOTE"/>
|
||||
<value enum="C" description="AT_THE_CLOSE"/>
|
||||
<value enum="S" description="PORTFOLIO_SHOWN"/>
|
||||
<value enum="I" description="IN_TOUCH_WITH"/>
|
||||
<value enum="W" description="INDICATION_WORKING_AWAY"/>
|
||||
<value enum="A" description="ALL_OR_NONE"/>
|
||||
<value enum="L" description="LIMIT"/>
|
||||
<value enum="T" description="THROUGH_THE_DAY"/>
|
||||
</field>
|
||||
<field number="105" name="WaveNo" type="STRING"/>
|
||||
<field number="106" name="Issuer" type="STRING"/>
|
||||
<field number="107" name="SecurityDesc" type="STRING"/>
|
||||
<field number="108" name="HeartBtInt" type="INT"/>
|
||||
<field number="109" name="ClientID" type="STRING"/>
|
||||
<field number="110" name="MinQty" type="INT"/>
|
||||
<field number="111" name="MaxFloor" type="INT"/>
|
||||
<field number="112" name="TestReqID" type="STRING"/>
|
||||
<field number="113" name="ReportToExch" type="STRING">
|
||||
<value enum="Y" description="YES"/>
|
||||
<value enum="N" description="NO"/>
|
||||
</field>
|
||||
<field number="114" name="LocateReqd" type="STRING">
|
||||
<value enum="Y" description="YES"/>
|
||||
<value enum="N" description="NO"/>
|
||||
</field>
|
||||
<field number="115" name="OnBehalfOfCompID" type="STRING"/>
|
||||
<field number="116" name="OnBehalfOfSubID" type="STRING"/>
|
||||
<field number="117" name="QuoteID" type="STRING"/>
|
||||
<field number="118" name="NetMoney" type="FLOAT"/>
|
||||
<field number="119" name="SettlCurrAmt" type="FLOAT"/>
|
||||
<field number="120" name="SettlCurrency" type="STRING"/>
|
||||
<field number="121" name="ForexReq" type="STRING">
|
||||
<value enum="Y" description="YES"/>
|
||||
<value enum="N" description="NO"/>
|
||||
</field>
|
||||
<field number="122" name="OrigSendingTime" type="TIME"/>
|
||||
<field number="123" name="GapFillFlag" type="STRING">
|
||||
<value enum="Y" description="GAP_FILL_MESSAGE_MSGSEQNUM_FIELD_VALID"/>
|
||||
<value enum="N" description="SEQUENCE_RESET_IGNORE_MSGSEQNUM"/>
|
||||
</field>
|
||||
<field number="124" name="NoExecs" type="INT"/>
|
||||
<field number="125" name="CxlType" type="STRING">
|
||||
<value enum="P" description="PARTIAL_CANCEL"/>
|
||||
<value enum="F" description="FULL_REMAINING_QUANTITY"/>
|
||||
</field>
|
||||
<field number="126" name="ExpireTime" type="TIME"/>
|
||||
<field number="127" name="DKReason" type="STRING">
|
||||
<value enum="A" description="UNKNOWN_SYMBOL"/>
|
||||
<value enum="B" description="WRONG_SIDE"/>
|
||||
<value enum="C" description="QUANTITY_EXCEEDS_ORDER"/>
|
||||
<value enum="D" description="NO_MATCHING_ORDER"/>
|
||||
<value enum="E" description="PRICE_EXCEEDS_LIMIT"/>
|
||||
<value enum="Z" description="OTHER" />
|
||||
</field>
|
||||
<field number="128" name="DeliverToCompID" type="STRING"/>
|
||||
<field number="129" name="DeliverToSubID" type="STRING"/>
|
||||
<field number="130" name="IOINaturalFlag" type="STRING">
|
||||
<value enum="Y" description="NATURAL"/>
|
||||
<value enum="N" description="NOT_NATURAL"/>
|
||||
</field>
|
||||
<field number="131" name="QuoteReqID" type="STRING"/>
|
||||
<field number="132" name="BidPx" type="FLOAT"/>
|
||||
<field number="133" name="OfferPx" type="FLOAT"/>
|
||||
<field number="134" name="BidSize" type="INT"/>
|
||||
<field number="135" name="OfferSize" type="INT"/>
|
||||
<field number="136" name="NoMiscFees" type="INT"/>
|
||||
<field number="137" name="MiscFeeAmt" type="FLOAT"/>
|
||||
<field number="138" name="MiscFeeCurr" type="STRING"/>
|
||||
<field number="139" name="MiscFeeType" type="STRING">
|
||||
<value enum="1" description="REGULATORY"/>
|
||||
<value enum="2" description="TAX"/>
|
||||
<value enum="3" description="LOCAL_COMMISSION"/>
|
||||
<value enum="4" description="EXCHANGE_FEES"/>
|
||||
<value enum="5" description="STAMP"/>
|
||||
<value enum="6" description="LEVY"/>
|
||||
<value enum="7" description="OTHER"/>
|
||||
</field>
|
||||
<field number="140" name="PrevClosePx" type="FLOAT"/>
|
||||
</fields>
|
||||
</fix>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,313 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<fix type='FIXT' major='1' minor='1' servicepack='0'>
|
||||
<header>
|
||||
<field name='BeginString' required='Y'/>
|
||||
<field name='BodyLength' required='Y'/>
|
||||
<field name='MsgType' required='Y'/>
|
||||
<field name='SenderCompID' required='Y'/>
|
||||
<field name='TargetCompID' required='Y'/>
|
||||
<field name='OnBehalfOfCompID' required='N'/>
|
||||
<field name='DeliverToCompID' required='N'/>
|
||||
<field name='SecureDataLen' required='N'/>
|
||||
<field name='SecureData' required='N'/>
|
||||
<field name='MsgSeqNum' required='Y'/>
|
||||
<field name='SenderSubID' required='N'/>
|
||||
<field name='SenderLocationID' required='N'/>
|
||||
<field name='TargetSubID' required='N'/>
|
||||
<field name='TargetLocationID' required='N'/>
|
||||
<field name='OnBehalfOfSubID' required='N'/>
|
||||
<field name='OnBehalfOfLocationID' required='N'/>
|
||||
<field name='DeliverToSubID' required='N'/>
|
||||
<field name='DeliverToLocationID' required='N'/>
|
||||
<field name='PossDupFlag' required='N'/>
|
||||
<field name='PossResend' required='N'/>
|
||||
<field name='SendingTime' required='Y'/>
|
||||
<field name='OrigSendingTime' required='N'/>
|
||||
<field name='XmlDataLen' required='N'/>
|
||||
<field name='XmlData' required='N'/>
|
||||
<field name='MessageEncoding' required='N'/>
|
||||
<field name='LastMsgSeqNumProcessed' required='N'/>
|
||||
<component name='HopGrp' required='N'/>
|
||||
<field name='ApplVerID' required='N'/>
|
||||
<field name='CstmApplVerID' required='N'/>
|
||||
</header>
|
||||
<trailer>
|
||||
<field name='SignatureLength' required='N'/>
|
||||
<field name='Signature' required='N'/>
|
||||
<field name='CheckSum' required='Y'/>
|
||||
</trailer>
|
||||
<messages>
|
||||
<message msgcat='admin' msgtype='0' name='Heartbeat'>
|
||||
<field name='TestReqID' required='N'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='1' name='TestRequest'>
|
||||
<field name='TestReqID' required='Y'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='2' name='ResendRequest'>
|
||||
<field name='BeginSeqNo' required='Y'/>
|
||||
<field name='EndSeqNo' required='Y'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='3' name='Reject'>
|
||||
<field name='RefSeqNum' required='Y'/>
|
||||
<field name='RefTagID' required='N'/>
|
||||
<field name='RefMsgType' required='N'/>
|
||||
<field name='SessionRejectReason' required='N'/>
|
||||
<field name='Text' required='N'/>
|
||||
<field name='EncodedTextLen' required='N'/>
|
||||
<field name='EncodedText' required='N'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='4' name='SequenceReset'>
|
||||
<field name='GapFillFlag' required='N'/>
|
||||
<field name='NewSeqNo' required='Y'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='5' name='Logout'>
|
||||
<field name='Text' required='N'/>
|
||||
<field name='EncodedTextLen' required='N'/>
|
||||
<field name='EncodedText' required='N'/>
|
||||
</message>
|
||||
<message msgcat='admin' msgtype='A' name='Logon'>
|
||||
<field name='EncryptMethod' required='Y'/>
|
||||
<field name='HeartBtInt' required='Y'/>
|
||||
<field name='RawDataLength' required='N'/>
|
||||
<field name='RawData' required='N'/>
|
||||
<field name='ResetSeqNumFlag' required='N'/>
|
||||
<field name='NextExpectedMsgSeqNum' required='N'/>
|
||||
<field name='MaxMessageSize' required='N'/>
|
||||
<field name='TestMessageIndicator' required='N'/>
|
||||
<field name='Username' required='N'/>
|
||||
<field name='Password' required='N'/>
|
||||
<field name='DefaultApplVerID' required='Y'/>
|
||||
<component name='MsgTypeGrp' required='N'/>
|
||||
</message>
|
||||
</messages>
|
||||
<components>
|
||||
<component name='HopGrp'>
|
||||
<group name='NoHops' required='N'>
|
||||
<field name='HopCompID' required='N'/>
|
||||
<field name='HopSendingTime' required='N'/>
|
||||
<field name='HopRefID' required='N'/>
|
||||
</group>
|
||||
</component>
|
||||
<component name='MsgTypeGrp'>
|
||||
<group name='NoMsgTypes' required='N'>
|
||||
<field name='RefMsgType' required='N'/>
|
||||
<field name='MsgDirection' required='N'/>
|
||||
<field name='RefApplVerID' required='N'/>
|
||||
<field name='RefCstmApplVerID' required='N'/>
|
||||
</group>
|
||||
</component>
|
||||
</components>
|
||||
<fields>
|
||||
<field name='BeginSeqNo' number='7' type='SEQNUM'/>
|
||||
<field name='BeginString' number='8' type='STRING'/>
|
||||
<field name='BodyLength' number='9' type='LENGTH'/>
|
||||
<field name='CheckSum' number='10' type='STRING'/>
|
||||
<field name='EndSeqNo' number='16' type='SEQNUM'/>
|
||||
<field name='MsgSeqNum' number='34' type='SEQNUM'/>
|
||||
<field number='35' name='MsgType' type='STRING'>
|
||||
<value enum='0' description='HEARTBEAT'/>
|
||||
<value enum='1' description='TEST_REQUEST'/>
|
||||
<value enum='2' description='RESEND_REQUEST'/>
|
||||
<value enum='3' description='REJECT'/>
|
||||
<value enum='4' description='SEQUENCE_RESET'/>
|
||||
<value enum='5' description='LOGOUT'/>
|
||||
<value enum='6' description='INDICATION_OF_INTEREST'/>
|
||||
<value enum='7' description='ADVERTISEMENT'/>
|
||||
<value enum='8' description='EXECUTION_REPORT'/>
|
||||
<value enum='9' description='ORDER_CANCEL_REJECT'/>
|
||||
<value enum='A' description='LOGON'/>
|
||||
<value enum='B' description='NEWS'/>
|
||||
<value enum='C' description='EMAIL'/>
|
||||
<value enum='D' description='ORDER_SINGLE'/>
|
||||
<value enum='E' description='ORDER_LIST'/>
|
||||
<value enum='F' description='ORDER_CANCEL_REQUEST'/>
|
||||
<value enum='G' description='ORDER_CANCEL_REPLACE_REQUEST'/>
|
||||
<value enum='H' description='ORDER_STATUS_REQUEST'/>
|
||||
<value enum='J' description='ALLOCATION_INSTRUCTION'/>
|
||||
<value enum='K' description='LIST_CANCEL_REQUEST'/>
|
||||
<value enum='L' description='LIST_EXECUTE'/>
|
||||
<value enum='M' description='LIST_STATUS_REQUEST'/>
|
||||
<value enum='N' description='LIST_STATUS'/>
|
||||
<value enum='P' description='ALLOCATION_INSTRUCTION_ACK'/>
|
||||
<value enum='Q' description='DONT_KNOW_TRADE'/>
|
||||
<value enum='R' description='QUOTE_REQUEST'/>
|
||||
<value enum='S' description='QUOTE'/>
|
||||
<value enum='T' description='SETTLEMENT_INSTRUCTIONS'/>
|
||||
<value enum='V' description='MARKET_DATA_REQUEST'/>
|
||||
<value enum='W' description='MARKET_DATA_SNAPSHOT_FULL_REFRESH'/>
|
||||
<value enum='X' description='MARKET_DATA_INCREMENTAL_REFRESH'/>
|
||||
<value enum='Y' description='MARKET_DATA_REQUEST_REJECT'/>
|
||||
<value enum='Z' description='QUOTE_CANCEL'/>
|
||||
<value enum='a' description='QUOTE_STATUS_REQUEST'/>
|
||||
<value enum='b' description='MASS_QUOTE_ACKNOWLEDGEMENT'/>
|
||||
<value enum='c' description='SECURITY_DEFINITION_REQUEST'/>
|
||||
<value enum='d' description='SECURITY_DEFINITION'/>
|
||||
<value enum='e' description='SECURITY_STATUS_REQUEST'/>
|
||||
<value enum='f' description='SECURITY_STATUS'/>
|
||||
<value enum='g' description='TRADING_SESSION_STATUS_REQUEST'/>
|
||||
<value enum='h' description='TRADING_SESSION_STATUS'/>
|
||||
<value enum='i' description='MASS_QUOTE'/>
|
||||
<value enum='j' description='BUSINESS_MESSAGE_REJECT'/>
|
||||
<value enum='k' description='BID_REQUEST'/>
|
||||
<value enum='l' description='BID_RESPONSE'/>
|
||||
<value enum='m' description='LIST_STRIKE_PRICE'/>
|
||||
<value enum='n' description='XML_MESSAGE'/>
|
||||
<value enum='o' description='REGISTRATION_INSTRUCTIONS'/>
|
||||
<value enum='p' description='REGISTRATION_INSTRUCTIONS_RESPONSE'/>
|
||||
<value enum='q' description='ORDER_MASS_CANCEL_REQUEST'/>
|
||||
<value enum='r' description='ORDER_MASS_CANCEL_REPORT'/>
|
||||
<value enum='s' description='NEW_ORDER_CROSS'/>
|
||||
<value enum='t' description='CROSS_ORDER_CANCEL_REPLACE_REQUEST'/>
|
||||
<value enum='u' description='CROSS_ORDER_CANCEL_REQUEST'/>
|
||||
<value enum='v' description='SECURITY_TYPE_REQUEST'/>
|
||||
<value enum='w' description='SECURITY_TYPES'/>
|
||||
<value enum='x' description='SECURITY_LIST_REQUEST'/>
|
||||
<value enum='y' description='SECURITY_LIST'/>
|
||||
<value enum='z' description='DERIVATIVE_SECURITY_LIST_REQUEST'/>
|
||||
<value enum='AA' description='DERIVATIVE_SECURITY_LIST'/>
|
||||
<value enum='AB' description='NEW_ORDER_MULTILEG'/>
|
||||
<value enum='AC' description='MULTILEG_ORDER_CANCEL_REPLACE'/>
|
||||
<value enum='AD' description='TRADE_CAPTURE_REPORT_REQUEST'/>
|
||||
<value enum='AE' description='TRADE_CAPTURE_REPORT'/>
|
||||
<value enum='AF' description='ORDER_MASS_STATUS_REQUEST'/>
|
||||
<value enum='AG' description='QUOTE_REQUEST_REJECT'/>
|
||||
<value enum='AH' description='RFQ_REQUEST'/>
|
||||
<value enum='AI' description='QUOTE_STATUS_REPORT'/>
|
||||
<value enum='AJ' description='QUOTE_RESPONSE'/>
|
||||
<value enum='AK' description='CONFIRMATION'/>
|
||||
<value enum='AL' description='POSITION_MAINTENANCE_REQUEST'/>
|
||||
<value enum='AM' description='POSITION_MAINTENANCE_REPORT'/>
|
||||
<value enum='AN' description='REQUEST_FOR_POSITIONS'/>
|
||||
<value enum='AO' description='REQUEST_FOR_POSITIONS_ACK'/>
|
||||
<value enum='AP' description='POSITION_REPORT'/>
|
||||
<value enum='AQ' description='TRADE_CAPTURE_REPORT_REQUEST_ACK'/>
|
||||
<value enum='AR' description='TRADE_CAPTURE_REPORT_ACK'/>
|
||||
<value enum='AS' description='ALLOCATION_REPORT'/>
|
||||
<value enum='AT' description='ALLOCATION_REPORT_ACK'/>
|
||||
<value enum='AU' description='CONFIRMATION_ACK'/>
|
||||
<value enum='AV' description='SETTLEMENT_INSTRUCTION_REQUEST'/>
|
||||
<value enum='AW' description='ASSIGNMENT_REPORT'/>
|
||||
<value enum='AX' description='COLLATERAL_REQUEST'/>
|
||||
<value enum='AY' description='COLLATERAL_ASSIGNMENT'/>
|
||||
<value enum='AZ' description='COLLATERAL_RESPONSE'/>
|
||||
<value enum='BA' description='COLLATERAL_REPORT'/>
|
||||
<value enum='BB' description='COLLATERAL_INQUIRY'/>
|
||||
<value enum='BC' description='NETWORK_STATUS_REQUEST'/>
|
||||
<value enum='BD' description='NETWORK_STATUS_RESPONSE'/>
|
||||
<value enum='BE' description='USER_REQUEST'/>
|
||||
<value enum='BF' description='USER_RESPONSE'/>
|
||||
<value enum='BG' description='COLLATERAL_INQUIRY_ACK'/>
|
||||
<value enum='BH' description='CONFIRMATION_REQUEST'/>
|
||||
<value enum='BI' description='TRADING_SESSION_LIST_REQUEST'/>
|
||||
<value enum='BJ' description='TRADING_SESSION_LIST'/>
|
||||
<value enum='BK' description='SECURITY_LIST_UPDATE_REPORT'/>
|
||||
<value enum='BL' description='ADJUSTED_POSITION_REPORT'/>
|
||||
<value enum='BM' description='ALLOCATION_INSTRUCTION_ALERT'/>
|
||||
<value enum='BN' description='EXECUTION_ACKNOWLEDGEMENT'/>
|
||||
<value enum='BO' description='CONTRARY_INTENTION_REPORT'/>
|
||||
<value enum='BP' description='SECURITY_DEFINITION_UPDATE_REPORT'/>
|
||||
</field>
|
||||
<field name='NewSeqNo' number='36' type='SEQNUM'/>
|
||||
<field name='PossDupFlag' number='43' type='BOOLEAN'/>
|
||||
<field name='RefSeqNum' number='45' type='SEQNUM'/>
|
||||
<field name='SenderCompID' number='49' type='STRING'/>
|
||||
<field name='SenderSubID' number='50' type='STRING'/>
|
||||
<field name='SendingTime' number='52' type='UTCTIMESTAMP'/>
|
||||
<field name='TargetCompID' number='56' type='STRING'/>
|
||||
<field name='TargetSubID' number='57' type='STRING'/>
|
||||
<field name='Text' number='58' type='STRING'/>
|
||||
<field name='Signature' number='89' type='DATA'/>
|
||||
<field name='SecureDataLen' number='90' type='LENGTH'/>
|
||||
<field name='SecureData' number='91' type='DATA'/>
|
||||
<field name='SignatureLength' number='93' type='LENGTH'/>
|
||||
<field name='RawDataLength' number='95' type='LENGTH'/>
|
||||
<field name='RawData' number='96' type='DATA'/>
|
||||
<field name='PossResend' number='97' type='BOOLEAN'/>
|
||||
<field name='EncryptMethod' number='98' type='INT'>
|
||||
<value description='NONE_OTHER' enum='0'/>
|
||||
<value description='PKCS' enum='1'/>
|
||||
<value description='DES' enum='2'/>
|
||||
<value description='PKCS_DES' enum='3'/>
|
||||
<value description='PGP_DES' enum='4'/>
|
||||
<value description='PGP_DES_MD5' enum='5'/>
|
||||
<value description='PEM_DES_MD5' enum='6'/>
|
||||
</field>
|
||||
<field name='HeartBtInt' number='108' type='INT'/>
|
||||
<field name='TestReqID' number='112' type='STRING'/>
|
||||
<field name='OnBehalfOfCompID' number='115' type='STRING'/>
|
||||
<field name='OnBehalfOfSubID' number='116' type='STRING'/>
|
||||
<field name='OrigSendingTime' number='122' type='UTCTIMESTAMP'/>
|
||||
<field name='GapFillFlag' number='123' type='BOOLEAN'/>
|
||||
<field name='DeliverToCompID' number='128' type='STRING'/>
|
||||
<field name='DeliverToSubID' number='129' type='STRING'/>
|
||||
<field name='ResetSeqNumFlag' number='141' type='BOOLEAN'/>
|
||||
<field name='SenderLocationID' number='142' type='STRING'/>
|
||||
<field name='TargetLocationID' number='143' type='STRING'/>
|
||||
<field name='OnBehalfOfLocationID' number='144' type='STRING'/>
|
||||
<field name='DeliverToLocationID' number='145' type='STRING'/>
|
||||
<field name='XmlDataLen' number='212' type='LENGTH'/>
|
||||
<field name='XmlData' number='213' type='DATA'/>
|
||||
<field number='347' name='MessageEncoding' type='STRING'>
|
||||
<value enum='ISO-2022-JP' description='ISO_2022_JP'/>
|
||||
<value enum='EUC-JP' description='EUC_JP'/>
|
||||
<value enum='SHIFT_JIS' description='SHIFT_JIS'/>
|
||||
<value enum='UTF-8' description='UTF_8'/>
|
||||
</field>
|
||||
<field name='EncodedTextLen' number='354' type='LENGTH'/>
|
||||
<field name='EncodedText' number='355' type='DATA'/>
|
||||
<field name='LastMsgSeqNumProcessed' number='369' type='SEQNUM'/>
|
||||
<field name='RefTagID' number='371' type='INT'/>
|
||||
<field name='RefMsgType' number='372' type='STRING'/>
|
||||
<field name='SessionRejectReason' number='373' type='INT'>
|
||||
<value description='INVALID_TAG_NUMBER' enum='0'/>
|
||||
<value description='REQUIRED_TAG_MISSING' enum='1'/>
|
||||
<value description='SENDINGTIME_ACCURACY_PROBLEM' enum='10'/>
|
||||
<value description='INVALID_MSGTYPE' enum='11'/>
|
||||
<value description='XML_VALIDATION_ERROR' enum='12'/>
|
||||
<value description='TAG_APPEARS_MORE_THAN_ONCE' enum='13'/>
|
||||
<value description='TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER' enum='14'/>
|
||||
<value description='REPEATING_GROUP_FIELDS_OUT_OF_ORDER' enum='15'/>
|
||||
<value description='INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP' enum='16'/>
|
||||
<value description='NON_DATA_VALUE_INCLUDES_FIELD_DELIMITER' enum='17'/>
|
||||
<value description='TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE' enum='2'/>
|
||||
<value description='UNDEFINED_TAG' enum='3'/>
|
||||
<value description='TAG_SPECIFIED_WITHOUT_A_VALUE' enum='4'/>
|
||||
<value description='VALUE_IS_INCORRECT' enum='5'/>
|
||||
<value description='INCORRECT_DATA_FORMAT_FOR_VALUE' enum='6'/>
|
||||
<value description='DECRYPTION_PROBLEM' enum='7'/>
|
||||
<value description='SIGNATURE_PROBLEM' enum='8'/>
|
||||
<value description='COMPID_PROBLEM' enum='9'/>
|
||||
<value description='OTHER' enum='99'/>
|
||||
</field>
|
||||
<field name='MaxMessageSize' number='383' type='LENGTH'/>
|
||||
<field name='NoMsgTypes' number='384' type='NUMINGROUP'/>
|
||||
<field name='MsgDirection' number='385' type='CHAR'>
|
||||
<value description='RECEIVE' enum='R'/>
|
||||
<value description='SEND' enum='S'/>
|
||||
</field>
|
||||
<field name='TestMessageIndicator' number='464' type='BOOLEAN'/>
|
||||
<field name='Username' number='553' type='STRING'/>
|
||||
<field name='Password' number='554' type='STRING'/>
|
||||
<field name='NoHops' number='627' type='NUMINGROUP'/>
|
||||
<field name='HopCompID' number='628' type='STRING'/>
|
||||
<field name='HopSendingTime' number='629' type='UTCTIMESTAMP'/>
|
||||
<field name='HopRefID' number='630' type='SEQNUM'/>
|
||||
<field name='NextExpectedMsgSeqNum' number='789' type='SEQNUM'/>
|
||||
<field name='ApplVerID' number='1128' type='STRING'>
|
||||
<value description='FIX27' enum='0'/>
|
||||
<value description='FIX30' enum='1'/>
|
||||
<value description='FIX40' enum='2'/>
|
||||
<value description='FIX41' enum='3'/>
|
||||
<value description='FIX42' enum='4'/>
|
||||
<value description='FIX43' enum='5'/>
|
||||
<value description='FIX44' enum='6'/>
|
||||
<value description='FIX50' enum='7'/>
|
||||
<value description='FIX50SP1' enum='8'/>
|
||||
<value description='FIX50SP2' enum='9'/>
|
||||
</field>
|
||||
<field name='CstmApplVerID' number='1129' type='STRING'/>
|
||||
<field name='RefApplVerID' number='1130' type='STRING'/>
|
||||
<field name='RefCstmApplVerID' number='1131' type='STRING'/>
|
||||
<field name='DefaultApplVerID' number='1137' type='STRING'/>
|
||||
</fields>
|
||||
</fix>
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net471</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
|
||||
<Platform>x64</Platform>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System.Linq;
|
||||
|
||||
namespace bts {
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ManyConsole {
|
||||
namespace ManyConsole.CommandLineUtils {
|
||||
public static class ConsoleCommandEx {
|
||||
public static string get_argument(this ConsoleCommand _, string arg_name) {
|
||||
var arg = Environment.GetCommandLineArgs().FirstOrDefault(str => str.StartsWith("--"+arg_name));
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
|
||||
using bts.fix;
|
||||
|
||||
namespace bts
|
||||
{
|
||||
public class FIXCommand : ConsoleCommand
|
||||
{
|
||||
bool _initiator, _orders, _dropcopy;
|
||||
string _config, _http;
|
||||
public FIXCommand()
|
||||
{
|
||||
IsCommand("fix", "start a fix acceptor or initiator session");
|
||||
HasRequiredOption<string>("f|configfile=", "Set the config file", h => _config = h);
|
||||
HasOption<string>("i|initiator", "Start a FIX Initiator", h => _initiator = true);
|
||||
HasOption<string>("w|http=", "Start http server {address}", h => _http = h);
|
||||
|
||||
HasOption<string>("o|order_session", "Start a FIX Acceptor session for orders", h => _orders = true);
|
||||
HasOption<string>("d|dropcopy_only", "Start a FIX Acceptor session for dropcopy", h => _dropcopy = true);
|
||||
|
||||
//HasAdditionalArguments(null, " [other params]");
|
||||
}
|
||||
public override int Run(string[] remaining_args)
|
||||
{
|
||||
if (_orders)
|
||||
{
|
||||
Console.WriteLine("Starting FIX ORDERS Acceptor using " + _config);
|
||||
if(!string.IsNullOrEmpty(_http))
|
||||
Console.WriteLine(" Http server " + _http);
|
||||
return FixInit.start_acceptor(_config, true, (string.IsNullOrEmpty(_http) ? null : _http));
|
||||
}
|
||||
else if (_dropcopy)
|
||||
{
|
||||
Console.WriteLine("Starting FIX DROP Acceptor using " + _config);
|
||||
if (!string.IsNullOrEmpty(_http))
|
||||
Console.WriteLine(" Http server " + _http);
|
||||
return FixInit.start_acceptor(_config, false, (string.IsNullOrEmpty(_http) ? null : _http));
|
||||
}
|
||||
else if (_initiator)
|
||||
{
|
||||
Console.WriteLine("Initiator not supported yet");
|
||||
}
|
||||
Console.WriteLine("Must select either orders or dropcopy session");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive;
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System.Linq;
|
||||
|
||||
namespace sparkcmd {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using bts.api.core;
|
||||
using bts.test;
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -2,7 +2,7 @@ using bts.api;
|
||||
using bts.api.core;
|
||||
using bts.api.synthetic;
|
||||
using bts.test;
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace bts {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
using bts.test;
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System;
|
||||
using mbts;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using bts.api.core;
|
||||
using bts.api.synthetic;
|
||||
using bts.api.test;
|
||||
using ManyConsole;
|
||||
using ManyConsole.CommandLineUtils;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net471</TargetFramework>
|
||||
<!--<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>-->
|
||||
<RuntimeIdentifiers>win7-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
|
||||
<!-- <TargetFramework>net471</TargetFramework> -->
|
||||
<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win10-x64;ubuntu.18.04-x64</RuntimeIdentifiers>
|
||||
<Authors>Blue Trading Systems</Authors>
|
||||
<Company>Blue Trading Systems</Company>
|
||||
<Product>Spark</Product>
|
||||
@@ -18,11 +18,13 @@
|
||||
<ProjectReference Include="../spark_api/spark_api.csproj" />
|
||||
<!--<ProjectReference Include="..\spark\Spark.csproj" />-->
|
||||
<ProjectReference Include="..\spark_core\spark_core.csproj" />
|
||||
<ProjectReference Include="..\spark_test\spark_test.csproj" Condition="'$(Configuration)'=='Debug'" />
|
||||
<ProjectReference Include="..\spark_test\spark_test.csproj" Condition="'$(Configuration)'=='Debug' " />
|
||||
<ProjectReference Include="../spark_fix/spark_fix.csproj" />
|
||||
<!--<Proto3 Include="**/*.proto" />-->
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ManyConsole" Version="1.0.0.4" />
|
||||
<!-- <PackageReference Include="ManyConsole" Version="1.0.0.4" /> -->
|
||||
<PackageReference Include="ManyConsole.CommandLineUtils" Version="1.0.3-alpha" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1 +1 @@
|
||||
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/services/UserService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/Executor.conf;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;jetfix/codec/FIXArray.cpp;jetfix/common/OutFIX.cpp;jetfix/connection/AsyncReader.cpp;jetfix/connection/IConnection.cpp;jetfix/connection/SocketConnection.cpp;jetfix/gateway/CoreGateway.cpp;jetfix/gateway/JetFIXGateway.cpp;jetfix/gateway/Session.cpp;jetfix/store/FIXFileStore.cpp;jetfix/store/session_name.cpp;jetfix/tests/async_reader_tests.cpp;jetfix/tests/decoding_tests.cpp;jetfix/tests/fix_encoding_stream_tests.cpp;jetfix/tests/fix_fragment_tests.cpp;jetfix/tests/jetfix_performance_tests.cpp;jetfix/tests/sample_fix.cpp;jetfix/tests/store_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MDRecoverableConsumer.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;mercury/actors/IPollableActor.cpp;mercury/broker/Broker.cpp;mercury/broker/BrokerProxy.cpp;mercury/broker/ILocalBroker.cpp;mercury/broker/IRemoteBroker.cpp;mercury/common/mercury_common.cpp;mercury/events/TimerEvent.cpp;mercury/executor/Executor.cpp;mercury/topics/Topic.cpp;metrics/metrics.cpp;metrics/system_metrics.cpp;orderman/actors/AsyncFactory.cpp;orderman/actors/ExecutionGateway.cpp;orderman/actors/FillStore.cpp;orderman/actors/MDSupplementarySource.cpp;orderman/actors/OrderStore.cpp;orderman/actors/SODPosition.cpp;orderman/actors/SecuritySrc.cpp;orderman/actors/ServiceBridge.cpp;orderman/actors/order_manager/OrderBuilder.cpp;orderman/actors/order_manager/OrderManager.cpp;orderman/actors/order_manager/OrderServicesData.cpp;orderman/events/CancelRejectEvent.cpp;orderman/events/NewExecutionReportEvent.cpp;orderman/limiter/LimitStore.cpp;orderman/limiter/Limiter.cpp;orderman/limiter/ProductLimitNode.cpp;orderman/limiter/ProductLimitTree.cpp;orderman/limiter/SecurityLimitNode.cpp;orderman/limiter/SecurityLimitTree.cpp;orderman/limiter/tests/limit_tests.cpp;orderman/order_factory/DynamiLine truncated
|
||||
set(sources api/apicore.proto;api/apigateway.proto;api/apioptions.proto;api/core/ApiClientInterop.cpp;api/core/ApiServerInterop.cpp;api/public/ApiServer.cpp;api/public/ClientChannel.cpp;api/public/QuickbusClientChannel.cpp;api/public/ServerChannel.cpp;api/public/ServiceContext.cpp;api/service_helpers/AdminServiceUtils.cpp;api/services/AdminService.proto;api/services/ApiUnitTestService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/OrderService.proto;api/services/OutOfProcessURLListener.proto;api/services/PersistenceService.proto;api/services/PositionService.proto;api/services/ShellDiagnosticService.proto;api/services/ShellLatencyService.proto;api/services/SyntheticSecurityService.proto;api/services/UserService.proto;api/test/ApiTests.cpp;api/test/HelloServiceServer.cpp;config/ConfigCheck.cpp;config/ConfigDownloader.cpp;config/ConfigErrorCollector.cpp;config/ConfigLog.cpp;config/ConfigPropertyEvaluator.cpp;config/ConfigValueQueue.cpp;config/ConfigurationException.cpp;config/ConfigurationState.cpp;config/PreprocessInputStream.cpp;config/config.cpp;config/defaults/MarketData.conf;config/defaults/Ports.conf;config/defaults/Symbols.conf;config/defaults/cme_reference_data.conf;config/defaults/edge.conf;config/defaults/jetfix.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/spreader.conf;config/defaults/testkeys.conf;config/defaults/threads.conf;config/defaults/toggles.conf;config/extensions/extensions.proto;config/invalid/invalid.proto;config/protos/ExchangeSimCfg.proto;config/protos/MarketData.proto;config/protos/Ports.proto;config/protos/Symbols.proto;config/protos/UI.proto;config/protos/cme_reference_data.proto;config/protos/jetfix.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/quickbus_cfg.proto;config/protos/spreader.proto;config/protos/system.proto;config/protos/testkeys.proto;config/protos/threads.proto;config/protos/toggles.proto;config/tests/HTTPServer.cpp;config/tests/config_ref_tests.cpp;config/tests/config_tests.cpp;config/text_format/text_format.cpp;domain_model/Security.cpp;domain_model/Security.proto;domain_model/SecurityTests.cpp;domain_model/tests/domain_tests.cpp;expression/BooleanGrammar.cpp;expression/ExpressionEvaluator.cpp;expression/ParserExceptions.cpp;expression/Value.cpp;expression/tests/expression_parser_tests.cpp;logging/LoggerHub.cpp;logging/Sink.cpp;logging/logging.cpp;logging/tests/logging_tests.cpp;md/Diag/MDPeriodicDumper.cpp;md/Diag/ShmDumper.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MDRecoverableConsumer.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/protos/co2.proto;md/relay/QueryServer.cpp;md/relay/RelayClient.cpp;md/relay/RelayRecorder.cpp;md/test/Co2ManagedTestHelper.cpp;md/test/Co2TestInstrument.cpp;md/test/md2_tests.cpp;md/test/synthetic_book_merge_tests.cpp;os/os.cpp;os/tests/os_tests.cpp;quickbus/core/LocalNode.cpp;quickbus/core/Quickbus.cpp;quickbus/core/SubscriptionID.cpp;quickbus/core/TableID.cpp;quickbus/message_model/Update.cpp;quickbus/message_model/merge_updates.cpp;quickbus/network/QBConnection.cpp;quickbus/network/QBConnectionManager.cpp;quickbus/network/endpoint_description.cpp;quickbus/network/quickbus_msgs.proto;quickbus/pubsub/TablePublisher.cpp;quickbus/pubsub/TableSubscriber.cpp;quickbus/pubsub/tests/qb_pubsub_tests.cpp;quickbus/routing/INode.cpp;quickbus/routing/NodeID.cpp;quickbus/routing/Router.cpp;quickbus/rpc/RPCClient.cpp;quickbus/rpc/RPCServer.cpp;quickbus/rpc/RPCSessionID.cpp;quickbus/rpc/rpc_utils.cpp;quickbus/rpc/tests/qb_rpc_tests.cpp;quickbus/tests/quickbus_tests.cpp;sparkproto/SparkProtos.proto;testing/catch_test_runner.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogon.cpp;utils/SharedMemory.cpp;utils/Sqlite_utils.cpp;utils/Uuid.cpp;utils/datetime.cpp;utils/download.cpp;utils/file_utils.cpp;utils/init_spark_lib.cpp;utils/is_unittest_environment.cpp;utils/stats.cpp;utils/thread_manager.cpp)
|
||||
@@ -44,6 +44,7 @@ constexpr log::Subsystem Latency {Testing.ordinal+1 };
|
||||
constexpr log::Subsystem DataFlow {Latency.ordinal+1 };
|
||||
constexpr log::Subsystem Plugin {DataFlow.ordinal+1 };
|
||||
constexpr log::Subsystem ClientSdk {Plugin.ordinal+1 };
|
||||
constexpr log::Subsystem FIX {ClientSdk.ordinal+1 };
|
||||
|
||||
struct LoggerHandle {
|
||||
LoggerHandle(LoggerHandle const&) = delete;
|
||||
|
||||
Reference in new issue
Block a user