Skip to content

Commit

Permalink
23.08.14
Browse files Browse the repository at this point in the history
  • Loading branch information
ksasefsend committed Aug 14, 2023
1 parent a6771d8 commit 3055692
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions kucoin_buy_detector/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public partial class Form1 : Form
string[] orden_last = new string[100];

string[,] takerOrderId = new string[500000, 10];
Int64 takerOrderId_kol = 0;
Int64[] takerOrderId_kol = new Int64[10];

public Form1()
{
Expand All @@ -52,6 +52,11 @@ private async void Form1_Load(object sender, EventArgs e)
{
log_richTextBox.Invoke(new Action(() => log_richTextBox.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " Start." + Environment.NewLine, Color.Black)));

for(int a = 0; a < 9; a++)
{
takerOrderId_kol[a] = 0;
}

await load_kucoin_symbols();
}

Expand Down Expand Up @@ -268,7 +273,7 @@ void obr_match(string strr, int num)
Int64 order = 0;
if (message_market_match.data.side == "buy")
{
for (Int64 a = 0; a < takerOrderId_kol; a++)
for (Int64 a = 0; a < takerOrderId_kol[num]; a++)
{
if (takerOrderId[a, 0] == message_market_match.data.takerOrderId.ToString())
{
Expand All @@ -279,17 +284,17 @@ void obr_match(string strr, int num)
goto exit;
}
}
takerOrderId[takerOrderId_kol, 0] = message_market_match.data.takerOrderId.ToString();
takerOrderId[takerOrderId_kol, 1] = "1";
takerOrderId[takerOrderId_kol, 2] = (Convert.ToDouble(message_market_match.data.price.Replace(".", ",")) * Convert.ToDouble(message_market_match.data.size.Replace(".", ","))).ToString();
takerOrderId[takerOrderId_kol, 3] = "-";
takerOrderId[takerOrderId_kol, 4] = message_market_match.data.symbol.ToString();
takerOrderId[takerOrderId_kol, 5] = message_market_match.data.price.ToString();
takerOrderId[takerOrderId_kol, 6] = message_market_match.data.price.ToString();
order = takerOrderId_kol;
takerOrderId_kol++;
takerOrderId[takerOrderId_kol[num], 0] = message_market_match.data.takerOrderId.ToString();
takerOrderId[takerOrderId_kol[num], 1] = "1";
takerOrderId[takerOrderId_kol[num], 2] = (Convert.ToDouble(message_market_match.data.price.Replace(".", ",")) * Convert.ToDouble(message_market_match.data.size.Replace(".", ","))).ToString();
takerOrderId[takerOrderId_kol[num], 3] = "-";
takerOrderId[takerOrderId_kol[num], 4] = message_market_match.data.symbol.ToString();
takerOrderId[takerOrderId_kol[num], 5] = message_market_match.data.price.ToString();
takerOrderId[takerOrderId_kol[num], 6] = message_market_match.data.price.ToString();
order = takerOrderId_kol[num];
takerOrderId_kol[num]++;
exit:
kol_pos_label.Invoke(new Action(() => kol_pos_label.Text = "Parcels: " + takerOrderId_kol));
kol_pos_label.Invoke(new Action(() => kol_pos_label.Text = "Parcels: (" + num + ") " + takerOrderId_kol[num]));
}

double min_ = 300; // filter
Expand All @@ -304,7 +309,7 @@ void obr_match(string strr, int num)
string proc_f_n = "0";
string proc_s_n = "0";

for (Int64 a = 0; a < takerOrderId_kol; a++)
for (Int64 a = 0; a < takerOrderId_kol[num]; a++)
{
if (takerOrderId[a, 0] == orden_last[num])
{
Expand Down

0 comments on commit 3055692

Please sign in to comment.