Exemplo n.º 1
0
        public void InstanceToString()
        {
            var value = new FixProtocolVersion("xxx", 4, 17);
            var st    = value.ToString();

            Assert.IsTrue("xxx.4.17" == st);
        }
Exemplo n.º 2
0
        public void ParseCorrectString()
        {
            var protocol = new FixProtocolVersion("ext.1.2");

            Assert.IsTrue("ext" == protocol.Type);
            Assert.IsTrue(1 == protocol.MajorVersion);
            Assert.IsTrue(2 == protocol.MinorVersion);
        }
Exemplo n.º 3
0
        public SymbolInfo[] Symbols(FixProtocolVersion protocolVersion)
        {
            var symbols = Native.Converter.SymbolsFromHandle(this.Data);

            foreach (var symbol in symbols)
            {
                symbol.ProtocolVersion = protocolVersion;
            }

            return symbols;
        }
Exemplo n.º 4
0
        public SymbolInfo[] Symbols(FixProtocolVersion protocolVersion)
        {
            var symbols = Native.Converter.SymbolsFromHandle(this.Data);

            foreach (var symbol in symbols)
            {
                symbol.ProtocolVersion = protocolVersion;
            }

            return(symbols);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a new instance of SymbolInfoFeatures
        /// </summary>
        /// <param name="protocolVersion">A protocol version; can not be null.</param>
        /// <param name="provider"></param>
        /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
        /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
        public SymbolInfoFeatures(FixProtocolVersion protocolVersion, SymbolInfoFeaturesProvider provider)
        {
            if (protocolVersion == null)
                throw new ArgumentNullException(nameof(protocolVersion));

            if (provider == null)
                throw new ArgumentNullException(nameof(provider));

            this.protocolVersion = protocolVersion;
            this.provider = provider;
        }
Exemplo n.º 6
0
        public SymbolInfo[] GetSymbols(int timeoutInMilliseconds)
        {
            this.VerifyInitialized();

            var symbols = Native.FeedServer.GetSymbols(this.handle, (uint)timeoutInMilliseconds);
            var protocolVersion = new FixProtocolVersion(this.DataClient.ProtocolVersion);

            foreach (var symbol in symbols)
            {
                symbol.ProtocolVersion = protocolVersion;
            }

            return symbols;
        }
Exemplo n.º 7
0
        public              SymbolInfo[] GetSymbols(int timeoutInMilliseconds)
        {
            this.VerifyInitialized();

            var symbols         = Native.FeedServer.GetSymbols(this.handle, (uint)timeoutInMilliseconds);
            var protocolVersion = new FixProtocolVersion(this.DataClient.ProtocolVersion);

            foreach (var symbol in symbols)
            {
                symbol.ProtocolVersion = protocolVersion;
            }

            return(symbols);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Creates a new instance of SymbolInfoFeatures
        /// </summary>
        /// <param name="protocolVersion">A protocol version; can not be null.</param>
        /// <param name="provider"></param>
        /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
        /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
        public SymbolInfoFeatures(FixProtocolVersion protocolVersion, SymbolInfoFeaturesProvider provider)
        {
            if (protocolVersion == null)
            {
                throw new ArgumentNullException(nameof(protocolVersion));
            }

            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            this.protocolVersion = protocolVersion;
            this.provider        = provider;
        }
Exemplo n.º 9
0
        static FixConnectionStringBuilder CreateFixConnectionStringBuilder(AccountType type, FixProtocolVersion protocolVersion)
        {
            var result = new FixConnectionStringBuilder
            {
                FixVersion = "FIX.4.4",
                Address = "ttdemo.fxopen.com",
                TargetCompId = "EXECUTOR"
            };

            if (type == AccountType.Gross)
            {
                result.Username = "******";
                result.Password = "******";
            }
            else if (type == AccountType.Net)
            {
                result.Username = "******";
                result.Password = "******";
            }
            else if (type == AccountType.Cash)
            {
                result.Address = "crypto.ttdemo.fxopen.com";
                result.Username = "******";
                result.Password = "******";
            }

            
            result.ProtocolVersion = protocolVersion.ToString();

#if DEBUG
            result.DecodeLogFixMessages = true;
            result.FixLogDirectory = @"C:\Temporary\Logs";
#endif

            return result;
        }
Exemplo n.º 10
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'MarginFactor' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsMarginFactorSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 11
0
        static FixConnectionStringBuilder CreateFixConnectionStringBuilder(AccountType type, FixProtocolVersion protocolVersion)
        {
            var result = new FixConnectionStringBuilder
            {
                FixVersion   = "FIX.4.4",
                Address      = "ttdemo.fxopen.com",
                TargetCompId = "EXECUTOR"
            };

            if (type == AccountType.Gross)
            {
                result.Username = "******";
                result.Password = "******";
            }
            else if (type == AccountType.Net)
            {
                result.Username = "******";
                result.Password = "******";
            }
            else if (type == AccountType.Cash)
            {
                result.Address  = "crypto.ttdemo.fxopen.com";
                result.Username = "******";
                result.Password = "******";
            }


            result.ProtocolVersion = protocolVersion.ToString();

#if DEBUG
            result.DecodeLogFixMessages = true;
            result.FixLogDirectory      = @"C:\Temporary\Logs";
#endif

            return(result);
        }
Exemplo n.º 12
0
        public void StaticToString()
        {
            var st = FixProtocolVersion.ToString("xxx", 5, 12);

            Assert.IsTrue("xxx.5.12" == st);
        }
Exemplo n.º 13
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'RoundLot' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsRoundLotSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'SettlementCurrency' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsSettlementCurrencySupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'MinCommissionCurrency' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsMinCommissionCurrencySupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version57);
 }
