using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using StockSharp.Quik;
using StockSharp.Algo;
using StockSharp.BusinessEntities;
using StockSharp.Localization;
using StockSharp.Logging;
using StockSharp.Messages;
using MoreLinq;
using Ecng.Common;
using Ecng.Xaml;
using Ecng.ComponentModel;
using System.Security;
using System.Net;
namespace WpfApplication1
{
///
/// Логика взаимодействия для MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
QuikTrader connect;
private void button_Click(object sender, RoutedEventArgs e)
{
connect = new QuikTrader()
{
LuaLogin = "quik",
LuaPassword = "quik".To(),
LuaFixServerAddress = "127,0,0,1:5001".To()
};
connect.Connected += () =>
{
Console.WriteLine("Подключено");
//textBlock.Text = "Подк";
};
connect.ConnectionError += ex =>
{
Console.WriteLine("Ошибка" + ex.ToString());
// textBlock.Text = "Ошибка";
};
connect.Disconnected += () =>
{
Console.WriteLine("Отключено");
//textBlock.Text = "От";
};
connect.TimeOut += () =>
{
Console.WriteLine("Истекло время ожидания");
//textBlock.Text = "и";
};
connect.NewPortfolios += portfolios => this.GuiAsync(() =>//подписываемя на событие получения нового портфеля
//
{
comboBox.ItemsSource = connect.Portfolios;
});
connect.NewSecurities += Securities => this.GuiAsync(() =>
{
comboBox1.ItemsSource = connect.Securities;
});
connect.Connect();
}
}
}