From b3b7807249bdf2ec5b27f6f6bcb4565f1c275e66 Mon Sep 17 00:00:00 2001 From: vlad zverzhkhovskiy Date: Tue, 14 Oct 2025 18:01:35 +0300 Subject: [PATCH] code cleanup --- KLHZ.Trader.Core/Exchange/Services/ManagedAccount.cs | 6 ++---- KLHZ.Trader.Core/Exchange/Services/Trader.cs | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/KLHZ.Trader.Core/Exchange/Services/ManagedAccount.cs b/KLHZ.Trader.Core/Exchange/Services/ManagedAccount.cs index d9b46a7..29b7582 100644 --- a/KLHZ.Trader.Core/Exchange/Services/ManagedAccount.cs +++ b/KLHZ.Trader.Core/Exchange/Services/ManagedAccount.cs @@ -1,5 +1,4 @@ -using Google.Protobuf.WellKnownTypes; -using KLHZ.Trader.Core.Common.Extentions; +using KLHZ.Trader.Core.Common.Extentions; using KLHZ.Trader.Core.Contracts.Common.Enums; using KLHZ.Trader.Core.DataLayer; using KLHZ.Trader.Core.Exchange.Extentions; @@ -10,7 +9,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System.Collections.Concurrent; using System.Collections.Immutable; -using Telegram.Bot.Types; using Tinkoff.InvestApi; using Tinkoff.InvestApi.V1; using Asset = KLHZ.Trader.Core.Exchange.Models.AssetsAccounting.Asset; @@ -215,7 +213,7 @@ namespace KLHZ.Trader.Core.Exchange.Services AccountId = AccountId, ConfirmMarginTrade = false, InstrumentId = figi, - Direction = stopOrdersDirection, + Direction = stopOrdersDirection, PriceType = PriceType.Point, Quantity = count, StopOrderType = StopOrderType.StopLoss, diff --git a/KLHZ.Trader.Core/Exchange/Services/Trader.cs b/KLHZ.Trader.Core/Exchange/Services/Trader.cs index cbc7ad2..2d7da78 100644 --- a/KLHZ.Trader.Core/Exchange/Services/Trader.cs +++ b/KLHZ.Trader.Core/Exchange/Services/Trader.cs @@ -242,7 +242,7 @@ namespace KLHZ.Trader.Core.Exchange.Services private async Task> CalcTimeWindowAverageValue(ITradeDataItem message) { var res = TraderUtils.GetInitDict(Constants.BlockingCoefficient); - var cacheSize = TimeSpan.FromSeconds(60*60); + var cacheSize = TimeSpan.FromSeconds(60 * 60); var data = await _tradeDataProvider.GetDataForTimeWindow(message.Figi, cacheSize, selector: (i) => i.Direction == 1); var closings = MovingAverage.CheckByWindowAverageMean2(data, data.Length, 15, 300, -5m, 5m); //var re = MovingAverage.CheckByWindowAverageMean2(data, 100, 15, 300, -4m, 4m); @@ -678,8 +678,8 @@ namespace KLHZ.Trader.Core.Exchange.Services .ToArray(); if (message.Price >= levelsByTime[0].LowValue && message.Price < levelsByTime[0].HighValue) { - longStopLossShift = message.Price - levelsByTime[0].LowValue+ additionalShift; - shortStopLossShift = levelsByTime[0].HighValue - message.Price+ additionalShift; + longStopLossShift = message.Price - levelsByTime[0].LowValue + additionalShift; + shortStopLossShift = levelsByTime[0].HighValue - message.Price + additionalShift; } else {