Exemplo n.º 16
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'Commission' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsCommissionSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version15);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'CommissionChargeMethod' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsCommissionChargeMethodSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version25);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'Color' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsColorSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolColorExtending);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'ContractMultiplier' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsContractMultiplierSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Initial);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'MarginFactorFractional' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsMarginFactorFractionalSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version20);
 }
Exemplo n.º 21
0
 internal bool IsCurrencySortOrderSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version20);
 }
Exemplo n.º 22
0
 internal bool IsCurrencyPrecisionSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version23);
 }
Exemplo n.º 23
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'Name' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsNameSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Initial);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'Precision' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsPrecisionSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 25
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'SwapType' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsSwapTypeSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version57);
 }
Exemplo n.º 26
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'MaxTradeVolume' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsMaxTradeVolumeSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 27
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'TripleSwapDay' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsTripleSwapDaySupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version57);
 }
Exemplo n.º 28
0
 public void InstanceToString()
 {
     var value = new FixProtocolVersion("xxx", 4, 17);
     var st = value.ToString();
     Assert.IsTrue("xxx.4.17" == st);
 }
Exemplo n.º 29
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'ProfitCalcMode' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsProfitCalcModeSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.SymbolExtending);
 }
Exemplo n.º 30
0
 internal unsafe SymbolInfoEventArgs(FxMessage message, string usedProtocolVersion)
 {
     var protocolVersion = new FixProtocolVersion(usedProtocolVersion);
     this.Information = message.Symbols(protocolVersion);
 }
Exemplo n.º 31
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'TradeEnabled' property, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsIsTradeEnabledSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version16);
 }
Exemplo n.º 32
0
        internal unsafe SymbolInfoEventArgs(FxMessage message, string usedProtocolVersion)
        {
            var protocolVersion = new FixProtocolVersion(usedProtocolVersion);

            this.Information = message.Symbols(protocolVersion);
        }
Exemplo n.º 33
0
 internal bool IsSortOrderSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version18);
 }
Exemplo n.º 34
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'SwapSizeShort' and 'SwapSizeLong' properties, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsSwapSizeSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version15);
 }
Exemplo n.º 35
0
 /// <summary>
 /// Create a new SymbolInfoFeatures instance for a specified version.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public SymbolInfoFeatures GetInfo(FixProtocolVersion protocolVersion)
 {
     return(new SymbolInfoFeatures(protocolVersion, this));
 }
Exemplo n.º 36
0
 public void ParseCorrectString()
 {
     var protocol = new FixProtocolVersion("ext.1.2");
     Assert.IsTrue("ext" == protocol.Type);
     Assert.IsTrue(1 == protocol.MajorVersion);
     Assert.IsTrue(2 == protocol.MinorVersion);
 }
Exemplo n.º 37
0
 /// <summary>
 /// Returns true, if a protocol version of symbol info supports 'DefaultSlippage' properties, otherwise false.
 /// </summary>
 /// <exception cref="System.ArgumentNullException">If protocol version is null.</exception>
 /// <exception cref="System.ArgumentException">If an input protocol version is unknown.</exception>
 /// <returns>True, if the corresponding property or method is supported for a protocol version, otherwise false.</returns>
 public bool IsDefaultSlippageSupported(FixProtocolVersion protocolVersion)
 {
     return(protocolVersion >= FixProtocolVersion.Version36);
 }