mql4

Processing json string in mql4

谁说我不能喝 提交于 2020-04-17 18:43:55
问题 I have received the following string: {"records":[{"id":"rec4haaOncoQniu8U","fields":{"orders1":5},"createdTime":"2020-02-08T09:08:22.000Z"}]} I am not understanding how I can process and separate the values of the json in mql4 using the "JAson.mqh " library, located here: https://www.mql5.com/en/code/13663 I need the values of "orders" located under "fields" , value = 5 . the only "KEYS" that changes are the keys within the "fields" values. i would like to be able to get the values with

I can't grab/print data on the pull instance using plain zeroMQ Push/Pull pattern

拥有回忆 提交于 2020-03-21 10:10:49
问题 I am having tough times to grab and print data which is successfully pushed to the wire. I have set up a plain Push-Pull-Architecture with Metatrader 4 acting as producer and Python backend acting as consumer . When it comes to grabbing and printing the data, I just cannot make it happen. This is my push instance which works just fine: Metatrader 4 zeroMQ push instance: #include <Zmq/Zmq.mqh> // EA plot settings extern string PROJECT_NAME = "Dashex.Feeder"; extern string ZEROMQ_PROTOCOL =

How to post from MetaTrader Terminal 5 MQL 5 a request to my nodejs server, which is running locally on my MT5 host?

半城伤御伤魂 提交于 2020-03-18 09:01:41
问题 I'm trying to get FX rates in my nodejs server and socke.io emit them to the client, while running MetaTrader Terminal 5 or 4. So I guess I have to use MQL4/5. I know how the handle the request in my nodejs server. What I dont know is where to write the MQL4 code, what to config in my MetaTrader Terminal. Lets say I want to send EUR/USD bid rate to my nodejs server everytime it gets changed. How do I achieve that, using MT4/5 and MQL4/5? My nodejs code: app.post('/fxroute', (req, res) => {

How to post from MetaTrader Terminal 5 MQL 5 a request to my nodejs server, which is running locally on my MT5 host?

你。 提交于 2020-03-18 08:59:28
问题 I'm trying to get FX rates in my nodejs server and socke.io emit them to the client, while running MetaTrader Terminal 5 or 4. So I guess I have to use MQL4/5. I know how the handle the request in my nodejs server. What I dont know is where to write the MQL4 code, what to config in my MetaTrader Terminal. Lets say I want to send EUR/USD bid rate to my nodejs server everytime it gets changed. How do I achieve that, using MT4/5 and MQL4/5? My nodejs code: app.post('/fxroute', (req, res) => {

用Python写MT4自动交易策略来炒外汇

橙三吉。 提交于 2020-02-27 09:32:35
原理 使用MQL4原生语言调用ZERO-MQ作为消息接口服务端 使用Python作为ZERO-MQ的客户端,调用接口写MT4的自动交易策略 机器环境 Win10 Python3.6 MQL4调用ZERO-MQ作为接口服务器代码 #property version "1.00" #property strict // 调用ZERO-MQ库: MQL-ZMQ from https://github.com/dingmaotu/mql-zmq #include <Zmq/Zmq.mqh> // 设置ZERO-MQ参数 extern string PROJECT_NAME = "DWX_ZeroMQ_Example" ; extern string ZEROMQ_PROTOCOL = "tcp" ; extern string HOSTNAME = "*" ; extern int REP_PORT = 5555 ; extern int PUSH_PORT = 5556 ; extern int MILLISECOND_TIMER = 1 ; // 1 millisecond // 设置交易输入的参数 extern string t0 = "--- Trading Parameters ---" ; extern int MagicNumber = 123456 ; extern int

Converting XGBoost tree structure dump file to MQL4 (C like language) code

主宰稳场 提交于 2020-02-20 10:32:50
问题 I have a dump file of XGBoost tree structure trained in Python. The structure has 377 trees, and file has approximately 50,000 lines. I would like to convert this structure to MQL4 code, or C code so to say. The text file looks something like this: booster[0]: 0:[inp0<6.85417] yes=1,no=2,missing=1 1:[inp10<1.00054] yes=3,no=4,missing=3 3:[inp21<0.974632] yes=7,no=8,missing=7 7:[inp22<1.01021] yes=15,no=16,missing=15 15:[inp15<0.994931] yes=31,no=32,missing=31 31:[inp12<0.999151] yes=63,no=64

Cannot open file on Ubuntu

泪湿孤枕 提交于 2020-01-24 10:32:06
问题 I'm using Ubuntu 14 and trying to create a script to write files, but I'm getting the 5004 error, every time I try to open a file. datetime currtime; bool newcandle; string terminal_data_path = TerminalInfoString( TERMINAL_DATA_PATH ); string filename = terminal_data_path + "\\MQL4\\Files\\" + "data.csv"; int filehandle; filehandle = FileOpen( filename, FILE_WRITE | FILE_CSV ); if ( filehandle < 0 ){ Print( "Failed to open the file by the absolute path " ); Print( "Error code ", GetLastError(

How can I write an mt4 indicator that draws a rectangle and horizontal lines over first 6 hours of hourly candles

核能气质少年 提交于 2020-01-24 09:20:12
问题 I am a quite new to mql4 coding. I would like to know how I write an indicator that does the following, based on the image below: Draw a rectangle over the current day hour chart that covers the highest and lowest price points of the first 6 hours (candles) Draw two horizontal lines along the highest and lowest points found 1. Please note that 1. and 2. should be based strictly on the hourly period and shouldn't vary with the selected period. I believe I'm suppose to be using ObjectCreate()

How to pass argument by reference from MQL4 to C++ DLL

折月煮酒 提交于 2020-01-22 20:17:28
问题 I am trying to write a simple program in MQL4 which passes a variable to a C++ DLL function by reference and prints the updated variable value in MQL4. Given below is my code. DLL function: void Test(int* X) { *X = 6; } MQL4 Code #import "Test.dll" void Test(int&); #import void OnStart() { int A; Test(A); Alert(A); } But I am not getting any value back from C++ function for variable A. Can someone please help me what I am doing wrong here? Thanks in advance 回答1: Let's start with the DLL-side:

How can I convert Metatrader 4 alert or email indicator signal to Expert Advisor to open trades?

筅森魡賤 提交于 2020-01-22 19:53:43
问题 I have been using an indicator to take trades. I didn't develop the indicator, so I only have access to the .ex4 file. How can I extract the take profit, open trade and stop loss values in the alerts or email signals to open trades? Please see a sample of the email and alert signals below. 回答1: Here is a working example script of a native MQL solution which uses kernel32.dll to copy the log file from ./MQL4/Logs to ./MQL4/Files . The LogSignalParser abstract base class needs to be subclassed