From 6b799bf93b1a1920a844c3aa98fe7ced018ee941 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 8 Jul 2019 15:37:35 -0500 Subject: [PATCH 1/8] [non-functional] normalize spacing/tabs in LoginView.xaml --- .../spark/view/Shell/Login/LoginView.xaml | 293 ++++++++++-------- 1 file changed, 157 insertions(+), 136 deletions(-) diff --git a/src/client/spark/view/Shell/Login/LoginView.xaml b/src/client/spark/view/Shell/Login/LoginView.xaml index 61ab1e961..e11a66b2f 100644 --- a/src/client/spark/view/Shell/Login/LoginView.xaml +++ b/src/client/spark/view/Shell/Login/LoginView.xaml @@ -1,143 +1,164 @@ - - - - - - - - + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/src/client/spark/view/Shell/Login/LoginView.xaml.cs b/src/client/spark/view/Shell/Login/LoginView.xaml.cs index e9edcd73c..974f3c5ba 100644 --- a/src/client/spark/view/Shell/Login/LoginView.xaml.cs +++ b/src/client/spark/view/Shell/Login/LoginView.xaml.cs @@ -1,21 +1,42 @@ -using System; +using bts; +using mbts.ui.converters; +using mbts.ui.native; +using mbts.utils; +using System; using System.Linq; using System.Windows; +using System.Windows.Data; using System.Windows.Input; using System.Windows.Interop; using System.Windows.Media.Imaging; -using mbts.ui.native; -using bts; -using System.Windows.Data; -using mbts.ui.converters; namespace mbts.ui.shell { public partial class LoginView : Window { - public static IValueConverter ResumeWorkspaceVisualStateConverter => + public enum LoginStatus { + Initializing, + Ready, + Error, + Rejected, + LoggingIn + } + + public static IValueConverter WorkspaceVisualStateConverter => ValueConverter.create(workspace => !string.IsNullOrEmpty(workspace) && workspace != LoginViewModel.NEW_WORKSPACE_NAME ? - VisualStateNames.ResumeWorkspace.Active : - VisualStateNames.ResumeWorkspace.Inactive); + VisualStateNames.Workspace.Active : + VisualStateNames.Workspace.Inactive); + + public static IValueConverter LoginStatusVisualStateConverter => + ValueConverter.create(status => { + switch (status) { + case LoginStatus.Initializing: return VisualStateNames.LoginStatus.Initializing; + case LoginStatus.Ready: return VisualStateNames.LoginStatus.Ready; + case LoginStatus.LoggingIn: return VisualStateNames.LoginStatus.Loading; + case LoginStatus.Rejected: return VisualStateNames.LoginStatus.Rejected; + case LoginStatus.Error: return VisualStateNames.LoginStatus.Error; + default: throw ExceptionBuilder.Argument.unexpected_case(status, nameof(status)); + } + }); public LoginView(LoginViewModel model) { this.DataContext = model; @@ -73,8 +94,18 @@ namespace mbts.ui.shell { } public static class VisualStateNames { - public static class ResumeWorkspace { - public const string GroupName = nameof(ResumeWorkspace); + public static class LoginStatus { + public const string GroupName = nameof(LoginStatus); + public static readonly string + Initializing = $"{GroupName}{nameof(Initializing)}", + Ready = $"{GroupName}{nameof(Ready)}", + Loading = $"{GroupName}{nameof(Loading)}", + Rejected = $"{GroupName}{nameof(Rejected)}", + Error = $"{GroupName}{nameof(Error)}"; + } + + public static class Workspace { + public const string GroupName = nameof(Workspace); public static readonly string Active = $"{GroupName}{VisualStates.Active}", diff --git a/src/client/spark/view/Shell/Login/LoginViewModel.cs b/src/client/spark/view/Shell/Login/LoginViewModel.cs index 41b2c7b8d..608b79009 100644 --- a/src/client/spark/view/Shell/Login/LoginViewModel.cs +++ b/src/client/spark/view/Shell/Login/LoginViewModel.cs @@ -2,14 +2,12 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Threading; +using LoginStatus = mbts.ui.shell.LoginView.LoginStatus; -namespace mbts.ui.shell -{ +namespace mbts.ui.shell { public class LoginViewModel : ViewModelBase, IRequestViewClose { public const string NEW_WORKSPACE_NAME = "New workspace..."; @@ -43,7 +41,7 @@ namespace mbts.ui.shell void _model_Ready() { _dispatcher.BeginInvoke(() => { if (!_model.HasFatalError) { - this.VisualState = "LoginState"; + login_status = LoginStatus.Ready; load_username(); if (!string.IsNullOrEmpty(_name)) KnownUsers.Add(_name); @@ -51,13 +49,13 @@ namespace mbts.ui.shell } else { ErrorMessage = _model.ErrorMessage; - VisualState = "ErrorState"; + login_status = LoginStatus.Error; } }); } - private string _vstate = "Normal"; - public string VisualState { get { return _vstate; } set { _vstate = value; RaisePropertyChanged("VisualState"); } } + LoginStatus _login_status; + public LoginStatus login_status { get => _login_status; private set => Set(ref _login_status, value); } /// should only contain the user-name of the last login (if none exists, it should be empty). public ObservableCollection KnownUsers { get; } = new ObservableCollection(); @@ -145,10 +143,10 @@ namespace mbts.ui.shell string selected_workspace = _resume_workspace && SelectedWorkspace != NEW_WORKSPACE_NAME ? SelectedWorkspace : null; var result = await _model.do_login(Name, selected_workspace, Password); - if (result.success) { VisualState = "Loading"; } + if (result.success) { login_status = LoginStatus.LoggingIn; } if (!result.success && !string.IsNullOrEmpty(result.reason)) { WarningMessage = result.reason; - VisualState = "BadPassword"; + login_status = LoginStatus.Rejected; } else if (!string.IsNullOrEmpty(result.reason)) { // Login was successful but we have a message for the user From 901988ec2bb8b965507195117bc239ff6976eecc Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 23 Jul 2019 13:46:06 -0500 Subject: [PATCH 5/8] center-align loginview's reject message --- src/client/spark/view/Shell/Login/LoginView.xaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/spark/view/Shell/Login/LoginView.xaml b/src/client/spark/view/Shell/Login/LoginView.xaml index eb1c48b7a..cf775b558 100644 --- a/src/client/spark/view/Shell/Login/LoginView.xaml +++ b/src/client/spark/view/Shell/Login/LoginView.xaml @@ -192,8 +192,7 @@ Date: Tue, 23 Jul 2019 13:53:45 -0500 Subject: [PATCH 6/8] flip 'login/cancel' buttons to follow ok/cancel pattern --- src/client/spark/view/Shell/Login/LoginView.xaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/spark/view/Shell/Login/LoginView.xaml b/src/client/spark/view/Shell/Login/LoginView.xaml index cf775b558..741efc3fb 100644 --- a/src/client/spark/view/Shell/Login/LoginView.xaml +++ b/src/client/spark/view/Shell/Login/LoginView.xaml @@ -251,12 +251,12 @@ - + From 6756ba44eb33c8063f740d7054b2e8b0ff281ad7 Mon Sep 17 00:00:00 2001 From: Karl Ellefsen Date: Thu, 25 Jul 2019 17:58:20 +0000 Subject: [PATCH 7/8] Top_cover_TEST.txt edited online with Bitbucket --- .../manual/algo_operations/Top_cover_TEST.txt | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/testing/manual/algo_operations/Top_cover_TEST.txt b/testing/manual/algo_operations/Top_cover_TEST.txt index 57f6f2afa..a603a2c3f 100644 --- a/testing/manual/algo_operations/Top_cover_TEST.txt +++ b/testing/manual/algo_operations/Top_cover_TEST.txt @@ -1,3 +1,14 @@ +This needs sim market data **not** to be merged with replay (or +cert), so we can create our own markets. Use the following key to set +market data up: + +ExchangeSim { + value { + merge_with_md: false + forward_implied: false + } +} + Algo Studio lets you combine algos together and save it as an order type: To test this, we will create a common algo combination and test to make sure it's working as desired. @@ -6,42 +17,32 @@ To test this, we will create a common algo combination and test to make sure it' Let's start by creating the Algo: Launch Algo Studio -Click on top right icon to "add algo" +Click on top left icon to "add algo" Give it a name, call it T_C and give the abbrev a title of T_C as well. Create a Top with Cover, so the very top algos with be a "top" (top thresh 10) and it's child will be a cover (Hedge Ticks 2) Leave both Hedge and Child as limits of the child -Use a very liquid market with recorded data to test, I suggest something like ES or CL. - On the ladder, go to settings, then algo favorites and click add and choose your T_C algo. This will display it on the ladder for quick deployment -click on algo, then enter an order on the best bid +1.) Create a 20 lot bid/ask market 1 tick apart. +2.) Place a 5 lot T_C (top cover algo) buy order on the best bid market. +3.) Place another 5 lot buy limit order on the best bid +4.) Place a 25 lot sell limit order on the best bid, filling the orders placed in 1 and 2 +5.) Verify that the cover order was deployed. -wait until it fills, once fills, it should submit the cover order 2 ticks above the price you got filled at. - -try this with a sell order following the same procedure. +Repeat steps 1 through 5 with a sell order. Additionally, we will add a "lean" into the mix as the child of the cover. -go back to your algo studio, and change the hedge of the cover to be that of lean. - -What will happen is once the cover order is submitted, it will include the lean logic on that cover order. Meaning, it'll lean into the market and cross once the cross thresh is reach. - -Set the parameters to a cross thresh of 10, max chase ticks 0 and on toward no change - -save the algo, and send an order and wait for it to be filled. - -Once filled, it will remain working until the market flips, which means it ticks up a level. Once it flips and there is 1 remaining, the order should cross. - - - - - - +Go back to your algo studio, and change the hedge of the cover to be that of lean. +What will happen is once the cover order is submitted, it will include the lean logic on that cover order. +Set the parameters to a cross thresh of 10, max chase ticks 0 and on toward no change. +Save the algo, and repeat steps 1 through 5 again. +This time the hedge should get filled immediately, as it will lean into the market that we just reduced below it's threshold size. \ No newline at end of file From c670d0012bbe5d9e75cc07a8cfbc01bbbb130b9d Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Fri, 26 Jul 2019 11:06:29 -0400 Subject: [PATCH 8/8] Updated release notes. --- doc/user/content/release_notes/_index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index 9e307916f..a1bda15e2 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -4,6 +4,10 @@ weight = 3 sort_by = "weight" insert_anchor_links = "right" +++ +## 2.7.2 +### User Visible Changes + - Changed the login dialog to avoid leaking workspace names from other users. + ## 2.7.1 ### User Visible Changes - Fixed some issues with the Cover algo, where in some circumstances