Questions tagged [metatrader4]

MetaTrader 4 is an electronic client/server trading platform widely used by online retail foreign exchange speculative traders. Anthony Papaevagorou, head of sales at MetaQuotes, has announced MetaQuotes no longer intends to issue upgrades to the MetaTrader 4 (MT4) [ recently reported on 2016-11-15 ]

MetaTrader 4, also known as MT4, is an electronic trading platform widely used by online retail foreign exchange speculative traders. It was developed by MetaQuotes Software and released in 2005. The software is licensed to foreign exchange brokers who provide the software to their clients.

The software consists of both a client and server component. The server component is run by the broker and the client software is provided to the brokers customers, which use it to see live streaming prices, charts and to place orders as well as manage their account.

MetaQuotes head of sales, Anthony Papaevagorou, has announced MetaQuotes no longer intends to issue upgrades to the MetaTrader 4 (MT4) [ reported on 2016-11-15 ]

387 questions
15
votes
2 answers

How can I cancel a trade when another is open and keep the open trade for a given duration?

I have written the code below that opens a buy and sell trade (a certain number of pips above and below the ask and bid price) at a specific time. How can I close/cancel one immediately when the other is opened? How can I close the opened trade if…
NotEveryDay
  • 153
  • 5
15
votes
4 answers

Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation

I'm completely stuck. I'm testing MetaTrader API and getting next error when tries to run a method in the Immediate Window of VS 2010: A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll A first chance…
abatishchev
  • 92,232
  • 78
  • 284
  • 421
14
votes
2 answers

How can I write mql4 code (EA) that marks the listed candle patterns with rectangles

I am quite new to writing mql4 code and would be grateful if I could get some help drawing rectangles when the following candlestick patterns occur: FIG1: Run code snippet
TopLeft
  • 159
  • 1
  • 7
11
votes
5 answers

How to send/receive data to/from MetaTrader Ternminal 4 with JAVA (or anything!)

I have been working on an algorithm ( Not mine, I am just modifying it ) that predicts when to buy and sell on the FOREX market. I need to be able to open and close orders, dynamically update parameters of the orders ( such as stoploss, maximum stop…
Jay Povey
  • 209
  • 1
  • 2
  • 12
8
votes
4 answers

Can I use languages other than MQL4 on MetaTrader4?

I have a task of migrating a C# market strategy to MetaTrader. Is there any way to automate that job? (For example, is it possible to parse C# into it's AST, then make the translation?) Does MetaTrader accept other languages by any means?
MaiaVictor
  • 45,122
  • 42
  • 127
  • 254
7
votes
2 answers

How to keep a 10 pip profit gap between stop loss and current price as profits increase

I am trying to add another condition to the solution in this post. I want the stop loss to move by 10 pips when a trade is in 10 pips profit. To be more specific, say I've set a pending buy order and the stop loss is 10 pips below the open price and…
TenOutOfTen
  • 427
  • 3
  • 13
7
votes
3 answers

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

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…
iGetIt
  • 665
  • 5
  • 19
7
votes
1 answer

Asynchronous web requests for MetaTrader

I am trying to see whether it is feasible to build a custom indicator for MetaTrader that can make asynchronous internet requests, in order to post data to a server with a PHP interface. These requests might take some time for the webserver to…
drlobo
  • 2,029
  • 5
  • 27
  • 42
7
votes
3 answers

How to compile an MQL4 file with a command-line tool?

Now I am compiling my MetaTrader .mq4 files to .ex4 files with MetaEditor. But my .mq4 files are generated by a Java-process, and I would like to automate the compilation process. Is there a command-line compiler tool I could call programmatically?
Donato Szilagyi
  • 4,144
  • 4
  • 32
  • 50
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
5
votes
3 answers

How to connect MetaTrader with a Node.JS?

I'm building a system, based on Node.JS, to connect with MetaTrader and to process all action like link account, open, close trade order... But I still have not found out the way how to connect with MetaTrader in Nodejs. Can you give me a solution…
5
votes
1 answer

Handling exceptions in MQL4

In the Java language one can handle exceptions with a try-catch mechanism. Does it exist any similar behaviour in MQL4? This code throws the error 'array out of range' in the Close[bar] expression and I cannot handle it properly. Any help will be…
JLLMNCHR
  • 1,309
  • 3
  • 22
  • 43
5
votes
2 answers

R and Metatrader 4

R has a great way of collecting data from other sources (eg Yahoo finance etc) library(quantmod) getSymbols("YHOO",src="google") Is there a way of collecting Metatrader 4 into R eg: library(*******) getSymbols("***",period=1hr, src="Metatrader4")…
adam.888
  • 6,958
  • 16
  • 58
  • 97
4
votes
2 answers

MetaTrader 4 Fix protocol using Java

I've got a MT4 client setup on my machine and can successfully retrieve feeds. However, I have written a program using java to pull data using the FIX protocol. I'd like to know how my java program can pull the data that I see on my MT4 client…
user1066568
  • 667
  • 3
  • 14
  • 24
4
votes
2 answers

What is the correct way to set StopLoss and TakeProfit in OrderSend() in MetaTrader4 EA?

I'm trying to figure out if there is a correct way to set the Stop Loss (SL) and Take Profit (TP) levels, when sending an order in an Expert Advisor, in MQL4 (Metatrader4). The functional template is: OrderSend( symbol, cmd, volume, price,…
not2qubit
  • 10,014
  • 4
  • 72
  • 101
1
2 3
25 26