From 9190340264f947b7978072aad4b0d9660f9f891f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 16 一月 2023 18:09:13 +0800
Subject: [PATCH] '交易策略优化'

---
 ConsoleApplication/TradeListCapture.cpp |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/ConsoleApplication/TradeListCapture.cpp b/ConsoleApplication/TradeListCapture.cpp
index 00f0622..630b9e8 100644
--- a/ConsoleApplication/TradeListCapture.cpp
+++ b/ConsoleApplication/TradeListCapture.cpp
@@ -792,6 +792,20 @@
 	return codes;
 }
 
+HWND TradeListCapture::getSimpleTradeLeftMenu(HWND tradeWin)
+{
+	HWND win = FindWindowEx(tradeWin, NULL, TEXT("AfxMDIFrame140s"), NULL);
+	if (win <= 0) {
+		throw string("未获取到菜单句柄");
+	}
+	win = FindWindowEx(win, NULL, TEXT("AfxWnd140s"), NULL);
+	if (win <= 0) {
+		throw string("未获取到菜单句柄");
+	}
+	win = FindWindowEx(win, NULL, NULL, TEXT("HexinScrollWnd"));
+	return win;
+}
+
 list<TradeDelegateData> TradeListCapture::captureSimpleTradeDelegateInfo(cv::Mat img)
 {
 	cv::Mat grayImg = grayImgs(img, openCLExcuterDelegate);
@@ -863,9 +877,16 @@
 		}
 	}
 	else {
+		//如果最后一条数据与倒数第二条数据的
 		std::advance(end, -1);
-		free(*end);
-		rowData.erase(end);
+		int end_start = (*end)[0];
+		std::advance(end, -1);
+		if (end_start - (*end)[1]>15) {
+			//删除最后1条数据
+			std::advance(end, 1);
+			free(*end);
+			rowData.erase(end);
+		}
 	}
 
 	int* rowIndex = (int*)malloc(sizeof(int) * rowData.size() * 4);

--
Gitblit v1.8.0