mql5

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) => {

Ticks per second

一世执手 提交于 2020-01-06 07:27:28
问题 I would like to calculate the number of ticks (or alternatively the price change) per second. Unfortunately MQL5's ENUM_TIMEFRAMES only goes down to 1 min. This indicator proves it's possible, though, but how? Maybe by means of the OnTimer event? Many thanks for your answers! 回答1: datetime time is number of seconds since the new computer era. if you call TimeCurrent() that returns datetime , it will give you integer. if you call it again in 0.1 second, you will receive same integer (or same+1

mql4 : coding empty buffer in line

无人久伴 提交于 2020-01-06 06:40:49
问题 so I make some coding and now have empty buffer I want to ask how to feel EMPTY_BUFFER so if use IF line == EMPTY BUFFER then FILL IT..i already try some coding but still not fill the empty buffer #property strict #property indicator_level1 75.0 #property indicator_level2 25.0 #property indicator_levelcolor LimeGreen #property indicator_levelwidth 1 #property indicator_levelstyle 0 #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 Green #property

Parallel execution is not performed OpenCL MQL5

偶尔善良 提交于 2019-12-25 01:06:28
问题 I have created a kernel of the OpenCL in Mql5. Here is the code: const string cl_src = //" int weightsum; \r\n" " #pragma OPENCL EXTENSION cl_khr_fp64 : enable \r\n" "__kernel void CalculateSimpleMA( \r\n" "int rates_total, \r\n" "int prev_calculated, \r\n" "int begin, \r\n" "int InpMAPeriod, \r\n" "__global double *price, \r\n" "__global double *ExtLineBuffer \r\n" ") \r\n" "{ \r\n" "int i,limit; \r\n" "int len_price = get_global_id(4); \r\n" //"int len_Ext = get_global_id(5); \r\n" " if

MQL5 Zmq PUB socket not being received by Python zmq SUB socket

随声附和 提交于 2019-12-24 01:56:08
问题 I'm trying to set up a PUB socket in MQL5 and a SUB socket in Python that will receive messages. I have this in MQL5: #include <Zmq/Zmq.mqh> Context context("helloworld"); Socket socket(context,ZMQ_PUB); string BROKER; int OnInit() { if (socket.bind("tcp://*:5556")) { Print("Error"); } else Print("Bound"); BROKER = AccountInfoString(ACCOUNT_COMPANY); return(INIT_SUCCEEDED); } void OnTick() { MqlTick last_tick; string str; if(SymbolInfoTick(Symbol(),last_tick)) { StringConcatenate(str, BROKER,

How to call a function from a DLL file from [ MQL5 ] code?

Deadly 提交于 2019-12-23 02:38:07
问题 Why the first MessageBox() works and the second doesn't? I don't know where the problem is. Does the MQL5 can access the dll file? I need to to call C# functions that read JSON . No errors appear in MetaEditor . C# .dll file: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; namespace TestMe { class Test { // [DllExport("Add", CallingConvention = CallingConvention.StdCall)] public static

Integrating the OHLC value from Python API to MT5 using MQL5

别等时光非礼了梦想. 提交于 2019-12-22 09:42:39
问题 I have obtained the OHLC values from the iqoption and trying to find out a way to use it with MT5. Here is how I got the values: import time from iqoptionapi.stable_api import IQ_Option I_want_money=IQ_Option("email","password") goal="EURUSD" print("get candles") print(I_want_money.get_candles(goal,60,111,time.time())) The above code library is here: iqoptionapi The line: I_want_money.get_candles(goal,60,111,time.time()) output json as : Output of the command Now I am getting json in the

How to send a message in MQL4/5 from MetaTrader Terminal to python using ZeroMQ?

爱⌒轻易说出口 提交于 2019-12-22 00:13:06
问题 I just want to send a message from MetaTrader Terminal, using it`s MQL4/5 to Python, just a simple client server, in which MQL4/5 is a client that sends, and python is a server who receives and these two are syncing with ZeroMQ. The Python side code is this which I am sure this part is working fine: import zmq import time context = zmq.Context() socket = context.socket(zmq.REP) socket.bind("tcp://127.0.0.1:9999") print("Server Started") while True: message = socket.recv() # Wait for next

Rolling (static) array?

自古美人都是妖i 提交于 2019-12-11 09:53:09
问题 Based on ticks per second ( ticksLastSecond ), I would now like to calculate the average ticks per second over the last minute. For this, I would need a rolling array with size = 60 I assume, each second pushing the array elements forward by the newest ticksLastSecond value (preferrably at the beginning (0) of the array) and the oldest one out. How could this be achieved? Many thanks in advance! 回答1: you can use arrays, keeping in mind the following: if you need average of 60 (x) values, your

isNewBar() not producing the right time Stochastic value onTick MQL5

£可爱£侵袭症+ 提交于 2019-12-10 00:21:48
问题 Check this program I am trying to get the values of the Stochastic #include <Lib CisNewBar.mqh> CisNewBar current_chart; // instance of the CisNewBar class: // detect new tick candlestick void OnTick() { if ( current_chart.isNewBar() > 0 ) { int stoch = iStochastic(_Symbol,PERIOD_M1,5,3,3,MODE_SMA,STO_LOWHIGH); double K[],D[]; ArraySetAsSeries(K,true); ArraySetAsSeries(D,true); CopyBuffer(stoch,0,0,5,K); CopyBuffer(stoch,1,0,5,D); ArrayPrint(K); } } Here is the output I got: 95.97315 90.40000