Проблемы подключения к Hydra через Fix

Проблемы подключения к Hydra через Fix
Atom
11/28/2017
Иван З.


Hydra со всеми обновлениями.

  1. Не приходят инструменты при Trader.LookupSecurities(new Security()); Подключение есть. У Гидры в логах пишет предупреждение Security is not specified. Ошибок нет. С пол года назад все работало. [spoiler] S#.Data (Hydra) 11/28/2017 7:41:41 PM +10:00 Info S#.Data (Hydra) v4.4.0.0 FixServer 11/28/2017 7:41:52 PM +10:00 Info Server 0.0.0.0:5002 started. FixServer 11/28/2017 7:41:52 PM +10:00 Info FixServer started. FixServer 11/28/2017 7:41:52 PM +10:00 Info FixServer outgoing thread started. FixServer 11/28/2017 7:42:26 PM +10:00 Info Connected '127.0.0.1:58502' to '0.0.0.0:5002'. FixServer 11/28/2017 7:42:26 PM +10:00 Info Received first byte from '127.0.0.1:58502'. FixServer 11/28/2017 7:42:26 PM +10:00 Info From : Logon FixServer 11/28/2017 7:42:26 PM +10:00 Info Client hydra_user (127.0.0.1:58502) authorized. FixServer 11/28/2017 7:42:28 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 7:42:28 PM +10:00 Info Session started. FixServer 11/28/2017 7:42:30 PM +10:00 Info From hydra_user 127.0.0.1:58502: SecurityListRequest FixServer 11/28/2017 7:42:30 PM +10:00 Info From hydra_user 127.0.0.1:58502: OrderMassStatusRequest FixServer 11/28/2017 7:42:30 PM +10:00 Info From hydra_user 127.0.0.1:58502: SecurityListRequest FixServer 11/28/2017 7:42:30 PM +10:00 Warning Security is not specified. [/spoiler]
  2. После Trader.Disconnect(); Повторно подключится к гидре не удается, в Trader.ConnectionError приходит следующая ошибка.

Connection process was interrupted because of an unexpected disconnection. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.

