code cleanup
test / deploy_trader_prod (push) Successful in 3m5s Details

dev
vlad zverzhkhovskiy 2025-09-16 17:59:48 +03:00
parent efb6f8b64f
commit 57dfa72f36
5 changed files with 8 additions and 22 deletions

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KLHZ.Trader.Core.Math.Declisions.Dtos.FFT.Enums
namespace KLHZ.Trader.Core.Math.Declisions.Dtos.FFT.Enums
{
public enum ValueAmplitudePosition
{

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KLHZ.Trader.Core.Math.Declisions.Dtos.FFT
namespace KLHZ.Trader.Core.Math.Declisions.Dtos.FFT
{
public class FFTAnalyzeResult
{

View File

@ -96,7 +96,7 @@ namespace KLHZ.Trader.Core.Math.Declisions.Utils
var timeSpan = currentTime - startTime;
for (int i = 0; i < harmonics.Length; i++)
{
var value = - harmonics[i].Magnitude * System.Math.Sin(2 * System.Math.PI * timeSpan.TotalSeconds / harmonics[i].Period.TotalSeconds + harmonics[i].Phase);
var value = -harmonics[i].Magnitude * System.Math.Sin(2 * System.Math.PI * timeSpan.TotalSeconds / harmonics[i].Period.TotalSeconds + harmonics[i].Phase);
sum += value;
}
return sum;

View File

@ -51,7 +51,7 @@ namespace KLHZ.Trader.Core.Math.Declisions.Utils
}
}
if (x1.Count>1 && x2.Count > 1)
if (x1.Count > 1 && x2.Count > 1)
{
var line1 = Fit.Line(x1.ToArray(), y1.ToArray());
var line2 = Fit.Line(x2.ToArray(), y2.ToArray());

View File

@ -1,5 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using KLHZ.Trader.Core.Common;
using KLHZ.Trader.Core.Common;
using KLHZ.Trader.Core.Contracts.Declisions.Dtos.Enums;
using KLHZ.Trader.Core.Contracts.Messaging.Dtos;
using KLHZ.Trader.Core.Contracts.Messaging.Dtos.Interfaces;
@ -20,7 +19,6 @@ using Microsoft.Extensions.Options;
using System.Collections.Concurrent;
using System.Security.Cryptography;
using System.Threading.Channels;
using Telegram.Bot.Types;
using Tinkoff.InvestApi;
using AssetType = KLHZ.Trader.Core.Exchange.Models.AssetsAccounting.AssetType;
@ -181,7 +179,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
var su = sells + buys;
if (su != 0)
{
await LogPrice(message, "sellsbuysbalance", (sells / su - 0.5m)*2);
await LogPrice(message, "sellsbuysbalance", (sells / su - 0.5m) * 2);
}
}
@ -328,7 +326,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
private async Task<decimal?> CalcTrendDiff(INewPrice message)
{
var data = await _tradeDataProvider.GetData(message.Figi, TimeSpan.FromHours(1));
if (data.isFullIntervalExists && LocalTrends.TryCalcTrendDiff(data.timestamps,data.prices, out var res))
if (data.isFullIntervalExists && LocalTrends.TryCalcTrendDiff(data.timestamps, data.prices, out var res))
{
return res;
}
@ -363,7 +361,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
var assetType = _tradeDataProvider.GetAssetTypeByFigi(message.Figi);
var res = mavTask.Result | ltTask.Result;
if ((res & TradingEvent.UptrendStart) == TradingEvent.UptrendStart
if ((res & TradingEvent.UptrendStart) == TradingEvent.UptrendStart
&& !LongOpeningStops.ContainsKey(message.Figi)
&& trendTask.Result.HasValue
&& trendTask.Result.Value > -5