Ref: Oanda.
I have used the function _connector.SubscribeMarketDepth(security); and its still does not work. It does not show the price of the currency see code below.
I have clicked on the currency, and the price do not show.
This is really frustrating, both the lesson video and documentation is lacking.
Please send a working code for the first lesson video.
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.Connected += this.Connector_Connected;
_connector.Connect();
}
private void Connector_Connected()
{
_connector.LookupSecurities(new Security() { Code = "USD/JPY" });
}
private void SecurityPicker_SecuritySelected(Security security)
{
if (security == null) return;
_connector.SubscribeMarketDepth(security);
}
}