diff --git a/TTWebClient/Domain/TTTrade.cs b/TTWebClient/Domain/TTTrade.cs
index 30ff46e..ebfaa85 100644
--- a/TTWebClient/Domain/TTTrade.cs
+++ b/TTWebClient/Domain/TTTrade.cs
@@ -158,7 +158,10 @@ public class TTTrade
/// Trigger Time
public DateTime? TriggerTime { get; set; }
- /// Commission
+ /// Order Id Triggered By
public long? OrderIdTriggeredBy { get; set; }
+
+ /// Close Price
+ public decimal? ClosePrice { get; set; }
}
}
diff --git a/TTWebClient/TTWebClient.csproj b/TTWebClient/TTWebClient.csproj
index 074e413..90ba7c1 100644
--- a/TTWebClient/TTWebClient.csproj
+++ b/TTWebClient/TTWebClient.csproj
@@ -9,7 +9,7 @@
Properties
TTWebClient
TTWebClient
- v4.6.1
+ v4.8
512
..\
true
diff --git a/TTWebClient/app.config b/TTWebClient/app.config
index 323c0f4..a905483 100644
--- a/TTWebClient/app.config
+++ b/TTWebClient/app.config
@@ -1,17 +1,17 @@
-
+
-
+
-
-
+
+
-
-
+
+
diff --git a/TTWebClientRobot/App.config b/TTWebClientRobot/App.config
index 1a53b96..1231108 100644
--- a/TTWebClientRobot/App.config
+++ b/TTWebClientRobot/App.config
@@ -1,17 +1,17 @@
-
+
-
-
+
+
-
-
+
+
diff --git a/TTWebClientRobot/TTWebClientRobot.csproj b/TTWebClientRobot/TTWebClientRobot.csproj
index 3da7d46..3e9a667 100644
--- a/TTWebClientRobot/TTWebClientRobot.csproj
+++ b/TTWebClientRobot/TTWebClientRobot.csproj
@@ -9,7 +9,7 @@
Properties
TTWebClientRobot
TTWebClientRobot
- v4.6.1
+ v4.8
512
diff --git a/TTWebClientSample/App.config b/TTWebClientSample/App.config
index 1a53b96..1231108 100644
--- a/TTWebClientSample/App.config
+++ b/TTWebClientSample/App.config
@@ -1,17 +1,17 @@
-
+
-
-
+
+
-
-
+
+
diff --git a/TTWebClientSample/TTWebClientSample.csproj b/TTWebClientSample/TTWebClientSample.csproj
index f9cd116..15f31a7 100644
--- a/TTWebClientSample/TTWebClientSample.csproj
+++ b/TTWebClientSample/TTWebClientSample.csproj
@@ -9,7 +9,7 @@
Properties
TTWebClientSample
TTWebClientSample
- v4.6.1
+ v4.8
512
publish\
true
diff --git a/TTWebClientUI/App.config b/TTWebClientUI/App.config
index d87e154..6e0188a 100644
--- a/TTWebClientUI/App.config
+++ b/TTWebClientUI/App.config
@@ -6,18 +6,18 @@
-
+
-
-
+
+
-
-
+
+
diff --git a/TTWebClientUI/ClientView.cs b/TTWebClientUI/ClientView.cs
index 4bbed2b..2396b64 100644
--- a/TTWebClientUI/ClientView.cs
+++ b/TTWebClientUI/ClientView.cs
@@ -143,6 +143,7 @@ internal class ClientView : ObservableObject
public Command GetPositionsCommand { get; set; }
public Command GetTradesCommand { get; set; }
public Command PostTradeCommand { get; set; }
+ public Command CloseTradeCommand { get; set; }
public Command GetTradeHistoryCommand { get; set; }
public bool IsPublicEnabled
@@ -538,6 +539,7 @@ public ClientView(CredsModel creds)
GetPositionsCommand = new Command(async () => await GetPositions());
GetTradesCommand = new Command(async () => await GetTrades());
PostTradeCommand = new Command(async () => await PostTrade());
+ CloseTradeCommand = new Command(async () => await CloseTrade());
GetTradeHistoryCommand = new Command(async () => await GetTradeHistory());
if (creds.IsPublicOnly)
@@ -876,6 +878,27 @@ public async Task PostTrade()
Trades = trades != null ? new ObservableCollection(trades) : null;
}
+ public async Task CloseTrade()
+ {
+ // Account trades
+ List trades = null;
+ if (!long.TryParse(TradeId, out var tradeId))
+ return;
+ else
+ {
+ try
+ {
+ var trade = await _client.CloseTradeAsync(tradeId, null);
+ trades = new List(new[] { trade.Trade });
+ }
+ catch (Exception)
+ {
+ }
+ }
+
+ Trades = trades != null ? new ObservableCollection(trades) : null;
+ }
+
#endregion
#region Account trade history information
diff --git a/TTWebClientUI/MainWindow.xaml b/TTWebClientUI/MainWindow.xaml
index a4ebbb7..8fa781b 100644
--- a/TTWebClientUI/MainWindow.xaml
+++ b/TTWebClientUI/MainWindow.xaml
@@ -576,10 +576,15 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -619,6 +624,7 @@
+
diff --git a/TTWebClientUI/Properties/Resources.Designer.cs b/TTWebClientUI/Properties/Resources.Designer.cs
index 764ba33..71744cd 100644
--- a/TTWebClientUI/Properties/Resources.Designer.cs
+++ b/TTWebClientUI/Properties/Resources.Designer.cs
@@ -19,7 +19,7 @@ namespace TTWebClientUI.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
diff --git a/TTWebClientUI/Properties/Settings.Designer.cs b/TTWebClientUI/Properties/Settings.Designer.cs
index e9aafa8..b624aa3 100644
--- a/TTWebClientUI/Properties/Settings.Designer.cs
+++ b/TTWebClientUI/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace TTWebClientUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
diff --git a/TTWebClientUI/TTWebClientUI.csproj b/TTWebClientUI/TTWebClientUI.csproj
index 6bbad2b..caabb8d 100644
--- a/TTWebClientUI/TTWebClientUI.csproj
+++ b/TTWebClientUI/TTWebClientUI.csproj
@@ -9,7 +9,7 @@
Properties
TTWebClientUI
TTWebClientUI
- v4.6.1
+ v4.8
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4