Exemplo n.º 1
0
		public static void WriteBarArray(this MemoryBuffer buffer, LrpServer.Net.LrpBar[] arg)
		{
			buffer.WriteInt32(arg.Length);
			foreach(var element in arg)
			{
				buffer.WriteBar(element);
			}
		}
Exemplo n.º 2
0
		public static void WriteBar(this MemoryBuffer buffer, LrpServer.Net.LrpBar arg)
		{
			buffer.WriteDouble(arg.Open);
			buffer.WriteDouble(arg.Close);
			buffer.WriteDouble(arg.High);
			buffer.WriteDouble(arg.Low);
			buffer.WriteDouble(arg.Volume);
			buffer.WriteTime(arg.From);
		}
Exemplo n.º 3
0
		public static void WriteDataHistoryRequest(this MemoryBuffer buffer, LrpServer.Net.LrpDataHistoryRequest arg)
		{
			buffer.WriteAString(arg.Symbol);
			buffer.WriteTime(arg.Time);
			buffer.WriteInt32(arg.BarsNumber);
			buffer.WriteInt32(arg.PriceType);
			buffer.WriteAString(arg.GraphPeriod);
			buffer.WriteInt32(arg.ReportType);
			buffer.WriteInt32(arg.GraphType);
		}
Exemplo n.º 4
0
		public SoftFX.Lrp.LPtr Constructor(LrpServer.Net.LrpParams parameters)
		{
			using(MemoryBuffer buffer = m_client.Create())
			{
				buffer.WriteLrpParams(parameters);

				int _status = m_client.Invoke(2, 0, buffer);
				TypesSerializer.Throw(_status, buffer);

				var _result = buffer.ReadLocalPointer();
				return _result;
			}
		}
Exemplo n.º 5
0
		public static void WriteQuoteEntry(this MemoryBuffer buffer, LrpServer.Net.LrpQuoteEntry arg)
		{
			buffer.WriteDouble(arg.Price);
			buffer.WriteDouble(arg.Volume);
		}
Exemplo n.º 6
0
		public static void WriteCurrencyInfo(this MemoryBuffer buffer, LrpServer.Net.LrpCurrencyInfo arg)
		{
			buffer.WriteAString(arg.Name);
			buffer.WriteAString(arg.Description);
			buffer.WriteInt32(arg.SortOrder);
			buffer.WriteInt32(arg.Precision);
		}
Exemplo n.º 7
0
		public static void WriteCurrencyInfoArray(this MemoryBuffer buffer, LrpServer.Net.LrpCurrencyInfo[] arg)
		{
			buffer.WriteInt32(arg.Length);
			foreach(var element in arg)
			{
				buffer.WriteCurrencyInfo(element);
			}
		}
Exemplo n.º 8
0
		public void SendSessionInfo(long id, string requestId, LrpServer.Net.LrpSessionInfo sessionInfo)
		{
			this.Instance.SendSessionInfo(this.Handle, id, requestId, sessionInfo);
		}
Exemplo n.º 9
0
		public static void WriteSymbolInfo(this MemoryBuffer buffer, LrpServer.Net.LrpSymbolInfo arg)
		{
			buffer.WriteAString(arg.Name);
			buffer.WriteAString(arg.Currency);
			buffer.WriteAString(arg.SettlementCurrency);
			buffer.WriteDouble(arg.ContractMultiplier);
			buffer.WriteInt32(arg.Precision);
			buffer.WriteDouble(arg.RoundLot);
			buffer.WriteDouble(arg.MinTradeVolume);
			buffer.WriteDouble(arg.MaxTradeVolume);
			buffer.WriteDouble(arg.TradeVolumeStep);
			buffer.WriteProfitCalcMode(arg.ProfitCalcMode);
			buffer.WriteMarginCalcMode(arg.MarginCalcMode);
			buffer.WriteDouble(arg.MarginHedge);
			buffer.WriteInt32(arg.MarginFactor);
			buffer.WriteNullDouble(arg.MarginFactorFractional);
			buffer.WriteInt32(arg.Color);
			buffer.WriteCommissionType(arg.CommissionType);
			buffer.WriteCommissionChargeType(arg.CommissionChargeType);
			buffer.WriteCommissionChargeMethod(arg.CommissionChargeMethod);
			buffer.WriteDouble(arg.LimitsCommission);
			buffer.WriteDouble(arg.Commission);
			buffer.WriteNullDouble(arg.SwapSizeShort);
			buffer.WriteNullDouble(arg.SwapSizeLong);
			buffer.WriteBoolean(arg.IsTradeEnabled);
			buffer.WriteInt32(arg.GroupSortOrder);
			buffer.WriteInt32(arg.SortOrder);
			buffer.WriteInt32(arg.CurrencySortOrder);
			buffer.WriteInt32(arg.SettlementCurrencySortOrder);
			buffer.WriteInt32(arg.CurrencyPrecision);
			buffer.WriteInt32(arg.SettlementCurrencyPrecision);
		}
