mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-06 01:22:11 +00:00
Crypto samples.
This commit is contained in:
1 parent
63570191e5
commit
d350cfa3a2
250 files changed
+13940
No files matched your search
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="SampleBitfinex.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
public partial class App
|
||||
{
|
||||
private void ApplicationDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
MessageBox.Show(MainWindow, e.Exception.ToString());
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<Window x:Class="SampleBitfinex.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
Title="{x:Static loc:LocalizedStrings.XamlStr540}" Height="110" Width="512" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="24" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr234}" HorizontalAlignment="Right" />
|
||||
<TextBox x:Name="Key" Text="" Width="170" />
|
||||
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr646}" HorizontalAlignment="Right" />
|
||||
<PasswordBox x:Name="Secret" Password="" Width="170" />
|
||||
</StackPanel>
|
||||
|
||||
<Button x:Name="ConnectBtn" Background="LightPink" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Content="{x:Static loc:LocalizedStrings.Connect}" Click="ConnectClick" />
|
||||
<Button x:Name="ShowSecurities" Grid.Column="1" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Securities}" Click="ShowSecuritiesClick" />
|
||||
<Button x:Name="ShowPortfolios" Grid.Column="2" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Portfolios}" Click="ShowPortfoliosClick" />
|
||||
|
||||
<Button x:Name="ShowTrades" Grid.Column="1" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Ticks}" Click="ShowTradesClick" />
|
||||
<Button x:Name="ShowMyTrades" Grid.Column="2" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.MyTrades}" Click="ShowMyTradesClick" />
|
||||
<Button x:Name="ShowOrders" Grid.Column="3" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Orders}" Click="ShowOrdersClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,214 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Bitfinex;
|
||||
using StockSharp.Logging;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class MainWindow
|
||||
{
|
||||
private bool _isConnected;
|
||||
|
||||
public BitfinexTrader Trader;
|
||||
|
||||
private readonly SecuritiesWindow _securitiesWindow = new SecuritiesWindow();
|
||||
private readonly TradesWindow _tradesWindow = new TradesWindow();
|
||||
private readonly MyTradesWindow _myTradesWindow = new MyTradesWindow();
|
||||
private readonly OrdersWindow _ordersWindow = new OrdersWindow();
|
||||
private readonly PortfoliosWindow _portfoliosWindow = new PortfoliosWindow();
|
||||
|
||||
private readonly LogManager _logManager = new LogManager();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Title = Title.Put("Bitfinex");
|
||||
|
||||
_ordersWindow.MakeHideable();
|
||||
_myTradesWindow.MakeHideable();
|
||||
_tradesWindow.MakeHideable();
|
||||
_securitiesWindow.MakeHideable();
|
||||
_portfoliosWindow.MakeHideable();
|
||||
|
||||
Instance = this;
|
||||
|
||||
_logManager.Sources.Add(MemoryStatistics.Instance);
|
||||
_logManager.Listeners.Add(new FileLogListener { LogDirectory = "StockSharp_Bitfinex" });
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
_ordersWindow.DeleteHideable();
|
||||
_myTradesWindow.DeleteHideable();
|
||||
_tradesWindow.DeleteHideable();
|
||||
_securitiesWindow.DeleteHideable();
|
||||
_portfoliosWindow.DeleteHideable();
|
||||
|
||||
_securitiesWindow.Close();
|
||||
_tradesWindow.Close();
|
||||
_myTradesWindow.Close();
|
||||
_ordersWindow.Close();
|
||||
_portfoliosWindow.Close();
|
||||
|
||||
if (Trader != null)
|
||||
Trader.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
public static MainWindow Instance { get; private set; }
|
||||
|
||||
private void ConnectClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isConnected)
|
||||
{
|
||||
if (Key.Text.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3689);
|
||||
return;
|
||||
}
|
||||
else if (Secret.Password.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3690);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Trader == null)
|
||||
{
|
||||
// create connector
|
||||
Trader = new BitfinexTrader();// { LogLevel = LogLevels.Debug };
|
||||
|
||||
_logManager.Sources.Add(Trader);
|
||||
|
||||
Trader.Restored += () => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(true);
|
||||
MessageBox.Show(this, LocalizedStrings.Str2958);
|
||||
});
|
||||
|
||||
// subscribe on connection successfully event
|
||||
Trader.Connected += () =>
|
||||
{
|
||||
// set flag (connection is established)
|
||||
_isConnected = true;
|
||||
|
||||
// update gui labes
|
||||
this.GuiAsync(() => ChangeConnectStatus(true));
|
||||
};
|
||||
Trader.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false));
|
||||
|
||||
// subscribe on connection error event
|
||||
Trader.ConnectionError += error => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(false);
|
||||
|
||||
MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2959);
|
||||
});
|
||||
|
||||
// subscribe on error event
|
||||
Trader.Error += error =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2955));
|
||||
|
||||
// subscribe on error of market data subscription event
|
||||
Trader.MarketDataSubscriptionFailed += (security, msg, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2956Params.Put(msg.DataType, security)));
|
||||
|
||||
Trader.NewSecurity += _securitiesWindow.SecurityPicker.Securities.Add;
|
||||
Trader.NewMyTrade += _myTradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewTrade += _tradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewOrder += _ordersWindow.OrderGrid.Orders.Add;
|
||||
|
||||
Trader.NewPortfolio += _portfoliosWindow.PortfolioGrid.Portfolios.Add;
|
||||
Trader.NewPosition += _portfoliosWindow.PortfolioGrid.Positions.Add;
|
||||
|
||||
// subscribe on error of order registration event
|
||||
Trader.OrderRegisterFailed += _ordersWindow.OrderGrid.AddRegistrationFail;
|
||||
// subscribe on error of order cancelling event
|
||||
Trader.OrderCancelFailed += OrderFailed;
|
||||
|
||||
Trader.MassOrderCancelFailed += (transId, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str716));
|
||||
|
||||
// set market data provider
|
||||
_securitiesWindow.SecurityPicker.MarketDataProvider = Trader;
|
||||
|
||||
ShowSecurities.IsEnabled = ShowTrades.IsEnabled =
|
||||
ShowMyTrades.IsEnabled = ShowOrders.IsEnabled =
|
||||
ShowPortfolios.IsEnabled = true;
|
||||
}
|
||||
|
||||
Trader.Key = Key.Text;
|
||||
Trader.Secret = Secret.Password;
|
||||
|
||||
// clear password box for security reason
|
||||
//Secret.Clear();
|
||||
|
||||
Trader.Connect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trader.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private void OrderFailed(OrderFail fail)
|
||||
{
|
||||
this.GuiAsync(() =>
|
||||
{
|
||||
MessageBox.Show(this, fail.Error.ToString(), LocalizedStrings.Str153);
|
||||
});
|
||||
}
|
||||
|
||||
private void ChangeConnectStatus(bool isConnected)
|
||||
{
|
||||
_isConnected = isConnected;
|
||||
ConnectBtn.Content = isConnected ? LocalizedStrings.Disconnect : LocalizedStrings.Connect;
|
||||
}
|
||||
|
||||
private void ShowSecuritiesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_securitiesWindow);
|
||||
}
|
||||
|
||||
private void ShowTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_tradesWindow);
|
||||
}
|
||||
|
||||
private void ShowMyTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_myTradesWindow);
|
||||
}
|
||||
|
||||
private void ShowOrdersClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_ordersWindow);
|
||||
}
|
||||
|
||||
private void ShowPortfoliosClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_portfoliosWindow);
|
||||
}
|
||||
|
||||
private static void ShowOrHide(Window window)
|
||||
{
|
||||
if (window == null)
|
||||
throw new ArgumentNullException(nameof(window));
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBitfinex.MyTradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.MyTrades}" Height="284" Width="644">
|
||||
<xaml:MyTradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
public partial class MyTradesWindow
|
||||
{
|
||||
public MyTradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="SampleBitfinex.OrdersWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Orders}" Height="410" Width="1069">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<xaml:OrderGrid x:Name="OrderGrid" x:FieldModifier="public" OrderCanceling="OrderGrid_OnOrderCanceling" OrderReRegistering="OrderGrid_OnOrderReRegistering" />
|
||||
<Button Grid.Row="1" Width="100" HorizontalAlignment="Right" Content="{x:Static loc:LocalizedStrings.CancelAll}" Click="CancelAll_OnClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.Algo;
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Localization;
|
||||
using StockSharp.Xaml;
|
||||
|
||||
public partial class OrdersWindow
|
||||
{
|
||||
public OrdersWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private static IConnector Connector => MainWindow.Instance.Trader;
|
||||
|
||||
private void OrderGrid_OnOrderCanceling(Order order)
|
||||
{
|
||||
Connector.CancelOrder(order);
|
||||
}
|
||||
|
||||
private void OrderGrid_OnOrderReRegistering(Order order)
|
||||
{
|
||||
var window = new OrderWindow
|
||||
{
|
||||
Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
|
||||
SecurityProvider = Connector,
|
||||
MarketDataProvider = Connector,
|
||||
Portfolios = new PortfolioDataSource(Connector),
|
||||
Order = order.ReRegisterClone(newVolume: order.Balance),
|
||||
};
|
||||
|
||||
if (window.ShowModal(this))
|
||||
{
|
||||
Connector.ReRegisterOrder(order, window.Order);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelAll_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Connector.CancelOrders();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBitfinex.PortfoliosWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Portfolios}" Height="200" Width="470">
|
||||
<xaml:PortfolioGrid x:Name="PortfolioGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
public partial class PortfoliosWindow
|
||||
{
|
||||
public PortfoliosWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SampleBitfinex")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
|
||||
[assembly: Guid("AAA73471-8AAD-4CE2-8385-ECCE764967CB")]
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBitfinex.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// 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", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleBitfinex.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBitfinex.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBitfinex.QuotesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="QuotesWindow" Height="600" Width="280">
|
||||
<xaml:MarketDepthControl x:Name="DepthCtrl" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
public partial class QuotesWindow
|
||||
{
|
||||
public QuotesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1CC3B6EC-70A3-4B6C-A120-74BB46D8BB0F}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBitfinex</RootNamespace>
|
||||
<AssemblyName>SampleBitfinex</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Themes.Office2016White.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Themes.Office2016White.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharp %28GitLab%29\Connectors\Bitfinex\Bitfinex.csproj">
|
||||
<Project>{5D5F59F8-2136-42D1-90B5-B6C41D4C3964}</Project>
|
||||
<Name>Bitfinex</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{B47F9C23-A4BD-46A9-BF27-54CB3D653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml.Charting\Xaml.Charting.csproj">
|
||||
<Project>{c449d618-dea4-41c3-ba86-9f827c7421dc}</Project>
|
||||
<Name>Xaml.Charting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64E4D6F0-36B6-4904-9BA7-FFFBE5FF71D8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
#region S# License
|
||||
/******************************************************************************************
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
*******************************************************************************************/
|
||||
#endregion S# License
|
||||
extensions: .aspx .ascx
|
||||
<%--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
--%>
|
||||
extensions: .xml .config .xsd
|
||||
<!--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
-->
|
||||
@@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F85DE217-9B3A-4436-AEDD-E83910F100C1}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBitfinex</RootNamespace>
|
||||
<AssemblyName>SampleBitfinex</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="StockSharp.Bitfinex">
|
||||
<HintPath>..\..\..\References\StockSharp.Bitfinex.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\..\..\References\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.LayoutControl.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.LayoutControl.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Connectors\Btce\Btce.csproj">
|
||||
<Project>{AF225452-1CF1-48A2-B381-C02BEBE643D7}</Project>
|
||||
<Name>Bitfinex</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64e4d6f0-36b6-4904-9ba7-fffbe5ff71d8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{b47f9c23-a4bd-46a9-bf27-54cb3d653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<Window x:Class="SampleBitfinex.SecuritiesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:sx="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Securities}" Height="415" Width="1081">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<sx:SecurityPicker x:Name="SecurityPicker" x:FieldModifier="public" SecuritySelected="SecurityPicker_OnSecuritySelected" ShowCommonStatColumns="True" />
|
||||
|
||||
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button x:Name="Quotes" Content="{x:Static loc:LocalizedStrings.XamlStr40}" Width="100" IsEnabled="False" Click="QuotesClick" />
|
||||
<Button x:Name="Depth" Width="100" IsEnabled="False" Click="DepthClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.MarketDepth}" />...</TextBlock>
|
||||
</Button>
|
||||
<Button x:Name="NewOrder" Width="100" IsEnabled="False" Click="NewOrderClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.NewOrder}" />...</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,126 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Collections;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using MoreLinq;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Xaml;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class SecuritiesWindow
|
||||
{
|
||||
private readonly SynchronizedDictionary<Security, QuotesWindow> _quotesWindows = new SynchronizedDictionary<Security, QuotesWindow>();
|
||||
private bool _initialized;
|
||||
|
||||
public SecuritiesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_quotesWindows.SyncDo(d => d.Values.ForEach(w =>
|
||||
{
|
||||
w.DeleteHideable();
|
||||
w.Close();
|
||||
}));
|
||||
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
if (trader != null)
|
||||
{
|
||||
if (_initialized)
|
||||
trader.MarketDepthChanged -= TraderOnMarketDepthChanged;
|
||||
}
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void SecurityPicker_OnSecuritySelected(Security security)
|
||||
{
|
||||
Quotes.IsEnabled = NewOrder.IsEnabled = Depth.IsEnabled = security != null;
|
||||
}
|
||||
|
||||
private void NewOrderClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var newOrder = new OrderWindow
|
||||
{
|
||||
Order = new Order { Security = SecurityPicker.SelectedSecurity },
|
||||
SecurityProvider = MainWindow.Instance.Trader,
|
||||
MarketDataProvider = MainWindow.Instance.Trader,
|
||||
Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
|
||||
};
|
||||
|
||||
if (newOrder.ShowModal(this))
|
||||
MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
|
||||
}
|
||||
|
||||
private void DepthClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
var window = _quotesWindows.SafeAdd(security, s =>
|
||||
{
|
||||
// начинаем получать котировки стакана
|
||||
trader.RegisterMarketDepth(security);
|
||||
|
||||
// создаем окно со стаканом
|
||||
var wnd = new QuotesWindow
|
||||
{
|
||||
Title = security.Id + " " + LocalizedStrings.MarketDepth
|
||||
};
|
||||
wnd.MakeHideable();
|
||||
return wnd;
|
||||
});
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
{
|
||||
window.Show();
|
||||
window.DepthCtrl.UpdateDepth(trader.GetMarketDepth(security));
|
||||
}
|
||||
|
||||
if (!_initialized)
|
||||
{
|
||||
trader.MarketDepthChanged += TraderOnMarketDepthChanged;
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void QuotesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
if (trader.RegisteredSecurities.Contains(security))
|
||||
{
|
||||
trader.UnRegisterSecurity(security);
|
||||
trader.UnRegisterTrades(security);
|
||||
}
|
||||
else
|
||||
{
|
||||
trader.RegisterSecurity(security);
|
||||
trader.RegisterTrades(security);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TraderOnMarketDepthChanged(MarketDepth depth)
|
||||
{
|
||||
var wnd = _quotesWindows.TryGetValue(depth.Security);
|
||||
|
||||
if (wnd != null)
|
||||
wnd.DepthCtrl.UpdateDepth(depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBitfinex.TradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"␍ xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Str985}" Height="284" Width="530">
|
||||
<xaml:TradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBitfinex
|
||||
{
|
||||
public partial class TradesWindow
|
||||
{
|
||||
public TradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="SampleBithumb.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
public partial class App
|
||||
{
|
||||
private void ApplicationDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
MessageBox.Show(MainWindow, e.Exception.ToString());
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<Window x:Class="SampleBithumb.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
Title="{x:Static loc:LocalizedStrings.XamlStr540}" Height="110" Width="512" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="24" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr234}" HorizontalAlignment="Right" />
|
||||
<TextBox x:Name="Key" Text="" Width="170" />
|
||||
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr646}" HorizontalAlignment="Right" />
|
||||
<PasswordBox x:Name="Secret" Password="" Width="170" />
|
||||
</StackPanel>
|
||||
|
||||
<Button x:Name="ConnectBtn" Background="LightPink" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Content="{x:Static loc:LocalizedStrings.Connect}" Click="ConnectClick" />
|
||||
<Button x:Name="ShowSecurities" Grid.Column="1" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Securities}" Click="ShowSecuritiesClick" />
|
||||
<Button x:Name="ShowPortfolios" Grid.Column="2" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Portfolios}" Click="ShowPortfoliosClick" />
|
||||
|
||||
<Button x:Name="ShowTrades" Grid.Column="1" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Ticks}" Click="ShowTradesClick" />
|
||||
<Button x:Name="ShowMyTrades" Grid.Column="2" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.MyTrades}" Click="ShowMyTradesClick" />
|
||||
<Button x:Name="ShowOrders" Grid.Column="3" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Orders}" Click="ShowOrdersClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,214 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Bithumb;
|
||||
using StockSharp.Logging;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class MainWindow
|
||||
{
|
||||
private bool _isConnected;
|
||||
|
||||
public BithumbTrader Trader;
|
||||
|
||||
private readonly SecuritiesWindow _securitiesWindow = new SecuritiesWindow();
|
||||
private readonly TradesWindow _tradesWindow = new TradesWindow();
|
||||
private readonly MyTradesWindow _myTradesWindow = new MyTradesWindow();
|
||||
private readonly OrdersWindow _ordersWindow = new OrdersWindow();
|
||||
private readonly PortfoliosWindow _portfoliosWindow = new PortfoliosWindow();
|
||||
|
||||
private readonly LogManager _logManager = new LogManager();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Title = Title.Put("Bithumb");
|
||||
|
||||
_ordersWindow.MakeHideable();
|
||||
_myTradesWindow.MakeHideable();
|
||||
_tradesWindow.MakeHideable();
|
||||
_securitiesWindow.MakeHideable();
|
||||
_portfoliosWindow.MakeHideable();
|
||||
|
||||
Instance = this;
|
||||
|
||||
_logManager.Sources.Add(MemoryStatistics.Instance);
|
||||
_logManager.Listeners.Add(new FileLogListener { LogDirectory = "StockSharp_Bithumb" });
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
_ordersWindow.DeleteHideable();
|
||||
_myTradesWindow.DeleteHideable();
|
||||
_tradesWindow.DeleteHideable();
|
||||
_securitiesWindow.DeleteHideable();
|
||||
_portfoliosWindow.DeleteHideable();
|
||||
|
||||
_securitiesWindow.Close();
|
||||
_tradesWindow.Close();
|
||||
_myTradesWindow.Close();
|
||||
_ordersWindow.Close();
|
||||
_portfoliosWindow.Close();
|
||||
|
||||
if (Trader != null)
|
||||
Trader.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
public static MainWindow Instance { get; private set; }
|
||||
|
||||
private void ConnectClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isConnected)
|
||||
{
|
||||
if (Key.Text.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3689);
|
||||
return;
|
||||
}
|
||||
else if (Secret.Password.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3690);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Trader == null)
|
||||
{
|
||||
// create connector
|
||||
Trader = new BithumbTrader();// { LogLevel = LogLevels.Debug };
|
||||
|
||||
_logManager.Sources.Add(Trader);
|
||||
|
||||
Trader.Restored += () => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(true);
|
||||
MessageBox.Show(this, LocalizedStrings.Str2958);
|
||||
});
|
||||
|
||||
// subscribe on connection successfully event
|
||||
Trader.Connected += () =>
|
||||
{
|
||||
// set flag (connection is established)
|
||||
_isConnected = true;
|
||||
|
||||
// update gui labes
|
||||
this.GuiAsync(() => ChangeConnectStatus(true));
|
||||
};
|
||||
Trader.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false));
|
||||
|
||||
// subscribe on connection error event
|
||||
Trader.ConnectionError += error => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(false);
|
||||
|
||||
MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2959);
|
||||
});
|
||||
|
||||
// subscribe on error event
|
||||
Trader.Error += error =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2955));
|
||||
|
||||
// subscribe on error of market data subscription event
|
||||
Trader.MarketDataSubscriptionFailed += (security, msg, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2956Params.Put(msg.DataType, security)));
|
||||
|
||||
Trader.NewSecurity += _securitiesWindow.SecurityPicker.Securities.Add;
|
||||
Trader.NewMyTrade += _myTradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewTrade += _tradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewOrder += _ordersWindow.OrderGrid.Orders.Add;
|
||||
|
||||
Trader.NewPortfolio += _portfoliosWindow.PortfolioGrid.Portfolios.Add;
|
||||
Trader.NewPosition += _portfoliosWindow.PortfolioGrid.Positions.Add;
|
||||
|
||||
// subscribe on error of order registration event
|
||||
Trader.OrderRegisterFailed += _ordersWindow.OrderGrid.AddRegistrationFail;
|
||||
// subscribe on error of order cancelling event
|
||||
Trader.OrderCancelFailed += OrderFailed;
|
||||
|
||||
Trader.MassOrderCancelFailed += (transId, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str716));
|
||||
|
||||
// set market data provider
|
||||
_securitiesWindow.SecurityPicker.MarketDataProvider = Trader;
|
||||
|
||||
ShowSecurities.IsEnabled = ShowTrades.IsEnabled =
|
||||
ShowMyTrades.IsEnabled = ShowOrders.IsEnabled =
|
||||
ShowPortfolios.IsEnabled = true;
|
||||
}
|
||||
|
||||
Trader.Key = Key.Text;
|
||||
Trader.Secret = Secret.Password;
|
||||
|
||||
// clear password box for security reason
|
||||
//Secret.Clear();
|
||||
|
||||
Trader.Connect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trader.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private void OrderFailed(OrderFail fail)
|
||||
{
|
||||
this.GuiAsync(() =>
|
||||
{
|
||||
MessageBox.Show(this, fail.Error.ToString(), LocalizedStrings.Str153);
|
||||
});
|
||||
}
|
||||
|
||||
private void ChangeConnectStatus(bool isConnected)
|
||||
{
|
||||
_isConnected = isConnected;
|
||||
ConnectBtn.Content = isConnected ? LocalizedStrings.Disconnect : LocalizedStrings.Connect;
|
||||
}
|
||||
|
||||
private void ShowSecuritiesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_securitiesWindow);
|
||||
}
|
||||
|
||||
private void ShowTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_tradesWindow);
|
||||
}
|
||||
|
||||
private void ShowMyTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_myTradesWindow);
|
||||
}
|
||||
|
||||
private void ShowOrdersClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_ordersWindow);
|
||||
}
|
||||
|
||||
private void ShowPortfoliosClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_portfoliosWindow);
|
||||
}
|
||||
|
||||
private static void ShowOrHide(Window window)
|
||||
{
|
||||
if (window == null)
|
||||
throw new ArgumentNullException(nameof(window));
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBithumb.MyTradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.MyTrades}" Height="284" Width="644">
|
||||
<xaml:MyTradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
public partial class MyTradesWindow
|
||||
{
|
||||
public MyTradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="SampleBithumb.OrdersWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Orders}" Height="410" Width="1069">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<xaml:OrderGrid x:Name="OrderGrid" x:FieldModifier="public" OrderCanceling="OrderGrid_OnOrderCanceling" OrderReRegistering="OrderGrid_OnOrderReRegistering" />
|
||||
<Button Grid.Row="1" Width="100" HorizontalAlignment="Right" Content="{x:Static loc:LocalizedStrings.CancelAll}" Click="CancelAll_OnClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.Algo;
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Localization;
|
||||
using StockSharp.Xaml;
|
||||
|
||||
public partial class OrdersWindow
|
||||
{
|
||||
public OrdersWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private static IConnector Connector => MainWindow.Instance.Trader;
|
||||
|
||||
private void OrderGrid_OnOrderCanceling(Order order)
|
||||
{
|
||||
Connector.CancelOrder(order);
|
||||
}
|
||||
|
||||
private void OrderGrid_OnOrderReRegistering(Order order)
|
||||
{
|
||||
var window = new OrderWindow
|
||||
{
|
||||
Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
|
||||
SecurityProvider = Connector,
|
||||
MarketDataProvider = Connector,
|
||||
Portfolios = new PortfolioDataSource(Connector),
|
||||
Order = order.ReRegisterClone(newVolume: order.Balance),
|
||||
};
|
||||
|
||||
if (window.ShowModal(this))
|
||||
{
|
||||
Connector.ReRegisterOrder(order, window.Order);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelAll_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Connector.CancelOrders();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBithumb.PortfoliosWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Portfolios}" Height="200" Width="470">
|
||||
<xaml:PortfolioGrid x:Name="PortfolioGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
public partial class PortfoliosWindow
|
||||
{
|
||||
public PortfoliosWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SampleBithumb")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
|
||||
[assembly: Guid("6BEA0137-3272-4206-BCAF-2B4F263D51A4")]
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBithumb.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// 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", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleBithumb.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBithumb.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBithumb.QuotesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="QuotesWindow" Height="600" Width="280">
|
||||
<xaml:MarketDepthControl x:Name="DepthCtrl" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
public partial class QuotesWindow
|
||||
{
|
||||
public QuotesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{90B10F70-D343-4189-87DC-37E48FA1133C}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBithumb</RootNamespace>
|
||||
<AssemblyName>SampleBithumb</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Themes.Office2016White.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Themes.Office2016White.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharp %28GitLab%29\Connectors\Bithumb\Bithumb.csproj">
|
||||
<Project>{4FD21E37-BD2D-4AEF-8297-CEA4C7EBEF01}</Project>
|
||||
<Name>Bithumb</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{B47F9C23-A4BD-46A9-BF27-54CB3D653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml.Charting\Xaml.Charting.csproj">
|
||||
<Project>{c449d618-dea4-41c3-ba86-9f827c7421dc}</Project>
|
||||
<Name>Xaml.Charting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64E4D6F0-36B6-4904-9BA7-FFFBE5FF71D8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
#region S# License
|
||||
/******************************************************************************************
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
*******************************************************************************************/
|
||||
#endregion S# License
|
||||
extensions: .aspx .ascx
|
||||
<%--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
--%>
|
||||
extensions: .xml .config .xsd
|
||||
<!--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
-->
|
||||
@@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0D7BD2D3-FBA0-491F-BC45-860AF15F549B}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBithumb</RootNamespace>
|
||||
<AssemblyName>SampleBithumb</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="StockSharp.Bithumb">
|
||||
<HintPath>..\..\..\References\StockSharp.Bithumb.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\..\..\References\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.LayoutControl.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.LayoutControl.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Connectors\Btce\Btce.csproj">
|
||||
<Project>{AF225452-1CF1-48A2-B381-C02BEBE643D7}</Project>
|
||||
<Name>Bithumb</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64e4d6f0-36b6-4904-9ba7-fffbe5ff71d8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{b47f9c23-a4bd-46a9-bf27-54cb3d653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<Window x:Class="SampleBithumb.SecuritiesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:sx="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Securities}" Height="415" Width="1081">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<sx:SecurityPicker x:Name="SecurityPicker" x:FieldModifier="public" SecuritySelected="SecurityPicker_OnSecuritySelected" ShowCommonStatColumns="True" />
|
||||
|
||||
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button x:Name="Quotes" Content="{x:Static loc:LocalizedStrings.XamlStr40}" Width="100" IsEnabled="False" Click="QuotesClick" />
|
||||
<Button x:Name="Depth" Width="100" IsEnabled="False" Click="DepthClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.MarketDepth}" />...</TextBlock>
|
||||
</Button>
|
||||
<Button x:Name="NewOrder" Width="100" IsEnabled="False" Click="NewOrderClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.NewOrder}" />...</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,126 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Collections;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using MoreLinq;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Xaml;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class SecuritiesWindow
|
||||
{
|
||||
private readonly SynchronizedDictionary<Security, QuotesWindow> _quotesWindows = new SynchronizedDictionary<Security, QuotesWindow>();
|
||||
private bool _initialized;
|
||||
|
||||
public SecuritiesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_quotesWindows.SyncDo(d => d.Values.ForEach(w =>
|
||||
{
|
||||
w.DeleteHideable();
|
||||
w.Close();
|
||||
}));
|
||||
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
if (trader != null)
|
||||
{
|
||||
if (_initialized)
|
||||
trader.MarketDepthChanged -= TraderOnMarketDepthChanged;
|
||||
}
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void SecurityPicker_OnSecuritySelected(Security security)
|
||||
{
|
||||
Quotes.IsEnabled = NewOrder.IsEnabled = Depth.IsEnabled = security != null;
|
||||
}
|
||||
|
||||
private void NewOrderClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var newOrder = new OrderWindow
|
||||
{
|
||||
Order = new Order { Security = SecurityPicker.SelectedSecurity },
|
||||
SecurityProvider = MainWindow.Instance.Trader,
|
||||
MarketDataProvider = MainWindow.Instance.Trader,
|
||||
Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
|
||||
};
|
||||
|
||||
if (newOrder.ShowModal(this))
|
||||
MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
|
||||
}
|
||||
|
||||
private void DepthClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
var window = _quotesWindows.SafeAdd(security, s =>
|
||||
{
|
||||
// начинаем получать котировки стакана
|
||||
trader.RegisterMarketDepth(security);
|
||||
|
||||
// создаем окно со стаканом
|
||||
var wnd = new QuotesWindow
|
||||
{
|
||||
Title = security.Id + " " + LocalizedStrings.MarketDepth
|
||||
};
|
||||
wnd.MakeHideable();
|
||||
return wnd;
|
||||
});
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
{
|
||||
window.Show();
|
||||
window.DepthCtrl.UpdateDepth(trader.GetMarketDepth(security));
|
||||
}
|
||||
|
||||
if (!_initialized)
|
||||
{
|
||||
trader.MarketDepthChanged += TraderOnMarketDepthChanged;
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void QuotesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
if (trader.RegisteredSecurities.Contains(security))
|
||||
{
|
||||
trader.UnRegisterSecurity(security);
|
||||
trader.UnRegisterTrades(security);
|
||||
}
|
||||
else
|
||||
{
|
||||
trader.RegisterSecurity(security);
|
||||
trader.RegisterTrades(security);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TraderOnMarketDepthChanged(MarketDepth depth)
|
||||
{
|
||||
var wnd = _quotesWindows.TryGetValue(depth.Security);
|
||||
|
||||
if (wnd != null)
|
||||
wnd.DepthCtrl.UpdateDepth(depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBithumb.TradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"␍ xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Str985}" Height="284" Width="530">
|
||||
<xaml:TradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBithumb
|
||||
{
|
||||
public partial class TradesWindow
|
||||
{
|
||||
public TradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="SampleBittrex.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
public partial class App
|
||||
{
|
||||
private void ApplicationDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
MessageBox.Show(MainWindow, e.Exception.ToString());
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<Window x:Class="SampleBittrex.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
Title="{x:Static loc:LocalizedStrings.XamlStr540}" Height="110" Width="512" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="24" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr234}" HorizontalAlignment="Right" />
|
||||
<TextBox x:Name="Key" Text="" Width="170" />
|
||||
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr646}" HorizontalAlignment="Right" />
|
||||
<PasswordBox x:Name="Secret" Password="" Width="170" />
|
||||
</StackPanel>
|
||||
|
||||
<Button x:Name="ConnectBtn" Background="LightPink" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Content="{x:Static loc:LocalizedStrings.Connect}" Click="ConnectClick" />
|
||||
<Button x:Name="ShowSecurities" Grid.Column="1" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Securities}" Click="ShowSecuritiesClick" />
|
||||
<Button x:Name="ShowPortfolios" Grid.Column="2" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Portfolios}" Click="ShowPortfoliosClick" />
|
||||
|
||||
<Button x:Name="ShowTrades" Grid.Column="1" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Ticks}" Click="ShowTradesClick" />
|
||||
<Button x:Name="ShowMyTrades" Grid.Column="2" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.MyTrades}" Click="ShowMyTradesClick" />
|
||||
<Button x:Name="ShowOrders" Grid.Column="3" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Orders}" Click="ShowOrdersClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,214 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Bittrex;
|
||||
using StockSharp.Logging;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class MainWindow
|
||||
{
|
||||
private bool _isConnected;
|
||||
|
||||
public BittrexTrader Trader;
|
||||
|
||||
private readonly SecuritiesWindow _securitiesWindow = new SecuritiesWindow();
|
||||
private readonly TradesWindow _tradesWindow = new TradesWindow();
|
||||
private readonly MyTradesWindow _myTradesWindow = new MyTradesWindow();
|
||||
private readonly OrdersWindow _ordersWindow = new OrdersWindow();
|
||||
private readonly PortfoliosWindow _portfoliosWindow = new PortfoliosWindow();
|
||||
|
||||
private readonly LogManager _logManager = new LogManager();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Title = Title.Put("Bittrex");
|
||||
|
||||
_ordersWindow.MakeHideable();
|
||||
_myTradesWindow.MakeHideable();
|
||||
_tradesWindow.MakeHideable();
|
||||
_securitiesWindow.MakeHideable();
|
||||
_portfoliosWindow.MakeHideable();
|
||||
|
||||
Instance = this;
|
||||
|
||||
_logManager.Sources.Add(MemoryStatistics.Instance);
|
||||
_logManager.Listeners.Add(new FileLogListener { LogDirectory = "StockSharp_Bittrex" });
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
_ordersWindow.DeleteHideable();
|
||||
_myTradesWindow.DeleteHideable();
|
||||
_tradesWindow.DeleteHideable();
|
||||
_securitiesWindow.DeleteHideable();
|
||||
_portfoliosWindow.DeleteHideable();
|
||||
|
||||
_securitiesWindow.Close();
|
||||
_tradesWindow.Close();
|
||||
_myTradesWindow.Close();
|
||||
_ordersWindow.Close();
|
||||
_portfoliosWindow.Close();
|
||||
|
||||
if (Trader != null)
|
||||
Trader.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
public static MainWindow Instance { get; private set; }
|
||||
|
||||
private void ConnectClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isConnected)
|
||||
{
|
||||
if (Key.Text.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3689);
|
||||
return;
|
||||
}
|
||||
else if (Secret.Password.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3690);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Trader == null)
|
||||
{
|
||||
// create connector
|
||||
Trader = new BittrexTrader();// { LogLevel = LogLevels.Debug };
|
||||
|
||||
_logManager.Sources.Add(Trader);
|
||||
|
||||
Trader.Restored += () => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(true);
|
||||
MessageBox.Show(this, LocalizedStrings.Str2958);
|
||||
});
|
||||
|
||||
// subscribe on connection successfully event
|
||||
Trader.Connected += () =>
|
||||
{
|
||||
// set flag (connection is established)
|
||||
_isConnected = true;
|
||||
|
||||
// update gui labes
|
||||
this.GuiAsync(() => ChangeConnectStatus(true));
|
||||
};
|
||||
Trader.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false));
|
||||
|
||||
// subscribe on connection error event
|
||||
Trader.ConnectionError += error => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(false);
|
||||
|
||||
MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2959);
|
||||
});
|
||||
|
||||
// subscribe on error event
|
||||
Trader.Error += error =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2955));
|
||||
|
||||
// subscribe on error of market data subscription event
|
||||
Trader.MarketDataSubscriptionFailed += (security, msg, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2956Params.Put(msg.DataType, security)));
|
||||
|
||||
Trader.NewSecurity += _securitiesWindow.SecurityPicker.Securities.Add;
|
||||
Trader.NewMyTrade += _myTradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewTrade += _tradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewOrder += _ordersWindow.OrderGrid.Orders.Add;
|
||||
|
||||
Trader.NewPortfolio += _portfoliosWindow.PortfolioGrid.Portfolios.Add;
|
||||
Trader.NewPosition += _portfoliosWindow.PortfolioGrid.Positions.Add;
|
||||
|
||||
// subscribe on error of order registration event
|
||||
Trader.OrderRegisterFailed += _ordersWindow.OrderGrid.AddRegistrationFail;
|
||||
// subscribe on error of order cancelling event
|
||||
Trader.OrderCancelFailed += OrderFailed;
|
||||
|
||||
Trader.MassOrderCancelFailed += (transId, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str716));
|
||||
|
||||
// set market data provider
|
||||
_securitiesWindow.SecurityPicker.MarketDataProvider = Trader;
|
||||
|
||||
ShowSecurities.IsEnabled = ShowTrades.IsEnabled =
|
||||
ShowMyTrades.IsEnabled = ShowOrders.IsEnabled =
|
||||
ShowPortfolios.IsEnabled = true;
|
||||
}
|
||||
|
||||
Trader.Key = Key.Text;
|
||||
Trader.Secret = Secret.Password;
|
||||
|
||||
// clear password box for security reason
|
||||
//Secret.Clear();
|
||||
|
||||
Trader.Connect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trader.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private void OrderFailed(OrderFail fail)
|
||||
{
|
||||
this.GuiAsync(() =>
|
||||
{
|
||||
MessageBox.Show(this, fail.Error.ToString(), LocalizedStrings.Str153);
|
||||
});
|
||||
}
|
||||
|
||||
private void ChangeConnectStatus(bool isConnected)
|
||||
{
|
||||
_isConnected = isConnected;
|
||||
ConnectBtn.Content = isConnected ? LocalizedStrings.Disconnect : LocalizedStrings.Connect;
|
||||
}
|
||||
|
||||
private void ShowSecuritiesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_securitiesWindow);
|
||||
}
|
||||
|
||||
private void ShowTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_tradesWindow);
|
||||
}
|
||||
|
||||
private void ShowMyTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_myTradesWindow);
|
||||
}
|
||||
|
||||
private void ShowOrdersClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_ordersWindow);
|
||||
}
|
||||
|
||||
private void ShowPortfoliosClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_portfoliosWindow);
|
||||
}
|
||||
|
||||
private static void ShowOrHide(Window window)
|
||||
{
|
||||
if (window == null)
|
||||
throw new ArgumentNullException(nameof(window));
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBittrex.MyTradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.MyTrades}" Height="284" Width="644">
|
||||
<xaml:MyTradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
public partial class MyTradesWindow
|
||||
{
|
||||
public MyTradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="SampleBittrex.OrdersWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Orders}" Height="410" Width="1069">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<xaml:OrderGrid x:Name="OrderGrid" x:FieldModifier="public" OrderCanceling="OrderGrid_OnOrderCanceling" OrderReRegistering="OrderGrid_OnOrderReRegistering" />
|
||||
<Button Grid.Row="1" Width="100" HorizontalAlignment="Right" Content="{x:Static loc:LocalizedStrings.CancelAll}" Click="CancelAll_OnClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.Algo;
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Localization;
|
||||
using StockSharp.Xaml;
|
||||
|
||||
public partial class OrdersWindow
|
||||
{
|
||||
public OrdersWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private static IConnector Connector => MainWindow.Instance.Trader;
|
||||
|
||||
private void OrderGrid_OnOrderCanceling(Order order)
|
||||
{
|
||||
Connector.CancelOrder(order);
|
||||
}
|
||||
|
||||
private void OrderGrid_OnOrderReRegistering(Order order)
|
||||
{
|
||||
var window = new OrderWindow
|
||||
{
|
||||
Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
|
||||
SecurityProvider = Connector,
|
||||
MarketDataProvider = Connector,
|
||||
Portfolios = new PortfolioDataSource(Connector),
|
||||
Order = order.ReRegisterClone(newVolume: order.Balance),
|
||||
};
|
||||
|
||||
if (window.ShowModal(this))
|
||||
{
|
||||
Connector.ReRegisterOrder(order, window.Order);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelAll_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Connector.CancelOrders();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleBittrex.PortfoliosWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Portfolios}" Height="200" Width="470">
|
||||
<xaml:PortfolioGrid x:Name="PortfolioGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
public partial class PortfoliosWindow
|
||||
{
|
||||
public PortfoliosWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SampleBittrex")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
|
||||
[assembly: Guid("037B853E-A898-4CC5-AC7B-A3EAD7173011")]
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBittrex.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// 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", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleBittrex.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleBittrex.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBittrex.QuotesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="QuotesWindow" Height="600" Width="280">
|
||||
<xaml:MarketDepthControl x:Name="DepthCtrl" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
public partial class QuotesWindow
|
||||
{
|
||||
public QuotesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{46C6966D-B765-4406-99CA-16EFEFF1FA92}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBittrex</RootNamespace>
|
||||
<AssemblyName>SampleBittrex</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Themes.Office2016White.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Themes.Office2016White.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharp %28GitLab%29\Connectors\Bittrex\Bittrex.csproj">
|
||||
<Project>{302f3c2a-eb95-4af7-be22-e7be567b2dab}</Project>
|
||||
<Name>Bittrex</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{B47F9C23-A4BD-46A9-BF27-54CB3D653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml.Charting\Xaml.Charting.csproj">
|
||||
<Project>{c449d618-dea4-41c3-ba86-9f827c7421dc}</Project>
|
||||
<Name>Xaml.Charting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64E4D6F0-36B6-4904-9BA7-FFFBE5FF71D8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
#region S# License
|
||||
/******************************************************************************************
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
*******************************************************************************************/
|
||||
#endregion S# License
|
||||
extensions: .aspx .ascx
|
||||
<%--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
--%>
|
||||
extensions: .xml .config .xsd
|
||||
<!--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
-->
|
||||
@@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1EBD80DA-A248-4994-B6B3-E28BCA3C4B9B}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleBittrex</RootNamespace>
|
||||
<AssemblyName>SampleBittrex</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="StockSharp.Bittrex">
|
||||
<HintPath>..\..\..\References\StockSharp.Bittrex.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\..\..\References\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.LayoutControl.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.LayoutControl.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Connectors\Btce\Btce.csproj">
|
||||
<Project>{AF225452-1CF1-48A2-B381-C02BEBE643D7}</Project>
|
||||
<Name>Bittrex</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64e4d6f0-36b6-4904-9ba7-fffbe5ff71d8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{b47f9c23-a4bd-46a9-bf27-54cb3d653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<Window x:Class="SampleBittrex.SecuritiesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:sx="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Securities}" Height="415" Width="1081">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<sx:SecurityPicker x:Name="SecurityPicker" x:FieldModifier="public" SecuritySelected="SecurityPicker_OnSecuritySelected" ShowCommonStatColumns="True" />
|
||||
|
||||
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button x:Name="Quotes" Content="{x:Static loc:LocalizedStrings.XamlStr40}" Width="100" IsEnabled="False" Click="QuotesClick" />
|
||||
<Button x:Name="Depth" Width="100" IsEnabled="False" Click="DepthClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.MarketDepth}" />...</TextBlock>
|
||||
</Button>
|
||||
<Button x:Name="NewOrder" Width="100" IsEnabled="False" Click="NewOrderClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.NewOrder}" />...</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,126 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Collections;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using MoreLinq;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Xaml;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class SecuritiesWindow
|
||||
{
|
||||
private readonly SynchronizedDictionary<Security, QuotesWindow> _quotesWindows = new SynchronizedDictionary<Security, QuotesWindow>();
|
||||
private bool _initialized;
|
||||
|
||||
public SecuritiesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_quotesWindows.SyncDo(d => d.Values.ForEach(w =>
|
||||
{
|
||||
w.DeleteHideable();
|
||||
w.Close();
|
||||
}));
|
||||
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
if (trader != null)
|
||||
{
|
||||
if (_initialized)
|
||||
trader.MarketDepthChanged -= TraderOnMarketDepthChanged;
|
||||
}
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void SecurityPicker_OnSecuritySelected(Security security)
|
||||
{
|
||||
Quotes.IsEnabled = NewOrder.IsEnabled = Depth.IsEnabled = security != null;
|
||||
}
|
||||
|
||||
private void NewOrderClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var newOrder = new OrderWindow
|
||||
{
|
||||
Order = new Order { Security = SecurityPicker.SelectedSecurity },
|
||||
SecurityProvider = MainWindow.Instance.Trader,
|
||||
MarketDataProvider = MainWindow.Instance.Trader,
|
||||
Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
|
||||
};
|
||||
|
||||
if (newOrder.ShowModal(this))
|
||||
MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
|
||||
}
|
||||
|
||||
private void DepthClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
var window = _quotesWindows.SafeAdd(security, s =>
|
||||
{
|
||||
// начинаем получать котировки стакана
|
||||
trader.RegisterMarketDepth(security);
|
||||
|
||||
// создаем окно со стаканом
|
||||
var wnd = new QuotesWindow
|
||||
{
|
||||
Title = security.Id + " " + LocalizedStrings.MarketDepth
|
||||
};
|
||||
wnd.MakeHideable();
|
||||
return wnd;
|
||||
});
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
{
|
||||
window.Show();
|
||||
window.DepthCtrl.UpdateDepth(trader.GetMarketDepth(security));
|
||||
}
|
||||
|
||||
if (!_initialized)
|
||||
{
|
||||
trader.MarketDepthChanged += TraderOnMarketDepthChanged;
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void QuotesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
if (trader.RegisteredSecurities.Contains(security))
|
||||
{
|
||||
trader.UnRegisterSecurity(security);
|
||||
trader.UnRegisterTrades(security);
|
||||
}
|
||||
else
|
||||
{
|
||||
trader.RegisterSecurity(security);
|
||||
trader.RegisterTrades(security);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TraderOnMarketDepthChanged(MarketDepth depth)
|
||||
{
|
||||
var wnd = _quotesWindows.TryGetValue(depth.Security);
|
||||
|
||||
if (wnd != null)
|
||||
wnd.DepthCtrl.UpdateDepth(depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleBittrex.TradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"␍ xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Str985}" Height="284" Width="530">
|
||||
<xaml:TradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleBittrex
|
||||
{
|
||||
public partial class TradesWindow
|
||||
{
|
||||
public TradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
|
||||
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="SampleCoinbase.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml" ShutdownMode="OnMainWindowClose" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
public partial class App
|
||||
{
|
||||
private void ApplicationDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
MessageBox.Show(MainWindow, e.Exception.ToString());
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<Window x:Class="SampleCoinbase.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
Title="{x:Static loc:LocalizedStrings.XamlStr540}" Height="110" Width="512" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="24" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr234}" HorizontalAlignment="Right" />
|
||||
<TextBox x:Name="Key" Text="" Width="170" />
|
||||
|
||||
<Label Content="{x:Static loc:LocalizedStrings.XamlStr646}" HorizontalAlignment="Right" />
|
||||
<PasswordBox x:Name="Secret" Password="" Width="170" />
|
||||
</StackPanel>
|
||||
|
||||
<Button x:Name="ConnectBtn" Background="LightPink" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Content="{x:Static loc:LocalizedStrings.Connect}" Click="ConnectClick" />
|
||||
<Button x:Name="ShowSecurities" Grid.Column="1" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Securities}" Click="ShowSecuritiesClick" />
|
||||
<Button x:Name="ShowPortfolios" Grid.Column="2" Grid.Row="1" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Portfolios}" Click="ShowPortfoliosClick" />
|
||||
|
||||
<Button x:Name="ShowTrades" Grid.Column="1" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Ticks}" Click="ShowTradesClick" />
|
||||
<Button x:Name="ShowMyTrades" Grid.Column="2" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.MyTrades}" Click="ShowMyTradesClick" />
|
||||
<Button x:Name="ShowOrders" Grid.Column="3" Grid.Row="2" IsEnabled="False" Content="{x:Static loc:LocalizedStrings.Orders}" Click="ShowOrdersClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,214 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Coinbase;
|
||||
using StockSharp.Logging;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class MainWindow
|
||||
{
|
||||
private bool _isConnected;
|
||||
|
||||
public CoinbaseTrader Trader;
|
||||
|
||||
private readonly SecuritiesWindow _securitiesWindow = new SecuritiesWindow();
|
||||
private readonly TradesWindow _tradesWindow = new TradesWindow();
|
||||
private readonly MyTradesWindow _myTradesWindow = new MyTradesWindow();
|
||||
private readonly OrdersWindow _ordersWindow = new OrdersWindow();
|
||||
private readonly PortfoliosWindow _portfoliosWindow = new PortfoliosWindow();
|
||||
|
||||
private readonly LogManager _logManager = new LogManager();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Title = Title.Put("Coinbase");
|
||||
|
||||
_ordersWindow.MakeHideable();
|
||||
_myTradesWindow.MakeHideable();
|
||||
_tradesWindow.MakeHideable();
|
||||
_securitiesWindow.MakeHideable();
|
||||
_portfoliosWindow.MakeHideable();
|
||||
|
||||
Instance = this;
|
||||
|
||||
_logManager.Sources.Add(MemoryStatistics.Instance);
|
||||
_logManager.Listeners.Add(new FileLogListener { LogDirectory = "StockSharp_Coinbase" });
|
||||
}
|
||||
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
_ordersWindow.DeleteHideable();
|
||||
_myTradesWindow.DeleteHideable();
|
||||
_tradesWindow.DeleteHideable();
|
||||
_securitiesWindow.DeleteHideable();
|
||||
_portfoliosWindow.DeleteHideable();
|
||||
|
||||
_securitiesWindow.Close();
|
||||
_tradesWindow.Close();
|
||||
_myTradesWindow.Close();
|
||||
_ordersWindow.Close();
|
||||
_portfoliosWindow.Close();
|
||||
|
||||
if (Trader != null)
|
||||
Trader.Dispose();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
public static MainWindow Instance { get; private set; }
|
||||
|
||||
private void ConnectClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_isConnected)
|
||||
{
|
||||
if (Key.Text.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3689);
|
||||
return;
|
||||
}
|
||||
else if (Secret.Password.IsEmpty())
|
||||
{
|
||||
MessageBox.Show(this, LocalizedStrings.Str3690);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Trader == null)
|
||||
{
|
||||
// create connector
|
||||
Trader = new CoinbaseTrader();// { LogLevel = LogLevels.Debug };
|
||||
|
||||
_logManager.Sources.Add(Trader);
|
||||
|
||||
Trader.Restored += () => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(true);
|
||||
MessageBox.Show(this, LocalizedStrings.Str2958);
|
||||
});
|
||||
|
||||
// subscribe on connection successfully event
|
||||
Trader.Connected += () =>
|
||||
{
|
||||
// set flag (connection is established)
|
||||
_isConnected = true;
|
||||
|
||||
// update gui labes
|
||||
this.GuiAsync(() => ChangeConnectStatus(true));
|
||||
};
|
||||
Trader.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false));
|
||||
|
||||
// subscribe on connection error event
|
||||
Trader.ConnectionError += error => this.GuiAsync(() =>
|
||||
{
|
||||
// update gui labes
|
||||
ChangeConnectStatus(false);
|
||||
|
||||
MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2959);
|
||||
});
|
||||
|
||||
// subscribe on error event
|
||||
Trader.Error += error =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2955));
|
||||
|
||||
// subscribe on error of market data subscription event
|
||||
Trader.MarketDataSubscriptionFailed += (security, msg, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str2956Params.Put(msg.DataType, security)));
|
||||
|
||||
Trader.NewSecurity += _securitiesWindow.SecurityPicker.Securities.Add;
|
||||
Trader.NewMyTrade += _myTradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewTrade += _tradesWindow.TradeGrid.Trades.Add;
|
||||
Trader.NewOrder += _ordersWindow.OrderGrid.Orders.Add;
|
||||
|
||||
Trader.NewPortfolio += _portfoliosWindow.PortfolioGrid.Portfolios.Add;
|
||||
Trader.NewPosition += _portfoliosWindow.PortfolioGrid.Positions.Add;
|
||||
|
||||
// subscribe on error of order registration event
|
||||
Trader.OrderRegisterFailed += _ordersWindow.OrderGrid.AddRegistrationFail;
|
||||
// subscribe on error of order cancelling event
|
||||
Trader.OrderCancelFailed += OrderFailed;
|
||||
|
||||
Trader.MassOrderCancelFailed += (transId, error) =>
|
||||
this.GuiAsync(() => MessageBox.Show(this, error.ToString(), LocalizedStrings.Str716));
|
||||
|
||||
// set market data provider
|
||||
_securitiesWindow.SecurityPicker.MarketDataProvider = Trader;
|
||||
|
||||
ShowSecurities.IsEnabled = ShowTrades.IsEnabled =
|
||||
ShowMyTrades.IsEnabled = ShowOrders.IsEnabled =
|
||||
ShowPortfolios.IsEnabled = true;
|
||||
}
|
||||
|
||||
Trader.Key = Key.Text;
|
||||
Trader.Secret = Secret.Password;
|
||||
|
||||
// clear password box for security reason
|
||||
//Secret.Clear();
|
||||
|
||||
Trader.Connect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trader.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
private void OrderFailed(OrderFail fail)
|
||||
{
|
||||
this.GuiAsync(() =>
|
||||
{
|
||||
MessageBox.Show(this, fail.Error.ToString(), LocalizedStrings.Str153);
|
||||
});
|
||||
}
|
||||
|
||||
private void ChangeConnectStatus(bool isConnected)
|
||||
{
|
||||
_isConnected = isConnected;
|
||||
ConnectBtn.Content = isConnected ? LocalizedStrings.Disconnect : LocalizedStrings.Connect;
|
||||
}
|
||||
|
||||
private void ShowSecuritiesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_securitiesWindow);
|
||||
}
|
||||
|
||||
private void ShowTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_tradesWindow);
|
||||
}
|
||||
|
||||
private void ShowMyTradesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_myTradesWindow);
|
||||
}
|
||||
|
||||
private void ShowOrdersClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_ordersWindow);
|
||||
}
|
||||
|
||||
private void ShowPortfoliosClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ShowOrHide(_portfoliosWindow);
|
||||
}
|
||||
|
||||
private static void ShowOrHide(Window window)
|
||||
{
|
||||
if (window == null)
|
||||
throw new ArgumentNullException(nameof(window));
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleCoinbase.MyTradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.MyTrades}" Height="284" Width="644">
|
||||
<xaml:MyTradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
public partial class MyTradesWindow
|
||||
{
|
||||
public MyTradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="SampleCoinbase.OrdersWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Orders}" Height="410" Width="1069">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<xaml:OrderGrid x:Name="OrderGrid" x:FieldModifier="public" OrderCanceling="OrderGrid_OnOrderCanceling" OrderReRegistering="OrderGrid_OnOrderReRegistering" />
|
||||
<Button Grid.Row="1" Width="100" HorizontalAlignment="Right" Content="{x:Static loc:LocalizedStrings.CancelAll}" Click="CancelAll_OnClick" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Common;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using StockSharp.Algo;
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Localization;
|
||||
using StockSharp.Xaml;
|
||||
|
||||
public partial class OrdersWindow
|
||||
{
|
||||
public OrdersWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private static IConnector Connector => MainWindow.Instance.Trader;
|
||||
|
||||
private void OrderGrid_OnOrderCanceling(Order order)
|
||||
{
|
||||
Connector.CancelOrder(order);
|
||||
}
|
||||
|
||||
private void OrderGrid_OnOrderReRegistering(Order order)
|
||||
{
|
||||
var window = new OrderWindow
|
||||
{
|
||||
Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
|
||||
SecurityProvider = Connector,
|
||||
MarketDataProvider = Connector,
|
||||
Portfolios = new PortfolioDataSource(Connector),
|
||||
Order = order.ReRegisterClone(newVolume: order.Balance),
|
||||
};
|
||||
|
||||
if (window.ShowModal(this))
|
||||
{
|
||||
Connector.ReRegisterOrder(order, window.Order);
|
||||
}
|
||||
}
|
||||
|
||||
private void CancelAll_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Connector.CancelOrders();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Window x:Class="SampleCoinbase.PortfoliosWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Portfolios}" Height="200" Width="470">
|
||||
<xaml:PortfolioGrid x:Name="PortfolioGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
public partial class PortfoliosWindow
|
||||
{
|
||||
public PortfoliosWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SampleCoinbase")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
|
||||
[assembly: Guid("8BBADE31-482A-409F-8EC6-5E1F85802A3F")]
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleCoinbase.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// 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", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleCoinbase.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18449
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleCoinbase.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleCoinbase.QuotesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="QuotesWindow" Height="600" Width="280">
|
||||
<xaml:MarketDepthControl x:Name="DepthCtrl" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
public partial class QuotesWindow
|
||||
{
|
||||
public QuotesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D03FB418-C3A0-4B2D-BA53-37481D166B8C}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleCoinbase</RootNamespace>
|
||||
<AssemblyName>SampleCoinbase</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Themes.Office2016White.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Themes.Office2016White.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharp %28GitLab%29\Connectors\Coinbase\Coinbase.csproj">
|
||||
<Project>{AB948D64-73B2-4BDC-972C-337E51A67265}</Project>
|
||||
<Name>Coinbase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{B47F9C23-A4BD-46A9-BF27-54CB3D653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml.Charting\Xaml.Charting.csproj">
|
||||
<Project>{c449d618-dea4-41c3-ba86-9f827c7421dc}</Project>
|
||||
<Name>Xaml.Charting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64E4D6F0-36B6-4904-9BA7-FFFBE5FF71D8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
#region S# License
|
||||
/******************************************************************************************
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
*******************************************************************************************/
|
||||
#endregion S# License
|
||||
extensions: .aspx .ascx
|
||||
<%--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
--%>
|
||||
extensions: .xml .config .xsd
|
||||
<!--
|
||||
NOTICE!!! This program and source code is owned and licensed by
|
||||
StockSharp Algo Trading, LLC, www.stocksharp.com
|
||||
Viewing or use of this code requires your acceptance of the license
|
||||
agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE
|
||||
Removal of this comment is a violation of the license agreement.
|
||||
|
||||
Project: %Namespace%.%Project%
|
||||
File: %FileName%
|
||||
Created: %CreationYear%, %CreationMonth%, %CreationDay%, %CreationTime%
|
||||
|
||||
Copyright 2010 by StockSharp Algo Trading, LLC
|
||||
-->
|
||||
@@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{3CC23B3C-E1E1-49F4-B71A-12D833B77191}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleCoinbase</RootNamespace>
|
||||
<AssemblyName>SampleCoinbase</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ApplicationIcon>..\..\..\References\stocksharp.ico</ApplicationIcon>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="StockSharp.Coinbase">
|
||||
<HintPath>..\..\..\References\StockSharp.Coinbase.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Ecng.Localization">
|
||||
<HintPath>..\..\..\References\Ecng.Localization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Common">
|
||||
<HintPath>..\..\..\References\Ecng.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MoreLinq">
|
||||
<HintPath>..\..\..\References\MoreLinq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Collections">
|
||||
<HintPath>..\..\..\References\Ecng.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.ComponentModel">
|
||||
<HintPath>..\..\..\References\Ecng.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Serialization">
|
||||
<HintPath>..\..\..\References\Ecng.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ecng.Xaml">
|
||||
<HintPath>..\..\..\References\Ecng.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\..\..\References\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Data.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Core.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Core.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.Grid.v17.2.Core">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.Grid.v17.2.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Xpf.LayoutControl.v17.2">
|
||||
<HintPath>..\..\..\References\DevExpress.Xpf.LayoutControl.v17.2.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="..\..\..\StockSharpAssemblyInfo.cs">
|
||||
<Link>Properties\StockSharpAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MyTradesWindow.xaml.cs">
|
||||
<DependentUpon>MyTradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OrdersWindow.xaml.cs">
|
||||
<DependentUpon>OrdersWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PortfoliosWindow.xaml.cs">
|
||||
<DependentUpon>PortfoliosWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="QuotesWindow.xaml.cs">
|
||||
<DependentUpon>QuotesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SecuritiesWindow.xaml.cs">
|
||||
<DependentUpon>SecuritiesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TradesWindow.xaml.cs">
|
||||
<DependentUpon>TradesWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MyTradesWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="OrdersWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="PortfoliosWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="QuotesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SecuritiesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="TradesWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\..\References\stocksharp.ico">
|
||||
<Link>stocksharp.ico</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Connectors\Btce\Btce.csproj">
|
||||
<Project>{AF225452-1CF1-48A2-B381-C02BEBE643D7}</Project>
|
||||
<Name>Coinbase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\StockSharpApps\Xaml\Xaml.csproj">
|
||||
<Project>{64e4d6f0-36b6-4904-9ba7-fffbe5ff71d8}</Project>
|
||||
<Name>Xaml</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Algo\Algo.csproj">
|
||||
<Project>{2A5C6FAD-106C-4A4A-B602-77A6B1034CA2}</Project>
|
||||
<Name>Algo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\BusinessEntities\BusinessEntities.csproj">
|
||||
<Project>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</Project>
|
||||
<Name>BusinessEntities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Localization\Localization.csproj">
|
||||
<Project>{A98A81CE-75A1-4FAB-9C02-E6EEF4B51F4F}</Project>
|
||||
<Name>Localization</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Logging\Logging.csproj">
|
||||
<Project>{C4476ADD-A3D5-41BB-9D43-55D865863B78}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\Messages\Messages.csproj">
|
||||
<Project>{b47f9c23-a4bd-46a9-bf27-54cb3d653503}</Project>
|
||||
<Name>Messages</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<Window x:Class="SampleCoinbase.SecuritiesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:sx="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Securities}" Height="415" Width="1081">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<sx:SecurityPicker x:Name="SecurityPicker" x:FieldModifier="public" SecuritySelected="SecurityPicker_OnSecuritySelected" ShowCommonStatColumns="True" />
|
||||
|
||||
<StackPanel Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button x:Name="Quotes" Content="{x:Static loc:LocalizedStrings.XamlStr40}" Width="100" IsEnabled="False" Click="QuotesClick" />
|
||||
<Button x:Name="Depth" Width="100" IsEnabled="False" Click="DepthClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.MarketDepth}" />...</TextBlock>
|
||||
</Button>
|
||||
<Button x:Name="NewOrder" Width="100" IsEnabled="False" Click="NewOrderClick">
|
||||
<TextBlock><Run Text="{x:Static loc:LocalizedStrings.NewOrder}" />...</TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,126 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
using Ecng.Collections;
|
||||
using Ecng.Xaml;
|
||||
|
||||
using MoreLinq;
|
||||
|
||||
using StockSharp.BusinessEntities;
|
||||
using StockSharp.Xaml;
|
||||
using StockSharp.Localization;
|
||||
|
||||
public partial class SecuritiesWindow
|
||||
{
|
||||
private readonly SynchronizedDictionary<Security, QuotesWindow> _quotesWindows = new SynchronizedDictionary<Security, QuotesWindow>();
|
||||
private bool _initialized;
|
||||
|
||||
public SecuritiesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
_quotesWindows.SyncDo(d => d.Values.ForEach(w =>
|
||||
{
|
||||
w.DeleteHideable();
|
||||
w.Close();
|
||||
}));
|
||||
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
if (trader != null)
|
||||
{
|
||||
if (_initialized)
|
||||
trader.MarketDepthChanged -= TraderOnMarketDepthChanged;
|
||||
}
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void SecurityPicker_OnSecuritySelected(Security security)
|
||||
{
|
||||
Quotes.IsEnabled = NewOrder.IsEnabled = Depth.IsEnabled = security != null;
|
||||
}
|
||||
|
||||
private void NewOrderClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var newOrder = new OrderWindow
|
||||
{
|
||||
Order = new Order { Security = SecurityPicker.SelectedSecurity },
|
||||
SecurityProvider = MainWindow.Instance.Trader,
|
||||
MarketDataProvider = MainWindow.Instance.Trader,
|
||||
Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
|
||||
};
|
||||
|
||||
if (newOrder.ShowModal(this))
|
||||
MainWindow.Instance.Trader.RegisterOrder(newOrder.Order);
|
||||
}
|
||||
|
||||
private void DepthClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
var window = _quotesWindows.SafeAdd(security, s =>
|
||||
{
|
||||
// начинаем получать котировки стакана
|
||||
trader.RegisterMarketDepth(security);
|
||||
|
||||
// создаем окно со стаканом
|
||||
var wnd = new QuotesWindow
|
||||
{
|
||||
Title = security.Id + " " + LocalizedStrings.MarketDepth
|
||||
};
|
||||
wnd.MakeHideable();
|
||||
return wnd;
|
||||
});
|
||||
|
||||
if (window.Visibility == Visibility.Visible)
|
||||
window.Hide();
|
||||
else
|
||||
{
|
||||
window.Show();
|
||||
window.DepthCtrl.UpdateDepth(trader.GetMarketDepth(security));
|
||||
}
|
||||
|
||||
if (!_initialized)
|
||||
{
|
||||
trader.MarketDepthChanged += TraderOnMarketDepthChanged;
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void QuotesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var trader = MainWindow.Instance.Trader;
|
||||
|
||||
foreach (var security in SecurityPicker.SelectedSecurities)
|
||||
{
|
||||
if (trader.RegisteredSecurities.Contains(security))
|
||||
{
|
||||
trader.UnRegisterSecurity(security);
|
||||
trader.UnRegisterTrades(security);
|
||||
}
|
||||
else
|
||||
{
|
||||
trader.RegisterSecurity(security);
|
||||
trader.RegisterTrades(security);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TraderOnMarketDepthChanged(MarketDepth depth)
|
||||
{
|
||||
var wnd = _quotesWindows.TryGetValue(depth.Security);
|
||||
|
||||
if (wnd != null)
|
||||
wnd.DepthCtrl.UpdateDepth(depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Window x:Class="SampleCoinbase.TradesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"␍ xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
|
||||
xmlns:xaml="http://schemas.stocksharp.com/xaml"
|
||||
Title="{x:Static loc:LocalizedStrings.Str985}" Height="284" Width="530">
|
||||
<xaml:TradeGrid x:Name="TradeGrid" x:FieldModifier="public" />
|
||||
</Window>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SampleCoinbase
|
||||
{
|
||||
public partial class TradesWindow
|
||||
{
|
||||
public TradesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
|
||||
Loaded 100 of 250 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user