【发布时间】:2021-04-09 16:10:18
【问题描述】:
我使用的指标会生成警报,例如:eur / USD Buy 1.122323、TP 1.131232、SL 1.114354,我的问题是如何在 EA 中读取这些数据以执行买单。
【问题讨论】:
-
没有使用 MQL4 命令的内置方式。您可能会读取日志文件,因为警报通常会写入专家日志,但它并不总是立即更新。
我使用的指标会生成警报,例如:eur / USD Buy 1.122323、TP 1.131232、SL 1.114354,我的问题是如何在 EA 中读取这些数据以执行买单。
【问题讨论】:
作弊引擎内存
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using Telegram.Bot;
namespace ConsoleApp45
{
class Program
{
const int PROCESS_WM_READ = 0x0010;
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(int hProcess,
int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
public static void Main()
{
string ipek = "";
for (int i = 0; i < 10; i++)
{
Process process = Process.GetProcessesByName("terminal")[0];
IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, process.Id);
int bytesRead = 0;
byte[] buffer = new byte[10];
//02DD12A4 cheat engine den alınan değer 0x02DD12A4 bu şekilde girilir.
ReadProcessMemory((int)processHandle, 0x02DD12A4, buffer, buffer.Length, ref bytesRead);
string yasin = Encoding.UTF8.GetString(buffer);
}
}
}
}
【讨论】: