S#

Interactive Brokers TWS connection not working


Interactive Brokers TWS connection not working
Atom Reply
1/13/2020


Hello, I tried to follow this video (https://stocksharp.com/forum/10058/Lesson-1-The-first-connection-creating/), I did exactly every step like the video but the securities never showed up, I'm uploading a video for you to see.

Thanks



Thanks:




3 Answers
Support

Avatar
Date: 1/16/2020
Reply


Thank you for your question.

IB connection does not provide automatic instruments downloading. In that case, from the app, you need to send searching requests via Connector.LookupSecurities. All found instruments will be provided via Connector.NewSecurity or Connector.LookupSecuritiyFinished events.

On our environment, the lesson shows AAPL instruments

4cc0d011bfcfb4f5e6a05fa279f3ba8d.png

Can you provide the link from where you have downloaded the materials?

PS We updated your support plus 1 week for the answer days reason.
Thanks:

isaacapuano

Avatar
Training
Date: 1/17/2020
Reply


I downloaded the materials from here, https://github.com/StockSharp/StockSharp/releases.

I'm not sure how to do the search request, in the video on minute 14 Yury clicks on the securities and starts to recieve information. I tried once more but got the same result, im just writing the code I see in the video.

here is my code
Код

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StockSharp"
xmlns:Custom="http://schemas.stocksharp.com/xaml" x:Class="StockSharp.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="660" Width="900" Left="50" Top="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="130*"/>
<ColumnDefinition Width="130*"/>
<ColumnDefinition Width="504*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="35*"/>
<RowDefinition Height="594*"/>
</Grid.RowDefinitions>
<Button Content="Setting" Name="Setting" Click="Setting_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Width="152" Height="35"/>
<Button Content="Connect" Name="Connect" Click="Connect_Click" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="152" Height="35"/>

<Custom:SecurityPicker Name="SecurityPicker" ShowCommonStatColumns="True" Grid.ColumnSpan="3" HorizontalAlignment="Left" Height="594" Grid.Row="1" VerticalAlignment="Top" Width="892"/>

</Grid>
</Window>


Код

using Ecng.Serialization;
using StockSharp.Algo;
using StockSharp.BusinessEntities;
using StockSharp.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
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;

namespace StockSharp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Connector _connector = new Connector();
private string _connectFile = "ConnectFile";

public MainWindow()
{
InitializeComponent();
if (File.Exists(_connectFile))
{
_connector.Load(new XmlSerializer<SettingsStorage>().Deserialize(_connectFile));
}
}

private void Setting_Click(object sender, RoutedEventArgs e)
{
if (_connector.Configure(this))
{
new XmlSerializer<SettingsStorage>().Serialize(_connector.Save(), _connectFile);
}
}

private void Connect_Click(object sender, RoutedEventArgs e)
{
SecurityPicker.SecurityProvider = _connector;
SecurityPicker.MarketDataProvider = _connector;
_connector.Connect();
}
private void SecurityPicker_SecuritySelected(Security security)
{
if (security == null) return;
_connector.RegisterSecurity(security);
}
}
}


Topic starter
Thanks:

Support

Avatar
Date: 1/17/2020
Reply


isaacapuano Go to
I downloaded the materials from here, https://github.com/StockSharp/StockSharp/releases.


Please the following links (any, not all)

1) https://stocksharp.com/f...ckSharp-training-course/ (edu materials)
2) https://stocksharp.com/products/download/ (Night build link) (public samples only)

Currently, the official release contains 4.4.16 version. This version is out of date and we recommend use 4.4.17 (many fixes and improvements).
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy