diff --git a/SignalsTestCmd/ACTUSDT.png b/SignalsTestCmd/ACTUSDT.png new file mode 100644 index 0000000..1af9fda Binary files /dev/null and b/SignalsTestCmd/ACTUSDT.png differ diff --git a/SignalsTestCmd/ADAUSDT.png b/SignalsTestCmd/ADAUSDT.png index d3f8d41..e614b26 100644 Binary files a/SignalsTestCmd/ADAUSDT.png and b/SignalsTestCmd/ADAUSDT.png differ diff --git a/SignalsTestCmd/CoinWatch.cs b/SignalsTestCmd/CoinWatch.cs index 2a74638..19e4d19 100644 --- a/SignalsTestCmd/CoinWatch.cs +++ b/SignalsTestCmd/CoinWatch.cs @@ -77,7 +77,8 @@ namespace SignalsTest int[] mas = new int[] { 7, 12, 25 }; reports = new List(); decimal max = 0; - decimal min = 10000000; + decimal min = 100000000; + decimal maxVol = 0; for(int i=0; i < candles.Count; i++){ TAReport report = TAReport.Generate(pair, Utils.GetMinutesForInterval(interval) ,candles, i,reports); @@ -87,6 +88,10 @@ namespace SignalsTest if(candles[i].Close < min){ min = candles[i].Close; } + + if(candles[i].Volume > maxVol){ + maxVol = candles[i].Volume; + } reports.Add(report); } Console.WriteLine($"Drawing chart for {reports.Count} candles, Coin: {symbol}, ceil:{max}, floor:{min}"); @@ -105,7 +110,7 @@ namespace SignalsTest } if(isStSwitch){ - Picasso.DrawChart(reports, max ,min, symbol); + Picasso.DrawChart(reports, max ,min, maxVol, symbol); await Messenger.instance.SendLastChart(filename:symbol); await Messenger.instance.SendMessage($"`{symbol}` switched the SuperTrend lines. Current price: {reports[reports.Count-1].Close}"); } diff --git a/SignalsTestCmd/CoinsList.cs b/SignalsTestCmd/CoinsList.cs index 278ebc2..38ccbcf 100644 --- a/SignalsTestCmd/CoinsList.cs +++ b/SignalsTestCmd/CoinsList.cs @@ -21,6 +21,14 @@ public static class CoinsList{ "CHILLGUYUSDT", "STGUSDT", "ONEUSDT", - "LINKUSDT" + "LINKUSDT", + "ARUSDT", + "RUNEUSDT", + "USUALUSDT", + "ZKUSDT", + "JUPUSDT", + "LUNAUSDT", + "DUSKUSDT", + "SUIUSDT" ]; } \ No newline at end of file diff --git a/SignalsTestCmd/MOVEUSDT.png b/SignalsTestCmd/MOVEUSDT.png new file mode 100644 index 0000000..21c51fd Binary files /dev/null and b/SignalsTestCmd/MOVEUSDT.png differ diff --git a/SignalsTestCmd/Messenger.cs b/SignalsTestCmd/Messenger.cs index b434f83..0060c68 100644 --- a/SignalsTestCmd/Messenger.cs +++ b/SignalsTestCmd/Messenger.cs @@ -17,13 +17,17 @@ namespace SignalsTest private static Messenger m_instance; public static Messenger instance { get { if (m_instance == null) { m_instance = new Messenger(); } return m_instance; } } + public const string chatId = "@doralockscryptosignals"; + //prod:doralockscryptosignals + //test:SignalTestPrivate - public async Task SendMessage(string text, string chat = "@doralockscryptosignals") + + public async Task SendMessage(string text, string chat =chatId) { await botClient.SendTextMessageAsync(chat, text); } - public async Task SendLastChart(string chat = "@doralockscryptosignals", string filename="test"){ + public async Task SendLastChart(string chat = chatId, string filename="test"){ FileStream fsSource = new FileStream($"{filename}.png", FileMode.Open, FileAccess.Read); InputFile photo = InputFile.FromStream(fsSource); await botClient.SendPhotoAsync(chat, photo); diff --git a/SignalsTestCmd/Picasso.cs b/SignalsTestCmd/Picasso.cs index 82eda54..19c3a61 100644 --- a/SignalsTestCmd/Picasso.cs +++ b/SignalsTestCmd/Picasso.cs @@ -9,33 +9,48 @@ using SixLabors.ImageSharp.Processing; using Newtonsoft.Json; public class Picasso{ - public static void DrawChart(List reports, decimal max, decimal min, string filename="test"){ + public static void DrawChart(List reports, decimal max, decimal min, decimal volMax, string filename="test"){ // float height = (float)Math.Ceiling(max - min) * 2f; // float width = ((float)height / 9f) * 16f; - float multiplier = 1; - if(min < 1000){ - multiplier = 10000; - } - float heightRange = (float)Math.Ceiling((float)(max - min) * multiplier); + decimal heightRange = max-min; float height=1080; float width = 1920; float widthMultiplier = width / (float)reports.Count; + float heightMultiplier = (height/ (float)heightRange) * 0.6f; + + float candlesOffset = 0.3f * height; + float volumeSize = 0.2f * height; using (Image img = new Image((int)width + 100, (int)height)){ //Draw Candles for(int i=0; i < reports.Count; i++){ // img.Mutate(ctx=> ctx.DrawLine())) PointF[] points = new PointF[2]; - points[0] =new PointF(i * widthMultiplier, (float)(reports[i].candle.Open - min) * multiplier); - points[1] =new PointF(i * widthMultiplier, (float)(reports[i].candle.Close - min)* multiplier); + + float openVal1 = (float)(reports[i].candle.Open - min) * heightMultiplier; + float closeVal1 = (float)(reports[i].candle.Close - min)* heightMultiplier; + points[0] =new PointF(i * widthMultiplier, openVal1 + candlesOffset); + points[1] =new PointF(i * widthMultiplier, closeVal1+ candlesOffset); PointF[] rangePoints = new PointF[2]; - rangePoints[0] = new PointF(i * widthMultiplier, (float)(reports[i].candle.High-min)* multiplier); - rangePoints[1] = new PointF(i * widthMultiplier, (float)(reports[i].candle.Low-min)* multiplier); - img.Mutate(ctx=> ctx.DrawLine(reports[i].candle.Close > reports[i].candle.Open ? Color.Green : Color.Red, 10, points).DrawLine( - reports[i].candle.Close > reports[i].candle.Open ? Color.Green : Color.Red, 3, rangePoints - )); + float openVal2 = (float)(reports[i].candle.High-min)* heightMultiplier; + float closeVal2 = (float)(reports[i].candle.Low-min)* heightMultiplier; + + rangePoints[0] = new PointF(i * widthMultiplier, openVal2+ candlesOffset); + rangePoints[1] = new PointF(i * widthMultiplier, closeVal2+ candlesOffset); + + PointF[] volumePoints = new PointF[2]; + volumePoints[0] = new PointF(i * widthMultiplier, 0); + volumePoints[1] = new PointF(i * widthMultiplier, ((float)reports[i].candle.Volume / (float)volMax) * volumeSize); + + Color candleColor = reports[i].candle.Close > reports[i].candle.Open ? Color.Green : Color.Red; + + img.Mutate(ctx=> ctx. + DrawLine(candleColor, 10, points). + DrawLine(candleColor, 3, rangePoints). + DrawLine(candleColor, 10, volumePoints) + ); } // Console.WriteLine("Getting paths"); @@ -44,9 +59,9 @@ public class Picasso{ // Console.WriteLine(float.Parse(t.ToString())); //Overlay - IPath sma7Path = GetPath(reports, "SMA7", widthMultiplier,heightRange, (float)min); - IPath sma25Path = GetPath(reports, "SMA25", widthMultiplier,heightRange, (float)min); - IPath stPath = GetPath(reports, "ST", widthMultiplier,heightRange, (float)min); + IPath sma7Path = GetPath(reports, "SMA7", widthMultiplier,(float)heightMultiplier, (float)min, candlesOffset); + IPath sma25Path = GetPath(reports, "SMA25", widthMultiplier,(float)heightMultiplier, (float)min, candlesOffset); + IPath stPath = GetPath(reports, "ST", widthMultiplier,(float)heightMultiplier, (float)min, candlesOffset); //NewChart FontFamily fontFamily; @@ -67,23 +82,19 @@ public class Picasso{ } } - static IPath GetPath(List reports, string propName, float widthMultiplier,float heightRange, float min, float offset =0){ + static IPath GetPath(List reports, string propName, float widthMultiplier,float heightMultiplier, float min, float offset =0){ PathBuilder builder = new PathBuilder(); builder.SetOrigin(new PointF(0,0)); - float multiplier = 1; - if(min < 1000){ - multiplier = 10000; - } for(int i=0; i < reports.Count; i++){ float newVal = float.Parse(GetPropByName(reports[i],propName).ToString() ?? "0"); // Console.WriteLine( newVal); float prevVal = i > 0 ? float.Parse(GetPropByName(reports[i-1],propName).ToString() ?? "0") : 0; // Console.WriteLine( prevVal); - float preValY = (prevVal * multiplier) - (min * multiplier); - float newValY=(newVal* multiplier) - (min* multiplier); - PointF prevPoint = new PointF((i-1)* widthMultiplier, preValY); - PointF newPoint = new PointF(i * widthMultiplier, newValY); + float preValY =( prevVal - min) * heightMultiplier ; + float newValY=(newVal - min) * heightMultiplier; + PointF prevPoint = new PointF((i-1)* widthMultiplier, (preValY) +offset); + PointF newPoint = new PointF(i * widthMultiplier, (newValY) + offset); // Console.WriteLine(newValY); builder.AddLine(prevPoint, newPoint); } diff --git a/SignalsTestCmd/SOLUSDT.png b/SignalsTestCmd/SOLUSDT.png new file mode 100644 index 0000000..e59a4a7 Binary files /dev/null and b/SignalsTestCmd/SOLUSDT.png differ diff --git a/SignalsTestCmd/STEEMUSDT.png b/SignalsTestCmd/STEEMUSDT.png index c21a411..c03fea0 100644 Binary files a/SignalsTestCmd/STEEMUSDT.png and b/SignalsTestCmd/STEEMUSDT.png differ diff --git a/SignalsTestCmd/STGUSDT.png b/SignalsTestCmd/STGUSDT.png new file mode 100644 index 0000000..805039b Binary files /dev/null and b/SignalsTestCmd/STGUSDT.png differ diff --git a/SignalsTestCmd/XLMUSDT.png b/SignalsTestCmd/XLMUSDT.png new file mode 100644 index 0000000..bd42323 Binary files /dev/null and b/SignalsTestCmd/XLMUSDT.png differ diff --git a/SignalsTestCmd/XRPUSDT.png b/SignalsTestCmd/XRPUSDT.png index c7fa8f9..dc7b8d5 100644 Binary files a/SignalsTestCmd/XRPUSDT.png and b/SignalsTestCmd/XRPUSDT.png differ diff --git a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.dll b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.dll index e4de84f..e3256de 100644 Binary files a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.dll and b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.dll differ diff --git a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.exe b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.exe index 119da97..44eb91c 100644 Binary files a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.exe and b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.exe differ diff --git a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.pdb b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.pdb index 9b7133f..3d78c8f 100644 Binary files a/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.pdb and b/SignalsTestCmd/bin/Debug/net8.0/SignalsTestCmd.pdb differ diff --git a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfo.cs b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfo.cs index 5007a7d..45f1d79 100644 --- a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfo.cs +++ b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("SignalsTestCmd")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c7feba5a4ade9eca44a22aa5fdbcdfbb6ffbb0b0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4a8f2d608b1f1ca133831ccdead689f8d57ae5f4")] [assembly: System.Reflection.AssemblyProductAttribute("SignalsTestCmd")] [assembly: System.Reflection.AssemblyTitleAttribute("SignalsTestCmd")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfoInputs.cache b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfoInputs.cache index 989d51d..d02df6b 100644 --- a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfoInputs.cache +++ b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.AssemblyInfoInputs.cache @@ -1 +1 @@ -5d95c334624791bdad7518056635a728e45ea1d8d347d96b17e862042cf7e5fc +ca0f5c6656c28599aa5c69610c0b127117543bcbf3a50182e0f73d06e5e5f4ec diff --git a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.dll b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.dll index e4de84f..e3256de 100644 Binary files a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.dll and b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.dll differ diff --git a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.pdb b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.pdb index 9b7133f..3d78c8f 100644 Binary files a/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.pdb and b/SignalsTestCmd/obj/Debug/net8.0/SignalsTestCmd.pdb differ diff --git a/SignalsTestCmd/obj/Debug/net8.0/apphost.exe b/SignalsTestCmd/obj/Debug/net8.0/apphost.exe index 119da97..44eb91c 100644 Binary files a/SignalsTestCmd/obj/Debug/net8.0/apphost.exe and b/SignalsTestCmd/obj/Debug/net8.0/apphost.exe differ diff --git a/SignalsTestCmd/obj/Debug/net8.0/ref/SignalsTestCmd.dll b/SignalsTestCmd/obj/Debug/net8.0/ref/SignalsTestCmd.dll index 3bd1adb..1ccf3b2 100644 Binary files a/SignalsTestCmd/obj/Debug/net8.0/ref/SignalsTestCmd.dll and b/SignalsTestCmd/obj/Debug/net8.0/ref/SignalsTestCmd.dll differ diff --git a/SignalsTestCmd/obj/Debug/net8.0/refint/SignalsTestCmd.dll b/SignalsTestCmd/obj/Debug/net8.0/refint/SignalsTestCmd.dll index 3bd1adb..1ccf3b2 100644 Binary files a/SignalsTestCmd/obj/Debug/net8.0/refint/SignalsTestCmd.dll and b/SignalsTestCmd/obj/Debug/net8.0/refint/SignalsTestCmd.dll differ