[spoiler] S#.Data (Hydra) 11/28/2017 7:52:38 PM +10:00 Info S#.Data (Hydra) v4.4.2.0 FixServer 11/28/2017 7:52:51 PM +10:00 Info Server 0.0.0.0:5002 started. FixServer 11/28/2017 7:52:51 PM +10:00 Info FixServer started. FixServer 11/28/2017 7:52:51 PM +10:00 Info FixServer outgoing thread started. FixServer 11/28/2017 7:53:06 PM +10:00 Info Connected '127.0.0.1:59518' to '0.0.0.0:5002'. FixServer 11/28/2017 7:53:06 PM +10:00 Info Received first byte from '127.0.0.1:59518'. FixServer 11/28/2017 7:53:06 PM +10:00 Info Connected '127.0.0.1:59519' to '0.0.0.0:5002'. FixServer 11/28/2017 7:53:06 PM +10:00 Info Received first byte from '127.0.0.1:59519'. FixServer 11/28/2017 7:53:06 PM +10:00 Info From : Logon FixServer 11/28/2017 7:53:06 PM +10:00 Info From : Logon FixServer 11/28/2017 7:53:06 PM +10:00 Info Client hydra_user (127.0.0.1:59519) authorized. FixServer 11/28/2017 7:53:06 PM +10:00 Info Client hydra_user (127.0.0.1:59518) authorized. FixServer 11/28/2017 7:53:08 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 7:53:08 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 7:53:08 PM +10:00 Info Session started. FixServer 11/28/2017 7:53:08 PM +10:00 Info Session started. FixServer 11/28/2017 7:53:08 PM +10:00 Info From hydra_user 127.0.0.1:59519: SecurityListRequest FixServer 11/28/2017 7:53:08 PM +10:00 Info From hydra_user 127.0.0.1:59518: OrderMassStatusRequest FixServer 11/28/2017 7:53:08 PM +10:00 Warning Security is not specified. FixServer 11/28/2017 7:53:17 PM +10:00 Info From hydra_user 127.0.0.1:59518: Logout FixServer 11/28/2017 7:53:17 PM +10:00 Info From hydra_user 127.0.0.1:59519: Logout FixServer 11/28/2017 7:53:17 PM +10:00 Info Disconnect hydra_user (127.0.0.1:59518) FixServer 11/28/2017 7:53:17 PM +10:00 Info Disconnect hydra_user (127.0.0.1:59519) FixServer 11/28/2017 7:53:36 PM +10:00 Info Connected '127.0.0.1:59563' to '0.0.0.0:5002'. FixServer 11/28/2017 7:53:36 PM +10:00 Info Received first byte from '127.0.0.1:59563'. FixServer 11/28/2017 7:53:36 PM +10:00 Info From : Logon FixServer 11/28/2017 7:53:36 PM +10:00 Info Client hydra_user (127.0.0.1:59563) authorized. FixServer 11/28/2017 7:53:36 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 7:53:36 PM +10:00 Info Session started. FixServer 11/28/2017 7:53:36 PM +10:00 Info Connected '127.0.0.1:59564' to '0.0.0.0:5002'. FixServer 11/28/2017 7:53:36 PM +10:00 Info Received first byte from '127.0.0.1:59564'. FixServer 11/28/2017 7:53:36 PM +10:00 Info From : Logon FixServer 11/28/2017 7:53:36 PM +10:00 Info Client hydra_user (127.0.0.1:59564) authorized. FixServer 11/28/2017 7:53:36 PM +10:00 Info Disconnect hydra_user (127.0.0.1:59563) FixServer 11/28/2017 7:53:36 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 7:53:36 PM +10:00 Info Session started. FixServer 11/28/2017 7:53:36 PM +10:00 Error System.IO.IOException: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. ---> System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at Ecng.Serialization.BinaryHelper.ReadBytes(Stream stream, Byte[] buffer, Int32 len, Int32 pos) at StockSharp.Fix.Native.BaseFixReader.ReadByte() at StockSharp.Fix.Native.TextFixReader.ReadTag() at #=qECbQYrnCUhCERgXSneZKcsfqD7iSLMz3vhOhKJvt5pUZjAjcYhJzkzDN7URjtcPz.#=qK5MIUfS2gj4q$9kVDfLA6w==(IFixReader #=qP2e$994s2t_hrClE4jL2xw==, FixTags #=q$Mgx84yaYFY$VGlSefJEcg==) at #=qECbQYrnCUhCERgXSneZKcsfqD7iSLMz3vhOhKJvt5pUZjAjcYhJzkzDN7URjtcPz.#=qnQz65V1hSjv7Za4Hu6Nvtw==(IFixReader #=qP2e$994s2t_hrClE4jL2xw==, Boolean #=qrWSUPqUkhs9_5vYvQLxXllpJ3N7fWgp$f$nXIUfbOMI=, String #=qVAZasEIKImPf_tmVsmAv0t6CLQQ5nU2gPAaUqmSK2wk=) at StockSharp.Fix.FixServer.#=q2oyo7MU$2AxjJdNknh2rVQ==(IFixReader #=qP2e$994s2t_hrClE4jL2xw==, FixSession[] #=qzsL33j8BZAesfcdiGtibxw==, #=qENMrL9OvFG4yJ5oX$GQk4sUdqp32hSd4iKkZMCc44ZfZ02p_Nxww2SAnTPN5Votu& #=qJWPLcnjelO$jE$im53AK9g==, TcpClient #=q2noQdgv3H4k_vOEqIWSB6w==, EndPoint #=qc8B1ratO37irYZ3U9HNS6w==, String& #=qhhxyp7GJm3H2m7cyE7N4yQ==, Boolean& #=qYM_AMtaiN2bvAMgxnwWRow==) at StockSharp.Fix.FixServer.#=qPtKoq0t9t$3urUjq81dORPJNiMhhUvRYsxQHJbOPBFg=.#=q9foryVv8CbzoZJ16TJbpUA==(IAsyncResult #=qRmghNt46RgH54v0HlSGj4A==) FixServer 11/28/2017 7:53:36 PM +10:00 Info Disconnect hydra_user (127.0.0.1:59563) FixServer 11/28/2017 7:53:36 PM +10:00 Info From hydra_user 127.0.0.1:59564: SecurityListRequest

[/spoiler] Приходится перезагружать гидру




Thanks:


Support

Avatar
Date: 11/28/2017
Reply


Нужно прописать trader.TransactionAdapter.RemoveTransactionalSupport(); тогда транзакционный адаптер будет пустым. или его полностью удалить из trader.Adapter

Thanks:

Иван З.

Avatar
Date: 11/28/2017
Reply


[quote=Support;41846]Нужно прописать trader.TransactionAdapter.RemoveTransactionalSupport(); тогда транзакционный адаптер будет пустым. или его полностью удалить из trader.Adapter[/quote]

