Questions tagged [mql5]

MetaQuotes Language 5 (MQL5) is a built-in language for programming trading strategies. This language is developed by MetaQuotes Software Corp and allows to create your own Expert Advisors that make trading management automated and are perfectly suitable for implementing your own trading strategies. Besides, using MQL5 you can create your own technical indicators (custom indicators), scripts and libraries.

MQL5 contains a large number of functions necessary for analyzing current and previously received quotes and has built-in basic indicators and functions for managing trade positions and controlling them. The MetaEditor 5 (text editor) that highlights different constructions of MQL5 language is used for writing the program code. It helps users to orientate themselves in the expert system text quite easily.

MQL5 is the evolution of its predecessor - the MQL4 programming language, in which numerous indicators, scripts, and Expert Advisors were written. Despite the fact that the new programming language is maximally compatible with the previous-generation language, there are still some differences between these languages.

Check further details here: http://www.mql5.com/

404 questions
34
votes
1 answer

Accepting output of the socket generated by Python in MQL5

I have created a socket file something like the following and want that the output of the socket must be read by the MQL5. See the following Python code: daemon.py import socket #import arcpy def actual_work(): #val =…
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
15
votes
2 answers

How to use CopyRates() to search and filter through several timeframes for Bullish Engulfing pattern

I am trying to use CopyRates() to search for a bullish engulfing candlestick pattern (bearish candle followed by a bigger bullish candle) on several timeframes (all timeframes H2 to M10 within an H4 bullish candle after it closes). I read the…
SuperHueman
  • 165
  • 15
9
votes
2 answers

How to properly close an opened order? (can't pass a ticket number to "position" when sending an order)

I want to open an order, no problem with that, but if I want to close this order, I need the ticket number, ticket that I can't write manually, it will be given after the order is opened. From the documentation, I've got this: but I can't pass…
edward
  • 596
  • 1
  • 4
  • 11
8
votes
1 answer

How to find the largest number of times a candlestick pattern appears within 2 hours to 15 minute timeframes

I am trying to search figure out how to search for a pattern within a range of timeframes. Obviously, it is likely that the pattern would occur several times based on the timeframes, that’s why I’m particularly interested in the largest number of…
TenOutOfTen
  • 467
  • 6
  • 14
8
votes
1 answer

How to decompile a ex4 file new build 600+

If you don't know, an ex4 file is a file created in the MQL language (Auto trading robots). There is a decompiler that can decompile old builds of this type of files, but after build 600 there is no decompiler. I have valuable EAs(Forex robot) that…
Micheal
  • 89
  • 1
  • 1
  • 5
7
votes
3 answers

Call Metatrader MQL4/MQL5 function from imported DLL

I would like to call MQL4 or MQL5 function from my own imported DLL in Metatrader. Is it possible?
Michal Zmuda
  • 5,381
  • 3
  • 43
  • 39
6
votes
1 answer

How to tell when 3 Moving Averages cross within a duration of 4 candles or less

I've been working with 2 Moving averages crossing which is quite straight forward. I want to add a third to the mix and I'm trying to figure out to check for this occurring within 4 candles or less. For two moving averages I was using the…
IronThrone
  • 242
  • 1
  • 10
6
votes
1 answer

An OpenCL code in MQL5 does not get distributed jobs to each GPU core

I have created a GPU based indicator for MetaTrader Terminal platform, using OpenCL and MQL5. I have tried hard that my [ MetaTrader Terminal: Strategy Tester ] optimization job must get transferred on GPU to maximum. Most of the calculations are…
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
6
votes
0 answers

Converting native function of MQL5 to GPU using OpenCL

I have written a function in MQL5 for creating an indicator. Here I am attached the indicator file. Here is the OnCalculate() of the indicator: int OnCalculate(const int rates_total, const int prev_calculated,const int begin,const double…
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
5
votes
1 answer

Converting mql4 EA to mql5

I have been trying to figure out how to change my MQL4 code to MQL5. So far I've been able to change the RSI and MACD conditions and SendOrder() but there's a lot, like the ModifyOrder() and CloseOrder() amongst other stuff that I've not been able…
BBNN
  • 139
  • 1
  • 9
5
votes
1 answer

How to make OnCalculate() function in Custom Indicator use GPU in MQL5 / OpenCL?

I have created an Indicator using MQL5. After Profiling, the program I read that 99% of my CPU is used by my OnCalculate(). Here is my function: int OnCalculate( const int rates_total, const int prev_calculated, …
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
5
votes
3 answers

How to execute an MQL4 program in a server?

I have implemented an expert advisor using the MQL4 language to be executed in MetaTrader. Now, if I need to execute it, I always need to run MetaTrader and attach my EA program to a live currency pair graph in it. I want to know whether there is a…
tnishada
  • 1,315
  • 1
  • 16
  • 24
4
votes
0 answers

Broadcasting a message from a manager to clients in websocket using fastapi

I want to make a websocket server using Fastapi then get a message from a manager then broadcast it to all clients. The messages are just text. Here is the process: The manager connects to server. The clients connect to server. The manager send a…
Arta Asadi
  • 126
  • 1
  • 11
4
votes
0 answers

How can I draw Fibonacci Retracement from one Zigzag point to the other

I have made an EA that simply displays the ZigZag indicator line. Please see the code below. I would like to add a Fibonacci retracement (as seen in the image link below) from the drawn one end to the other of the ZigZag in the opposite direction.…
BBNN
  • 139
  • 1
  • 9
4
votes
2 answers

Integrating the OHLC value from Python API to MT5 using MQL5

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…
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
1
2 3
26 27