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
1
vote
2 answers

MQL4: How to convert the value of iHigh() - iLow() to integer?

double _high = iHigh(Symbol(), Period(), 0); double _low = iLow(Symbol(), Period(), 0); double result = _high - _low; Excuse my limited English. The type of result is a double number, and I want to convert the double number to an integer…
Abbotton
  • 201
  • 2
  • 3
1
vote
1 answer

run MetaTrader 5 on server (for python)

I can’t seem to find a solution on how to run MetaTrader 5 on a server like replit.io or etc. The code works on local desktop, but I believe the code on the server can’t initialize mt5. is there a solution for this? running a virtual machine is one…
1
vote
2 answers

OrderClose function not working correctly

Is this the correct implementation of OrderClose()? for(int ii = 0; ii < OrdersTotal(); ii++) { if(OrderSelect(ii, SELECT_BY_POS, MODE_TRADES)) { if(OrderType() == OP_BUY && OrderMagicNumber() == MagicStart && OrderSymbol() == symb) …
Umer
  • 183
  • 2
  • 16
1
vote
2 answers

How to group a lot exponent in MQL4 / MT4?

I manage to get normal lot exponent but I need to change it a bit by grouping example in the picture. Can someone guide me how to get the lot exponent but with a grouping technique Group=5 Exponent=1.8? double GroupExponent(int type) { double…
Roller
  • 35
  • 7
1
vote
2 answers

How can I get data from a time frame other than period setting in strategy tester (MT4)

I want to know How can I get data from a time frame other than period setting in Strategy Tester (a part of MetaTrader4 Trading Terminal), using the sample code below, I get zero results for op2 & EMA2 whenever I choose a period setting other than…
hamed razi
  • 19
  • 3
1
vote
1 answer

Mql4 indicator does not update automatically

i am experience some issue with an indicator that i am working on , can somebody please take a look and tell me why its causing this issue ? to put it simply the indicator is not refreshing Explanation: when i attach the indicator to the chart and…
Umar
  • 33
  • 5
1
vote
2 answers

MQL 4/5 Finding the center 25% and 75% of the candle

I am looking to plot a dot on the candle at 25%, 50% and 75% Levels. Code to plot a dot at 50% of the candle length is as below. How can I add a dot at 25% and 75% also. The below code is for MT5. I have tried to change the logic by dividing as…
Neil
  • 11
  • 1
1
vote
0 answers

Create function not defined in ZMQ header file - MQL4

I got issue about header file in MetaTrader 4. I'm using ZMQ libraries and header files. It worked good,but without changing anything something went wrong, exactly: "create function not defined". This error occured in Mql/Lang/GlobalVariables.mqh…
1
vote
2 answers

Can I make a while-loop that uses RSI value as the condition?

When I try to run this while-loop in MQL4, it can not seem to update the rsi from within the loop. It always returns the same value of the rsi and thus stays in an eternal loop. I have tried it on an EA as well as a script. I have also tried making…
Nak1987
  • 25
  • 1
  • 6
1
vote
0 answers

Array out of range mql4

I am trying to add indicator code, which works perfectly on its own, to an EA MQL4 source. While everything compiles just fine, the terminal tab shows the above error. Both errors occuring relate to tick[i+k]. double ticks[]; double tick[]; int…
Michael
  • 11
  • 2
1
vote
1 answer

MetaTrader Terminal 4: debugging an expert advisor on historical data

I have a MetaTrader Terminal 4 logged into a demo account. I have written and compiled my first Expert Advisor. I am able to debug it on a live chart, so working fine. I would like to debug it though on historical data. In the MetaEditor the…
mHelpMe
  • 6,336
  • 24
  • 75
  • 150
1
vote
1 answer

Login to mt4 account by python script

I know integrating python with Metatrader5 isn't that hard, its relatively easy compared to python integration with mt4. But the Issue is I don't need the mt5 integration, I only need mt4 integration I wanted to know if it's possible to login to mt4…
Joe Narha
  • 11
  • 1
1
vote
0 answers

Hello could somebody help me modify an interesting indicator?

I got this indicator for mt4, I would like somebody to help me modify it so I can input an integer to select how many bars should be plotted. normally it will plot infinite bars, I'd like to be able to select the number of MTF bars the indicator…
1
vote
0 answers

How can I tell if an arrow object was drawn on the previous candle when it closes?

I have been able to find the candle index of arrow objects that appear on a chart using the code below: if(ObjectType(name) == OBJ_ARROW){ if(ObjectGet(name, OBJPROP_COLOR) == Red){ arrowTime…
BBNN
  • 139
  • 1
  • 9
1
vote
2 answers

Getting signals from telegram channel and placing them in MT4 using Python

I would like to read messages from a Telegram channel (which are essential forex signals) and place the orders in MT4 windows application. For now, I have made a python script which listens to the channels and stores messages in a database. I can…
Surya K
  • 117
  • 2
  • 9
1 2
3
14 15