Сделал так [code] Trader.Adapter.InnerAdapters.ForEach(a => a.RemoveTransactionalSupport()); [/code] Ошибок нет. Warning Security is not specified теперь не пишет. В гидре пишет так [spoiler] S#.Data (Hydra) 11/28/2017 10:12:57 PM +10:00 Info S#.Data (Hydra) v4.4.2.0 FixServer 11/28/2017 10:13:08 PM +10:00 Info Server 0.0.0.0:5002 started. FixServer 11/28/2017 10:13:08 PM +10:00 Info FixServer started. FixServer 11/28/2017 10:13:08 PM +10:00 Info FixServer outgoing thread started. FixServer 11/28/2017 10:13:25 PM +10:00 Info Connected '127.0.0.1:56400' to '0.0.0.0:5002'. FixServer 11/28/2017 10:13:26 PM +10:00 Info Received first byte from '127.0.0.1:56400'. FixServer 11/28/2017 10:13:26 PM +10:00 Info Connected '127.0.0.1:56401' to '0.0.0.0:5002'. FixServer 11/28/2017 10:13:26 PM +10:00 Info Received first byte from '127.0.0.1:56401'. FixServer 11/28/2017 10:13:26 PM +10:00 Info From : Logon FixServer 11/28/2017 10:13:26 PM +10:00 Info From : Logon FixServer 11/28/2017 10:13:26 PM +10:00 Info Client hydra_user (127.0.0.1:56400) authorized. FixServer 11/28/2017 10:13:26 PM +10:00 Info Client hydra_user (127.0.0.1:56401) authorized. FixServer 11/28/2017 10:13:28 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 10:13:28 PM +10:00 Info Sending Logon to client. FixServer 11/28/2017 10:13:28 PM +10:00 Info Session started. FixServer 11/28/2017 10:13:28 PM +10:00 Info Session started. FixServer 11/28/2017 10:13:28 PM +10:00 Info From hydra_user 127.0.0.1:56401: SecurityListRequest FixServer 11/28/2017 10:14:25 PM +10:00 Info From hydra_user 127.0.0.1:56400: TestRequest FixServer 11/28/2017 10:14:26 PM +10:00 Info From hydra_user 127.0.0.1:56401: TestRequest FixServer 11/28/2017 10:15:25 PM +10:00 Info From hydra_user 127.0.0.1:56400: TestRequest FixServer 11/28/2017 10:15:26 PM +10:00 Info From hydra_user 127.0.0.1:56401: TestRequest FixServer 11/28/2017 10:16:26 PM +10:00 Info From hydra_user 127.0.0.1:56400: TestRequest FixServer 11/28/2017 10:16:26 PM +10:00 Info From hydra_user 127.0.0.1:56401: TestRequest FixServer 11/28/2017 10:17:26 PM +10:00 Info From hydra_user 127.0.0.1:56400: TestRequest FixServer 11/28/2017 10:17:26 PM +10:00 Info From hydra_user 127.0.0.1:56401: TestRequest [/spoiler] Попробовал из стандартного окна настроить коннектор. [img=105345]image9361.png[/img] Но инструменты так и не приходят.

image9361.png 28 KB (969)
Thanks:

Support

Avatar
Date: 11/28/2017
Reply


А инструменты есть в Гидре?

Попробуйте конкретизировать критерий поиска. Например, указать маску через Security.Code

Thanks:

Иван З.

Avatar
Date: 11/28/2017
Reply


[quote=Support;41849]А инструменты есть в Гидре?

Попробуйте конкретизировать критерий поиска. Например, указать маску через Security.Code[/quote] Инструменты есть [img=105346]image6312.png[/img] Пробовал Code и Id разных инструментов Может еще что то надо? [spoiler] [code=C#] using Ecng.Serialization; using StockSharp.Algo; using StockSharp.Algo.Candles; using StockSharp.Algo.Storages; using StockSharp.Algo.Storages.Csv; using StockSharp.BusinessEntities; using StockSharp.Configuration; using StockSharp.Xaml.Charting; 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; using MoreLinq; using StockSharp.Messages;

namespace HydraFIX { ///

/// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public Connector _connector = new Connector(); Security _security;

    string ConnectorFile = "ConnectorFile";
    public MainWindow()
    {
        InitializeComponent();

        if (File.Exists(ConnectorFile))
        {
            _connector.Load(new XmlSerializer<SettingsStorage>().Deserialize(ConnectorFile));
        }
    }

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

    private void Start_Click(object sender, RoutedEventArgs e)
    {

       //SecurityPicker.SecurityProvider = _connector;
       //SecurityPicker.MarketDataProvider = _connector;

        _connector.Adapter.InnerAdapters.ForEach(a => a.RemoveTransactionalSupport());


        _connector.Connected += _connector_Connected;
        _connector.NewSecurity += _connector_NewSecurity;
        _connector.Connect();
    }

    private void _connector_NewSecurity(Security obj)
    {
        //Здесь никогда не появляется
    }

    private void _connector_Connected()
    {
        _connector.LookupSecurities(new Security());
        //_connector.LookupSecurities(new Security() { Code = "SBER" }); // Так пробовал
        //_connector.LookupSecurities(new Security() { Id = "SBER@TQBR" });// Так пробовал
    }
}

} [/code] [/spoiler]

image6312.png 14 KB (1054)
Thanks:


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

loading
clippy