Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d7290db63 | ||
|
|
0d0cf11157 | ||
|
|
7b833087e5 | ||
|
|
12f1e026d0 | ||
|
|
762ce06f7c | ||
|
|
9052051872 | ||
|
|
ab5b4e17ad | ||
|
|
4295165427 | ||
|
|
9a1199a058 | ||
|
|
62f1911f35 | ||
|
|
d75c8af729 | ||
|
|
da95ece9fc | ||
|
|
deca2bedb5 | ||
|
|
de64bd843c | ||
|
|
79a8a29bac | ||
|
|
6aaed0e76e | ||
|
|
8072eece66 | ||
|
|
043d826442 | ||
|
|
3bf9fa08e5 | ||
|
|
79a7b8504e | ||
|
|
ffd2dd22c2 | ||
|
|
469e4636e3 |
No files matched your search
@@ -4,6 +4,20 @@ weight = 3
|
||||
sort_by = "weight"
|
||||
insert_anchor_links = "right"
|
||||
+++
|
||||
## 2.9.2
|
||||
### Bug Fixes
|
||||
- Fixed an issue with the exchange simulator that could lead to crossed markets
|
||||
|
||||
## 2.9.1
|
||||
### Bug Fixes
|
||||
- Fixed an issue with trade sound alerts, where in some cases the use of a "In Between" condition could lead to a UI failure.
|
||||
- Fixed an issue with the display of the new raw position column in the market view window.
|
||||
- Fixed the popup label that describes the raw position information in the ladder
|
||||
### Internal Changes
|
||||
- Avoided shipping production configuration defaults that lead to trying to download a position file for the development sftp server.
|
||||
### Api
|
||||
- C# API sample now uses synchronous calls.
|
||||
|
||||
## 2.9.0
|
||||
### User Visible Changes
|
||||
- Improved Workspace management User Interface
|
||||
|
||||
@@ -90,7 +90,10 @@ namespace mbts.spark {
|
||||
_dispose = Disposable.Create(
|
||||
_orders_model.on_security_root_orders(security.Id).OnDispatcher().Subscribe(_on_orders),
|
||||
_position.OnDispatcher().Subscribe(v => _animation.animate_position(v.newval > v.oldval)),
|
||||
_orders_model.on_security_positions(security.Id).OnDispatcher().Subscribe(t => Set(ref _raw_day_position, t.state.Values.Sum(p => p.Item2.raw_day_pos()), nameof(raw_day_position))),
|
||||
_orders_model.on_security_positions(security.Id).OnDispatcher().Subscribe(t => {
|
||||
if (Set(ref _raw_day_position, t.state.Values.Sum(p => p.Item2.raw_day_pos()), nameof(raw_day_position)))
|
||||
raise_invalidated();
|
||||
}),
|
||||
_inside_bids.OnDispatcher().Subscribe(v => _animation.animate_working_bids_inside(v.newval)),
|
||||
_inside_asks.OnDispatcher().Subscribe(v => _animation.animate_working_asks_inside(v.newval)),
|
||||
_day_change.OnDispatcher().Subscribe(v => _animation.animate_day_change(v.newval > v.oldval)),
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace mbts.spark {
|
||||
//
|
||||
//_window_height = backing(nameof(window_height), settings_manager.subscribe_current().OnDispatcher().Select(s => s.zoom_factor), (scale) => scale * 600);
|
||||
//_window_width = backing(nameof(window_width), settings_manager.subscribe_current().OnDispatcher().Select(s => s.zoom_factor), (scale) => scale * 420);
|
||||
position_click_command = new DelegateCommand(() => size_calculator.value = DoubleHelper.safe_convert_to_uint(Math.Abs(_show_day_position ? day_position : position)));
|
||||
position_click_command = new DelegateCommand(() => size_calculator.value = DoubleHelper.safe_convert_to_uint(Math.Abs(_show_day_position ? day_position : (_show_raw_day_position ? _raw_day_position : position))));
|
||||
send_order_command = new AsyncCommand<(double price, Side? side, MouseButton button)>(send_order_async);
|
||||
cancel_command = new AsyncCommand<LadderModel.CancelType>(_model.cancel_orders, true);
|
||||
show_book_command = new DelegateCommand(_show_book);
|
||||
|
||||
@@ -487,6 +487,7 @@
|
||||
<MultiBinding Converter="{x:Static spark:LadderView.PositionToolTipConverter}">
|
||||
<Binding Path="order_properties_vm.selected_account"/>
|
||||
<Binding Path="show_day_position"/>
|
||||
<Binding Path="show_raw_day_position"/>
|
||||
<Binding Path="show_account_position"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
|
||||
@@ -18,32 +18,60 @@ namespace mbts.spark {
|
||||
MaxZoomFactor = 1.5;
|
||||
|
||||
public static IMultiValueConverter PositionToolTipConverter =
|
||||
ValueConverter.create<AccountTuple?, bool, bool, string>((account, show_day_pos, show_total_pos) => {
|
||||
const string day_pos_text = "day", total_pos_text = "total";
|
||||
ValueConverter.create<AccountTuple?, bool, bool, bool, string>((account, show_day_pos, show_raw_day_pos, show_total_pos) => {
|
||||
const string day_pos_text = "day", raw_day_pos_text = "raw day", total_pos_text = "total";
|
||||
if (!account.HasValue)
|
||||
return string.Empty;
|
||||
var sb = new StringBuilderEx(account.Value.name);
|
||||
string primary_pos;
|
||||
if (show_day_pos) {
|
||||
primary_pos = day_pos_text;
|
||||
if (show_total_pos) {
|
||||
sb.Add(" '", primary_pos, " ");
|
||||
sb.Add("(", total_pos_text, ")' ");
|
||||
} else {
|
||||
sb.Add(" ", primary_pos, " ");
|
||||
}
|
||||
} else if (show_total_pos) {
|
||||
primary_pos = total_pos_text;
|
||||
sb.Add(" ", primary_pos, " ");
|
||||
/// Note: 'day,' and 'raw day,' are interchangeable wrt the string format, 'total' however is treated differently.
|
||||
/// Different Formats:
|
||||
// No parts are visible:
|
||||
// null
|
||||
//
|
||||
// 1 part 'foo' is visible:
|
||||
// "<account> foo position
|
||||
// click to copy to size"
|
||||
//
|
||||
// 2 parts 'day' and 'raw day' are visible:
|
||||
// "<account> 'day / raw day' position
|
||||
// click to copy day to size"
|
||||
//
|
||||
// 2 parts 'day' and 'total' are visible:
|
||||
// "<account> 'day (total)' position
|
||||
// click to copy day to size"
|
||||
//
|
||||
|
||||
string primary_pos = null;
|
||||
// part count is incremented in the 'add_part' method
|
||||
int part_count = 0;
|
||||
var sb = new StringBuilderEx();
|
||||
|
||||
if (show_day_pos) add_part(day_pos_text, " / ");
|
||||
if (show_raw_day_pos) add_part(raw_day_pos_text, " / ");
|
||||
if (show_total_pos) add_part(total_pos_text, " (", ")");
|
||||
//
|
||||
if (part_count > 1) {
|
||||
// This is a complex expression (showing more than 1 value) - wrap it in single quotes.
|
||||
// Explicitly state which value will be copied to the size input.
|
||||
sb.Insert(0, "'");
|
||||
sb.Add("'");
|
||||
sb.Add(" position\n(click to copy ", primary_pos, " to size)");
|
||||
} else {
|
||||
// unexpected code path (the button for which this tooltip is destined should be invisible in this case), but no need to throw an exception.
|
||||
return string.Empty;
|
||||
// Only showing 1 value, no need for single quotes,
|
||||
// nor an explicit statement that indicates which value will be copied to the size input.
|
||||
sb.Add(" position\n(click to copy to size)");
|
||||
}
|
||||
sb.Add("position\n(click to copy ");
|
||||
if (show_day_pos && show_total_pos)
|
||||
sb.Add(primary_pos, " position ");
|
||||
sb.Add("to size)");
|
||||
return sb.ToString();
|
||||
|
||||
void add_part(string part_name, string separator = null, string separator_suffix = null) {
|
||||
if (part_count++ > 0) {
|
||||
sb.Add(separator);
|
||||
sb.Add(part_name);
|
||||
sb.Add(separator_suffix);
|
||||
} else {
|
||||
primary_pos = part_name;
|
||||
sb.Add($"{account.Value.name} {part_name}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
internal LadderView(LadderVM vm) {
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace mbts {
|
||||
_second.Equals(other._second);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj is OrTrigger<T>);
|
||||
Equals(obj as OrTrigger<T>);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.aggregate_hash(
|
||||
@@ -256,7 +256,7 @@ namespace mbts {
|
||||
$"OrTrigger ({_first}, {_second})";
|
||||
}
|
||||
|
||||
class GreaterThanTrigger<T> : IPredicate<T> {
|
||||
class GreaterThanTrigger<T> : IPredicate<T>, IEquatable<GreaterThanTrigger<T>> {
|
||||
readonly T _value;
|
||||
readonly IComparer<T> _comparer;
|
||||
|
||||
@@ -268,6 +268,17 @@ namespace mbts {
|
||||
public bool trigger(T value) =>
|
||||
_comparer.Compare(value, _value) > 0;
|
||||
|
||||
public bool Equals(GreaterThanTrigger<T> other) =>
|
||||
other != null &&
|
||||
_comparer.Equals(other._comparer) &&
|
||||
_comparer.Compare(_value, other._value) == 0;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj as GreaterThanTrigger<T>);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
_value.GetHashCode();
|
||||
|
||||
public override string ToString() =>
|
||||
$"GreaterThanTrigger ({_value})";
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@ namespace mbts.ui.converters {
|
||||
|
||||
public static IMultiValueConverter create<TIn1, TIn2, TIn3, TOut>(Func<TIn1, TIn2, TIn3, TOut> convert) =>
|
||||
new AnonymousMultiValueConverter<TIn1, TIn2, TIn3, TOut>(convert);
|
||||
|
||||
public static IMultiValueConverter create<TIn1, TIn2, TIn3, TIn4, TOut>(Func<TIn1, TIn2, TIn3, TIn4, TOut> convert) =>
|
||||
new AnonymousMultiValueConverter<TIn1, TIn2, TIn3, TIn4, TOut>(convert);
|
||||
}
|
||||
|
||||
static class ValueConverters {
|
||||
@@ -92,4 +95,17 @@ namespace mbts.ui.converters {
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
class AnonymousMultiValueConverter<TIn1, TIn2, TIn3, TIn4, TOut> : IMultiValueConverter {
|
||||
readonly Func<TIn1, TIn2, TIn3, TIn4, TOut> _convert;
|
||||
|
||||
public AnonymousMultiValueConverter(Func<TIn1, TIn2, TIn3, TIn4, TOut> convert) => _convert = convert;
|
||||
|
||||
public TOut ErrorValue { get; set; }
|
||||
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) =>
|
||||
ConvertUtils.try_convert_args(values, out TIn1 a, out TIn2 b, out TIn3 c, out TIn4 d) ? _convert(a, b, c, d) : ErrorValue;
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -213,10 +213,18 @@ namespace bts.md
|
||||
return _data.Values.Where(filt);
|
||||
}
|
||||
|
||||
public SecurityImmutable? find_security(Func<SecurityImmutable, bool> filter)
|
||||
public SecurityImmutable? find_security(Func<SecurityImmutable, bool> filter, TimeSpan? timeout = null)
|
||||
{
|
||||
var fnd = find(filter).TryFirst();
|
||||
return fnd?.security;
|
||||
var deadline = DateTime.UtcNow;
|
||||
if (timeout.HasValue) deadline += timeout.Value;
|
||||
do {
|
||||
var fnd = find(filter).TryFirst();
|
||||
if (fnd.HasValue) {
|
||||
return fnd?.security;
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
} while (DateTime.UtcNow < deadline);
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<SecurityImmutable?> find_security_async(Func<SecurityImmutable, bool> filter, TimeSpan? timeout = null)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace bts.sdk
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
public async Task<Result<Response>> send_order(string user, string account ,
|
||||
public Response send_order(string user, string account ,
|
||||
string exch, string sectype, string symbol, string security_desc, string qty, string price = null)
|
||||
{
|
||||
Venue ven = MarketDataSample.parse_venue(exch);
|
||||
@@ -49,7 +49,7 @@ namespace bts.sdk
|
||||
int quan = int.Parse(qty);
|
||||
|
||||
Create cr = new Create();
|
||||
await order_setup(cr, user, account);
|
||||
order_setup(cr, user, account);
|
||||
cr.Price = px;
|
||||
cr.Quantity = Convert.ToUInt32(Math.Abs(quan));
|
||||
cr.NewOrder.Side = quan < 0 ? Side.Sell : Side.Buy;
|
||||
@@ -57,12 +57,15 @@ namespace bts.sdk
|
||||
cr.NewOrder.CustomDef = new CustomOrderDefinition() { Limit = new LimitOrderDefinition() };
|
||||
else
|
||||
cr.NewOrder.CustomDef = new CustomOrderDefinition() { Market = new MarketOrderDefinition() };
|
||||
var sec = await _md.find_security_async(x => x.Glbx.SecurityDesc == security_desc.ToUpper());
|
||||
Console.WriteLine("Fetching security details...");
|
||||
var sec = _md.find_security(x => x.Glbx.SecurityDesc == security_desc.ToUpper(), TimeSpan.FromSeconds(30));
|
||||
if (!sec.HasValue) {
|
||||
Console.WriteLine($"Failed to find security {security_desc}.");
|
||||
return null;
|
||||
}
|
||||
cr.NewOrder.SecurityKey = sec.Value.Id;
|
||||
Result<Response> resp = await _orders.Value.create_order_async(cr);
|
||||
Response resp = _orders.Value.create_order(cr);
|
||||
print_update(resp);
|
||||
if(resp.value != null)
|
||||
print_update(resp.value);
|
||||
//subscribei_ subscribes to a stream of Immutable (in this case FillImmutable) which is nice if you know you don't want to change the fills, which you dont'
|
||||
_disps.Add(_orders.Value.subscribei_fills().Subscribe(x =>
|
||||
{
|
||||
@@ -80,7 +83,7 @@ namespace bts.sdk
|
||||
return resp;
|
||||
}
|
||||
|
||||
static async Task order_setup(Create cr, string username, string accountname)
|
||||
static void order_setup(Create cr, string username, string accountname)
|
||||
{
|
||||
cr.NewOrder = new OrderDefinition();
|
||||
cr.NewOrder.ManualOrderIndicator = ManualOrderIndicator.Yes;
|
||||
@@ -88,12 +91,8 @@ namespace bts.sdk
|
||||
cr.NewOrder.CustomerOrFirm = CustomerOrFirm.Firm;
|
||||
cr.NewOrder.SubType = OrderSubType.None;
|
||||
cr.NewOrder.TimeInForce = TimeInForce.Day;
|
||||
var admin = await _admin.Value.get_admin_data_async(new VoidMessage());
|
||||
if (!admin.success) {
|
||||
Console.Error.WriteLine(admin.error_message);
|
||||
return;
|
||||
}
|
||||
BTSUser user = admin.value.Users.FirstOrDefault( x=> username != null ? x.Name.ToLowerInvariant() == username.ToLowerInvariant() : true );
|
||||
var admin = _admin.Value.get_admin_data(new VoidMessage());
|
||||
BTSUser user = admin.Users.FirstOrDefault( x=> username != null ? x.Name.ToLowerInvariant() == username.ToLowerInvariant() : true );
|
||||
if (user != null)
|
||||
{
|
||||
cr.NewOrder.UserId = (uint)user.Id;
|
||||
@@ -102,11 +101,11 @@ namespace bts.sdk
|
||||
{
|
||||
var accid = user.UserData.AccountPermissions.AccountPermissions.FirstOrDefault();
|
||||
cr.NewOrder.AccountId = (uint)accid.Key;
|
||||
cr.NewOrder.Account = admin.value.Accounts.First(x => x.Id == accid.Key).Name;
|
||||
cr.NewOrder.Account = admin.Accounts.First(x => x.Id == accid.Key).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
var acc = admin.value.Accounts.FirstOrDefault(x => x.Name.ToLowerInvariant() == accountname.ToLowerInvariant());
|
||||
var acc = admin.Accounts.FirstOrDefault(x => x.Name.ToLowerInvariant() == accountname.ToLowerInvariant());
|
||||
if (acc != null)
|
||||
{
|
||||
cr.NewOrder.Account = acc.Name;
|
||||
|
||||
@@ -13,28 +13,25 @@ namespace bts.sdk
|
||||
|
||||
public class SDKMain
|
||||
{
|
||||
static async Task<LoginResult> login(string user, string pass)
|
||||
{
|
||||
return await Locator.login(user, pass);
|
||||
}
|
||||
private static void user_test()
|
||||
private static void user_test(ServiceContext ctx)
|
||||
{
|
||||
var s = Locator.locate<api.user.AuthService>();
|
||||
var s = ctx.locate<api.user.AuthService>();
|
||||
var r = new api.user.GetUsersRequest();
|
||||
var resp = s.get_users(r);
|
||||
Console.WriteLine("{0}", resp);
|
||||
}
|
||||
public async static Task Main(string[] args)
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
BTS.init();
|
||||
Log.ClientSdk.info("Welcome to the BTS Client Side SDK example");
|
||||
var ctx = new ServiceContext();
|
||||
|
||||
string u = args.FirstOrDefault(x => x.Contains("--user="));
|
||||
string p = args.FirstOrDefault(x => x.Contains("--pass="));
|
||||
u = u?.Replace("--user=", string.Empty) ?? string.Empty;
|
||||
p = p?.Replace("--pass=", string.Empty) ?? string.Empty;
|
||||
|
||||
var lr = await login(u, p);
|
||||
var lr = ctx.login(u,p).Result;
|
||||
if (!lr.success)
|
||||
{
|
||||
Console.WriteLine("Login failure: " + lr.reason);
|
||||
@@ -43,7 +40,7 @@ namespace bts.sdk
|
||||
|
||||
if (args.FirstOrDefault() == "users")
|
||||
{
|
||||
user_test();
|
||||
user_test(ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -52,55 +49,56 @@ namespace bts.sdk
|
||||
if (pu != null)
|
||||
ms = uint.Parse(p.Replace("--pump=", string.Empty));
|
||||
|
||||
MarketDataClient client = new MarketDataClient(ms, Locator.token);
|
||||
CompositeDisposable disp = new CompositeDisposable(client);
|
||||
if (args.Length > 0 && args.FirstOrDefault().Contains("md"))
|
||||
{
|
||||
var s = new MarketDataSample(client);
|
||||
if (args.FirstOrDefault() == "md")
|
||||
MarketDataClient client = new MarketDataClient(ms, ctx.token);
|
||||
using(var disp = new CompositeDisposable(client)) {
|
||||
if (args.Length > 0 && args.FirstOrDefault().Contains("md"))
|
||||
{
|
||||
if (args.Length >= 5)
|
||||
var s = new MarketDataSample(client);
|
||||
if (args.FirstOrDefault() == "md")
|
||||
{
|
||||
s.print_security(args[1], args[2], args[3], args[4]);
|
||||
}
|
||||
else if (args.Length >= 4)
|
||||
{
|
||||
s.print_product(args[1], args[2], args[3]);
|
||||
if (args.Length >= 5)
|
||||
{
|
||||
s.print_security(args[1], args[2], args[3], args[4]);
|
||||
}
|
||||
else if (args.Length >= 4)
|
||||
{
|
||||
s.print_product(args[1], args[2], args[3]);
|
||||
}
|
||||
else
|
||||
md_help();
|
||||
}
|
||||
else
|
||||
md_help();
|
||||
}
|
||||
else if (args.FirstOrDefault() == "order")
|
||||
{
|
||||
OrderSample os = new OrderSample(client);
|
||||
disp.Add(os);
|
||||
order_sample(os, u, args);
|
||||
}
|
||||
else
|
||||
md_help();
|
||||
}
|
||||
else if (args.FirstOrDefault() == "order")
|
||||
{
|
||||
OrderSample os = new OrderSample(client);
|
||||
disp.Add(os);
|
||||
order_sample(os, u, args);
|
||||
}
|
||||
else
|
||||
help();
|
||||
help();
|
||||
|
||||
wait_for_stop(disp);
|
||||
wait_for_stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async void order_sample(OrderSample os, string user, string[] args)
|
||||
static void order_sample(OrderSample os, string user, string[] args)
|
||||
{
|
||||
if (args.Length >= 10) //--user and --pass are in args[]
|
||||
{
|
||||
await os.send_order(user, args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
|
||||
os.send_order(user, args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
|
||||
}
|
||||
else if (args.Length >= 9)
|
||||
{
|
||||
await os.send_order(user, args[1], args[2], args[3], args[4], args[5], args[6]);
|
||||
os.send_order(user, args[1], args[2], args[3], args[4], args[5], args[6]);
|
||||
}
|
||||
else
|
||||
order_help();
|
||||
}
|
||||
|
||||
static void wait_for_stop(IDisposable disp)
|
||||
static void wait_for_stop()
|
||||
{
|
||||
Console.WriteLine("Hit q to stop");
|
||||
ConsoleKeyInfo c;
|
||||
@@ -109,7 +107,6 @@ namespace bts.sdk
|
||||
c = Console.ReadKey();
|
||||
Console.WriteLine();
|
||||
} while (c.KeyChar != 'q');
|
||||
disp.Dispose();
|
||||
}
|
||||
|
||||
static void help()
|
||||
|
||||
@@ -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/service_helpers/AlgoServiceUtils.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MBOService.proto;api/services/MarginService.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/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/keycode.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/span.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/keycode.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/span.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/MBOProcessor.cpp;md/MBOServiceServer.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityMapper.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/ice/ICEUtils.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/mbo_tests.cpp;md/test/md2_tests.cpp;md/test/md_test_utils.cpp;md/test/synthetic_book_merge_tests.cpp;md/vendor/OnixsUtils.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/AuthSessionManager.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/crypto/CipherType.cpp;utils/crypto/CryptoInit.cpp;utils/crypto/Digest.cpp;utils/crypto/KeyCodeHelper.cpp;utils/crypto/PasswordCallbaLine 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/service_helpers/AlgoServiceUtils.cpp;api/service_helpers/PositionUtilities.cpp;api/services/AdminService.proto;api/services/AlgoDefinitionService.proto;api/services/AlgoService.proto;api/services/ApiUnitTestService.proto;api/services/AuthService.proto;api/services/BasePositionService.proto;api/services/ErrorReportService.proto;api/services/HelloService.proto;api/services/MBOService.proto;api/services/MarginService.proto;api/services/MarketDataAuxiliaryService.proto;api/services/MarketDataRelay.proto;api/services/MoneyFileService.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/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/keycode.conf;config/defaults/logging.conf;config/defaults/orderman_cfg.conf;config/defaults/orders_fills_cleanup.conf;config/defaults/position_cfg.conf;config/defaults/span.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/keycode.proto;config/protos/logging.proto;config/protos/mercury_cfg.proto;config/protos/orderman_cfg.proto;config/protos/orders_fills_cleanup.proto;config/protos/perflog_cfg.proto;config/protos/position_cfg.proto;config/protos/quickbus_cfg.proto;config/protos/span.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/sod.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/MBOProcessor.cpp;md/MBOServiceServer.cpp;md/MDClient.cpp;md/MDConsumer.cpp;md/MDConsumerHandle.cpp;md/MDConsumerInterop.cpp;md/MDProducer.cpp;md/MDProducerHandle.cpp;md/MemorySegmentUtils.cpp;md/PlatformLoader.cpp;md/PriceSize.cpp;md/SecurityCache.cpp;md/SecurityDB.cpp;md/SecurityIDRecorder.cpp;md/SecurityMapper.cpp;md/SecurityOracle.cpp;md/SettlementRecorder.cpp;md/Shm/FixedSecurity.cpp;md/SyntheticSecurityService.cpp;md/cme/MDP3Utils.cpp;md/common.cpp;md/ice/ICEUtils.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/mbo_tests.cpp;md/test/md2_tests.cpp;md/test/md_test_utils.cpp;md/test/synthetic_book_merge_tests.cpp;md/vendor/OnixsUtils.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/AuthSessionManager.cpp;utils/AuthToken.cpp;utils/Dispatcher.cpp;utils/GrowableSPSCQueue.cpp;utils/HTTPStream.cpp;utils/PBUtils.cpp;utils/Puid.cpp;utils/SecureLogoLine truncated
|
||||
@@ -4,7 +4,7 @@ Logging {
|
||||
console { default_level: "Error" }
|
||||
syslog { default_level: "Info" }
|
||||
file { default_level: "Info" }
|
||||
initial_queue_size: 128
|
||||
initial_queue_size: 1024
|
||||
max_queue_growth: 100
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,15 @@ GMI_SymbolMap {
|
||||
sym { gmi: "05" spark: "ZS" venue: VENUE_GLBX price_multiplier: 100.0}
|
||||
sym { gmi: "KW" spark: "KE" venue: VENUE_GLBX price_multiplier: 100.0}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GMI_Import {
|
||||
rule: "DeploymentType.type == 'DEV'"
|
||||
value {
|
||||
sftp_host: "10.96.18.41"
|
||||
sftp_port: 22222
|
||||
sftp_user: "PaTeACYB"
|
||||
sftp_password: "DLXKuVK8"
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,11 @@ package bts.config;
|
||||
|
||||
message GMI_Import
|
||||
{
|
||||
required string sftp_host = 10 [default = "10.96.18.41"];
|
||||
optional uint32 sftp_port = 11 [default = 22222];
|
||||
required string sftp_user = 12 [default = "sftp"];
|
||||
required string sftp_password = 2 [default = "sftp"];
|
||||
required string sftp_host = 10 ;
|
||||
optional uint32 sftp_port = 11 ;
|
||||
required string sftp_user = 12 ;
|
||||
required string sftp_password = 2 ;
|
||||
|
||||
required int32 pause_between_downloads_seconds = 4 [default = 30];
|
||||
required int32 download_timeout_seconds = 5 [default = 35];
|
||||
optional string download_window_begin = 6 [default = "22:00"];
|
||||
|
||||
@@ -24,14 +24,14 @@ _sod_time(sod_time){
|
||||
LOG(persist, Info, "SODPosition::cons sod_time:{}", sod_time.tv_sec);
|
||||
}
|
||||
|
||||
// returns the timeval for today's hh,mm,ss (in local machine terms)
|
||||
// (timeval is the microseconds from epoch)
|
||||
// returns the timeval (secs/usecs from epoch) for today's hh,mm,ss
|
||||
// (in local machine time zone)
|
||||
timeval SODPosition::to_timeval(uint16_t hh, uint16_t mm, uint16_t ss) {
|
||||
// function does the conversion the following way:
|
||||
// 1. gets the now secs from epoch using time
|
||||
// 2. converts it into local time (so we have now local time)
|
||||
// 3. overrides the hh, mm, ss passed
|
||||
// 4. converts it back into secs from epoch using mktime
|
||||
// 1. gets the secs from epoch (time_t)
|
||||
// 2. converts it into local time
|
||||
// 3. overrides the hh, mm, ss for local time with the func args
|
||||
// 4. converts it back into timeval
|
||||
bts_assert(hh < 24);
|
||||
bts_assert(mm < 60);
|
||||
bts_assert(ss < 60);
|
||||
|
||||
@@ -178,7 +178,9 @@ void OrderMatcher::match(std::vector<Order> *out) {
|
||||
auto iBid = me->bids.begin();
|
||||
auto iAsk = me->asks.begin();
|
||||
|
||||
if (iBid->price() >= iAsk->price()) {
|
||||
if (iBid->price() > iAsk->price() ||
|
||||
price_equals(iBid->price(), iAsk->price()))
|
||||
{
|
||||
|
||||
Order bid = *iBid;
|
||||
Order ask = *iAsk;
|
||||
|
||||
Reference in new issue
Block a user