Questions tagged [mt4]

MetaTrader 4 is a software platform for manual and automatic trading, including free clients (end-user terminals) for Windows, iPhone, and Android, as well as server-side modules for processing trade transactions, storing and distributing history of quotes, proxy-servers, and administration tools (for brokers).

MetaTrader 4 is a widespread online trading platform designed to provide brokerage services to customers in FOREX Majors, Metals, Commodities, CFD, Indices, Futures and recently even BTC cryptocurrency markets.

The MetaTrader Terminal 4 natively supports a built-in programming language MQL4 and other DLL #import-s, which together allows users to extend the standard functionality with custom scripts, expert advisers (trading robots) and technical indicators.

MetaTrader server-side functionality is also extensible with their proprietary MetaTrader 4 API.

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

225 questions
0
votes
3 answers

How to set the default font used in the MT4 Comment() function?

The default font used for the Comment("some text") function is not not a fixed-width (aka monotype) and it is often too small. How can I change the default font used for Comment()?
not2qubit
  • 14,531
  • 8
  • 95
  • 135
0
votes
1 answer

How to convert send order from mql4 to mql5

Below is the method I'm using to place an order after three minutes if it doesn't go through. I've converted the larger part of it from mql4 to mql5. It's just the commented part that I'm not sure how I'll change to mql5 since in mql5 send orders…
Carnality
  • 1
  • 1
0
votes
1 answer

Why is this basic MQL4-code taking so much time to load up on my MT4?

I am learning MQL4 language and am using this Code to plot a Simple moving Average, the Code works fine, but when I load it up on my MT4 it takes a lot of time, am I missing something ? int start() // Special function…
karim
  • 3
  • 3
0
votes
2 answers

Is it possible to run MQL4 code outside of Metatrader?

I have an indicator that is written in MQL4. I'm looking to pass data to it and run it outside of MT4 and, for example, write it to a file. So that I can process the data in Python. Is it possible and how?
user3080600
  • 1,309
  • 2
  • 11
  • 23
0
votes
1 answer

Why is iCustom() returning default empty value (2147483647) for my indicator?

I built my own custom indicator that calculates the approximate slope and acceleration of a chart using the previous X number of bars. When I attach the indicator to a chart it works as expected, but when I try to retrieve the latest value within an…
HotSteel
  • 11
  • 6
0
votes
0 answers

how can I set take profit to double stop loss

I am setting up a pending order in the following way in my project: int ticketSell = OrderSend(Symbol(),OP_SELLLIMIT,lotSize, bottom,0, top,0,"SellOrder",magicnumber,0,Red); How can I make the take profit, double the pips for stop loss? In other…
SuperHueman
  • 165
  • 15
0
votes
1 answer

Mt4Manager API Python Wrapper - Unable to get trade history

I am trying to pull MT4 trade history data using the PyMT4ManagerAPI hosted here: https://github.com/ipenn/PyMT4ManagerAPI The API works fine to get open trades and users info. But when I try to get the historical trades, using the function…
Rishi Mehta
  • 399
  • 3
  • 10
0
votes
0 answers

Rectangle on a specific timeframe doesn't extend on a lower timeframe

I have written the following code that draws a rectangle for bearish engulfing patterns for two inputed timeframes. I set the defaults to daily and 4 hours. When I am on the daily chart I expect that only the daily rectangles should appear for one…
TenOutOfTen
  • 467
  • 6
  • 14
0
votes
2 answers

How to close a trade for sure in MQL4/MT4?

I have an EA with closes a trade on button click //void CloseCurrentTrade(). It's called after successfull OrderSelect int orderType = OrderType(); double price; if (orderType == OP_BUY) price = return MarketInfo(OrderSymbol(), MODE_BID); else…
sibvic
  • 1,622
  • 2
  • 12
  • 19
0
votes
1 answer

How to NOT get pending Stop executed if closure fails "Modification is prohibited. The order is too close to the market."?

Sometimes, particular in volatile markets, it happens that either after first or multiple attempts of Pending Stop order closure (stop buy or stop sell), I get error message "Modification is prohibited. The order is too close to the market." which…
Andrew0
  • 1
  • 5
0
votes
2 answers

MQL4 assign a value into array failed

This is my code trying to generate the ADC Cloud indicator. At first, it can work if I just generate the cloud. Currently, I am trying to make the histogram green when it is above zero, otherwise red. Then, I separate the Could array into two…
Carl Zheng
  • 708
  • 2
  • 6
  • 20
0
votes
1 answer

Is it possible to show the real slippage when orderSend()

For MT4,MQL When sendOrder(), It sometimes successes or sometimes misses mainly because of slippage. I would like to get the real slippage when sendOrder(). Is it possible??? My source code for now is like this below. Ticket =…
whitebear
  • 11,200
  • 24
  • 114
  • 237
0
votes
1 answer

MT4/Wine/Ubuntu will not allow FileOpen

I am trying to get MT4 to talk to Ubuntu; code: volumeCount=FileOpen(/home/david/.wine/drive_c/Program\ Files\ \ (x86\)/Capital\ City\ Markets\ MetaTrader\ 4/MQL4/Files/+"Volpath.bin",FILE_READ|FILE_WRITE|FILE_BIN);} This produces an error…
0
votes
3 answers

MT4 communication methods

I have tried but couldn't figure it out on my own. I know MT4 provides Pipe and WebRequest(), as a means of communication, but WebSocket isn't built as part of the Programming. So for now, Pipe is the only thing available. But communication with…
user4853414
0
votes
1 answer

How to get the optimization period from the script

I would like to get the optimization period (when use data is checked) At first I tried like this. datetime dtFrom; datetime dtTo; void OnInit(){ dtFrom = Time[0]; //from date } double OnTester(){ dtTo = Time[0]; // to date } However, it has…
whitebear
  • 11,200
  • 24
  • 114
  • 237