Exemplo n.º 10
0
		public static void WriteMarginCalcMode(this MemoryBuffer buffer, LrpServer.Net.LrpMarginCalcMode arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 11
0
		public static void WriteCommissionType(this MemoryBuffer buffer, LrpServer.Net.LrpCommissionType arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 12
0
		public static void WriteDataHistoryResponse(this MemoryBuffer buffer, LrpServer.Net.LrpDataHistoryResponse arg)
		{
			buffer.WriteTime(arg.FromAll);
			buffer.WriteTime(arg.ToAll);
			buffer.WriteTime(arg.From);
			buffer.WriteTime(arg.To);
			buffer.WriteAString(arg.LastTickId);
			buffer.WriteBarArray(arg.Bars);
			buffer.WriteAStringArray(arg.Files);
		}
Exemplo n.º 13
0
		public static void WriteLrpParams(this MemoryBuffer buffer, LrpServer.Net.LrpParams arg)
		{
			buffer.WriteBoolean(arg.EnableCodec);
			buffer.WriteBoolean(arg.ValidateCodec);
			buffer.WriteInt32(arg.ThreadsNumber);
			buffer.WriteInt32(arg.MessagesNumberLimit);
			buffer.WriteInt32(arg.MessagesSizeLimit);
			buffer.WriteInt32(arg.HandshakeTimeout);
			buffer.WriteInt32(arg.HeartbeatTimeout);
			buffer.WriteAString(arg.LogPath);
		}
Exemplo n.º 14
0
		public void SendCurrenciesInfo(long id, string requestId, LrpServer.Net.LrpCurrencyInfo[] currencies)
		{
			this.Instance.SendCurrenciesInfo(this.Handle, id, requestId, currencies);
		}
Exemplo n.º 15
0
		public static void WriteQuoteEntryArray(this MemoryBuffer buffer, LrpServer.Net.LrpQuoteEntry[] arg)
		{
			buffer.WriteInt32(arg.Length);
			foreach(var element in arg)
			{
				buffer.WriteQuoteEntry(element);
			}
		}
Exemplo n.º 16
0
		public void SendSymbolsInfo(long id, string requestId, LrpServer.Net.LrpSymbolInfo[] symbols)
		{
			this.Instance.SendSymbolsInfo(this.Handle, id, requestId, symbols);
		}
Exemplo n.º 17
0
		public void SendNotification(long id, LrpServer.Net.LrpNotification notification)
		{
			this.Instance.SendNotification(this.Handle, id, notification);
		}
Exemplo n.º 18
0
		public void SendFileChunk(long id, string requestId, LrpServer.Net.LrpFileChunk chunk)
		{
			this.Instance.SendFileChunk(this.Handle, id, requestId, chunk);
		}
Exemplo n.º 19
0
		public void SendDataHistoryResponse(long id, string requestId, LrpServer.Net.LrpDataHistoryResponse response)
		{
			this.Instance.SendDataHistoryResponse(this.Handle, id, requestId, response);
		}
Exemplo n.º 20
0
		public void SendQuote(long id, LrpServer.Net.LrpQuote quote)
		{
			this.Instance.SendQuote(this.Handle, id, quote);
		}
Exemplo n.º 21
0
		public static void WriteQuote(this MemoryBuffer buffer, LrpServer.Net.LrpQuote arg)
		{
			buffer.WriteAString(arg.Symbol);
			buffer.WriteTime(arg.CreatingTime);
			buffer.WriteQuoteEntryArray(arg.Bids);
			buffer.WriteQuoteEntryArray(arg.Asks);
			buffer.WriteAString(arg.Id);
		}
Exemplo n.º 22
0
		public LocalChannelsPoolProxy(LocalClient client, LrpServer.Net.LrpParams parameters)
		{
			this.Instance = new LocalChannelsPoolRaw(client);
			this.Handle = this.Instance.Constructor(parameters);
		}
Exemplo n.º 23
0
		public static void WriteFileChunk(this MemoryBuffer buffer, LrpServer.Net.LrpFileChunk arg)
		{
			buffer.WriteInt32(arg.ChunksNumber);
			buffer.WriteInt32(arg.FileSize);
			buffer.WriteAString(arg.FileName);
			buffer.WriteUInt8Array(arg.Data);
		}
Exemplo n.º 24
0
		public static void WriteNotificationType(this MemoryBuffer buffer, LrpServer.Net.LrpNotificationType arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 25
0
		public static void WriteNotification(this MemoryBuffer buffer, LrpServer.Net.LrpNotification arg)
		{
			buffer.WriteSeverity(arg.Severity);
			buffer.WriteNotificationType(arg.Type);
			buffer.WriteAString(arg.Text);
			buffer.WriteDouble(arg.Balance);
			buffer.WriteDouble(arg.TransactionAmount);
			buffer.WriteAString(arg.TransactionCurrency);
		}
Exemplo n.º 26
0
		public static void WriteSeverity(this MemoryBuffer buffer, LrpServer.Net.LrpSeverity arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 27
0
		public static void WriteSessionStatus(this MemoryBuffer buffer, LrpServer.Net.LrpSessionStatus arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 28
0
		public static void WriteLrpSessionInfo(this MemoryBuffer buffer, LrpServer.Net.LrpSessionInfo arg)
		{
			buffer.WriteAString(arg.TradingSessionId);
			buffer.WriteSessionStatus(arg.Status);
			buffer.WriteInt32(arg.ServerTimeZoneOffset);
			buffer.WriteAString(arg.PlatformName);
			buffer.WriteAString(arg.PlatformCompany);
			buffer.WriteTime(arg.StartTime);
			buffer.WriteTime(arg.OpenTime);
			buffer.WriteTime(arg.CloseTime);
			buffer.WriteTime(arg.EndTime);
		}
Exemplo n.º 29
0
		public static void WriteCommissionChargeMethod(this MemoryBuffer buffer, LrpServer.Net.LrpCommissionChargeMethod arg)
		{
			buffer.WriteInt32((int)arg);
		}
Exemplo n.º 30
0
		public void SendNotification(SoftFX.Lrp.LPtr handle, long id, LrpServer.Net.LrpNotification notification)
		{
			using(MemoryBuffer buffer = m_client.Create())
			{
				buffer.WriteLocalPointer(handle);
				buffer.WriteInt64(id);
				buffer.WriteNotification(notification);

				int _status = m_client.Invoke(1, 16, buffer);
				TypesSerializer.Throw(_status, buffer);

			}
		}