【问题标题】:Get data from a metatrader 4 alert从 metatrader 4 警报中获取数据
【发布时间】:2021-04-09 16:10:18
【问题描述】:

我使用的指标会生成警报,例如:eur / USD Buy 1.122323、TP 1.131232、SL 1.114354,我的问题是如何在 EA 中读取这些数据以执行买单。

【问题讨论】:

  • 没有使用 MQL4 命令的内置方式。您可能会读取日志文件,因为警报通常会写入专家日志,但它并不总是立即更新。

标签: mql4 mt4


【解决方案1】:

作弊引擎内存

 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);
    
                }
            }
        }
    }

【讨论】:

  • 您能否对此处的示例进行更多解释,以便更好地理解。
  • 这不是 MQL4,因此不回答问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-09-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多