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/

298 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
  • 6,237
  • 7
  • 46
  • 100
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
  • 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
  • 427
  • 3
  • 13
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 Z m u d a
  • 4,882
  • 3
  • 40
  • 36
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
  • 230
  • 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…
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
  • 6,237
  • 7
  • 46
  • 100
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
  • 129
  • 8
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
  • 6,237
  • 7
  • 46
  • 100
5
votes
0 answers

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
  • 49
  • 1
  • 1
  • 5
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,054
  • 1
  • 12
  • 23
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
  • 6,237
  • 7
  • 46
  • 100
4
votes
2 answers

ExpertMACD raise [invalid stops] if Stop Loss is not 0

Please consider that I am just starting with MQL5. Just for learning, I ran the EA optimization of MT5 on ExpertMACD (preinstalled in MT5) on BTCUSD H1 pair on an Alpari-MT5-Demo account. All ok until July 2017 data, after which the Advisor does not…
alec_djinn
  • 7,288
  • 8
  • 29
  • 58
4
votes
1 answer

Simple function to read file from an URL to a string buffer ( C++ / MQL{4|5} using WinInet.dll )

I am looking for a simple function which is able to read a text or binary file from the internet into a string variable. It´s unbelievable that I could not find anything in the web, just low level descriptions of all the WinInet functions and…
Doerk
  • 71
  • 8
3
votes
1 answer

How to search for a candlestick pattern on multiple timeframes

I have an expert advisor that draws rectangle on a specifically defined bearish pinbar followed by a bullish candle. Please see the code below. It basically shows the rectangle on the timeframe displayed on the chart. How can I search for this…
TenOutOfTen
  • 427
  • 3
  • 13
1
2 3
19 20