Improvements
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 68 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 115 KiB |
@@ -17,6 +17,7 @@ namespace SignalsTest
|
|||||||
|
|
||||||
public class CoinWatch
|
public class CoinWatch
|
||||||
{
|
{
|
||||||
|
public bool kickstarted = false;
|
||||||
public string pair;
|
public string pair;
|
||||||
public int index;
|
public int index;
|
||||||
public KlineInterval interval = KlineInterval.FifteenMinutes;
|
public KlineInterval interval = KlineInterval.FifteenMinutes;
|
||||||
@@ -68,6 +69,7 @@ namespace SignalsTest
|
|||||||
|
|
||||||
candles = await Brian.Client.GetKlinesCandlesticks(req);
|
candles = await Brian.Client.GetKlinesCandlesticks(req);
|
||||||
Console.WriteLine($"Done gettings Kandles for {req.Symbol}, {candles.Count} kandles retreived");
|
Console.WriteLine($"Done gettings Kandles for {req.Symbol}, {candles.Count} kandles retreived");
|
||||||
|
kickstarted = true;
|
||||||
Analyze(req.Symbol);
|
Analyze(req.Symbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ namespace SignalsTest
|
|||||||
// Console.WriteLine(reports[reports.Count-1].toJson());
|
// Console.WriteLine(reports[reports.Count-1].toJson());
|
||||||
bool isStSwitch=false;
|
bool isStSwitch=false;
|
||||||
|
|
||||||
for(int i=0; i< 3; i++){
|
for(int i=0; i< 30; i++){
|
||||||
bool _isStSwitch = reports[reports.Count-1-i].STUp != reports[reports.Count-i-2].STUp;
|
bool _isStSwitch = reports[reports.Count-1-i].STUp != reports[reports.Count-i-2].STUp;
|
||||||
|
|
||||||
if(_isStSwitch){
|
if(_isStSwitch){
|
||||||
@@ -105,7 +107,7 @@ namespace SignalsTest
|
|||||||
if(isStSwitch){
|
if(isStSwitch){
|
||||||
Picasso.DrawChart(reports, max ,min, symbol);
|
Picasso.DrawChart(reports, max ,min, symbol);
|
||||||
await Messenger.instance.SendLastChart(filename:symbol);
|
await Messenger.instance.SendLastChart(filename:symbol);
|
||||||
await Messenger.instance.SendMessage($"Checkout {symbol}! It just switched the SuperTrend lines. Current price: {reports[reports.Count-1].Close}");
|
await Messenger.instance.SendMessage($"`{symbol}` switched the SuperTrend lines. Current price: {reports[reports.Count-1].Close}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,12 +49,19 @@ public class Picasso{
|
|||||||
IPath stPath = GetPath(reports, "ST", widthMultiplier,heightRange, (float)min);
|
IPath stPath = GetPath(reports, "ST", widthMultiplier,heightRange, (float)min);
|
||||||
|
|
||||||
//NewChart
|
//NewChart
|
||||||
|
FontFamily fontFamily;
|
||||||
|
float TextFontSize = 64f;
|
||||||
|
string TextFont = "Arial";
|
||||||
|
if (!SystemFonts.TryGet(TextFont, out fontFamily))
|
||||||
|
throw new Exception($"Couldn't find font {TextFont}");
|
||||||
|
|
||||||
|
var font = fontFamily.CreateFont(TextFontSize, FontStyle.Regular);
|
||||||
|
|
||||||
img.Mutate(ctx => ctx.Draw(Color.Yellow, 2, sma7Path).
|
img.Mutate(ctx => ctx.Draw(Color.Yellow, 2, sma7Path).
|
||||||
Draw(Color.Purple, 2, sma25Path).
|
Draw(Color.Purple, 2, sma25Path).
|
||||||
Draw(Color.Green, 3, stPath).
|
Draw(Color.Green, 3, stPath).
|
||||||
Flip(FlipMode.Vertical));
|
Flip(FlipMode.Vertical).
|
||||||
|
DrawText(filename, font,new Color(Rgba32.ParseHex("#000000FF")), new PointF(10,10)));
|
||||||
|
|
||||||
img.Save($"{filename}.png");
|
img.Save($"{filename}.png");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ using SignalsTest;
|
|||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static ManualResetEvent _quitEvent = new ManualResetEvent(false);
|
static ManualResetEvent _quitEvent = new ManualResetEvent(false);
|
||||||
|
|
||||||
|
static List<CoinWatch> watches = new List<CoinWatch>();
|
||||||
private static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Initializing Messiah");
|
Console.WriteLine("Initializing Messiah");
|
||||||
@@ -11,11 +13,30 @@ class Program
|
|||||||
for (int i=0; i < CoinsList.symbols.Count; i++){
|
for (int i=0; i < CoinsList.symbols.Count; i++){
|
||||||
CoinWatch btcWatch = new CoinWatch(CoinsList.symbols[i], i);
|
CoinWatch btcWatch = new CoinWatch(CoinsList.symbols[i], i);
|
||||||
btcWatch.PriceUpdated += CoinWatch_OnPriceUpdate;
|
btcWatch.PriceUpdated += CoinWatch_OnPriceUpdate;
|
||||||
|
|
||||||
|
watches.Add(btcWatch);
|
||||||
}
|
}
|
||||||
|
CheckSuccess();
|
||||||
_quitEvent.WaitOne();
|
_quitEvent.WaitOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async static void CheckSuccess(){
|
||||||
|
await Task.Delay(120000);
|
||||||
|
|
||||||
|
List<string> failedList = new List<string>();
|
||||||
|
string commasList = "";
|
||||||
|
foreach(CoinWatch coin in watches){
|
||||||
|
if(!coin.kickstarted){
|
||||||
|
failedList.Add(coin.pair);
|
||||||
|
commasList += coin.pair + ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string msg = $"{failedList.Count} Failed out of {watches.Count}. Failed list: \n{commasList}";
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
Messenger.instance.SendMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
private static void CoinWatch_OnPriceUpdate(Object? sender,BinanceTradeData data)
|
private static void CoinWatch_OnPriceUpdate(Object? sender,BinanceTradeData data)
|
||||||
{
|
{
|
||||||
// Console.WriteLine(data.BestAskPrice);
|
// Console.WriteLine(data.BestAskPrice);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("SignalsTestCmd")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("SignalsTestCmd")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e1c55dbce65cfcb041fa992b0ee624d67c728009")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c7feba5a4ade9eca44a22aa5fdbcdfbb6ffbb0b0")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("SignalsTestCmd")]
|
[assembly: System.Reflection.AssemblyProductAttribute("SignalsTestCmd")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("SignalsTestCmd")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("SignalsTestCmd")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3414d8813171b6c653dbab0108f465f694ac738e4f209673a0a51ac70b8631de
|
5d95c334624791bdad7518056635a728e45ea1d8d347d96b17e862042cf7e5fc
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user