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
2
votes
1 answer

How can I recognise programmatically when an up/down arrow is drawn on a chart when arrow objects are hidden?

I know how to draw an object arrow on the chart, which I usually do like this: ObjectCreate(0,"prevHigh",OBJ_ARROW_DOWN,0,Time[0],High[highestCandle]); ObjectSetInteger(0, "prevHigh", OBJPROP_COLOR, clrRed); Now I have an indicator…
BBNN
  • 139
  • 1
  • 9
2
votes
1 answer

How can I solve the duplicates of pending order issues?

My code below places sell pending orders when certain candle patterns are met on the H_1 chart. But duplicate pending orders are created when I change the chart timeframe and return to H_1. Also old orders that should have hit stop loss or take…
SuperHueman
  • 165
  • 15
2
votes
3 answers

How to get a variable value from a Custom Indicator in MQL4 in Expert Adviser?

If I have an indicator ( myIndi ) which generates a variable ( Var1 ), how can I access the Var1 from an EA, please? I've tried iCustom() but not getting the results.
stackit
  • 21
  • 1
  • 3
2
votes
2 answers

For a particular pair, how to get a total volume of open Long and Short positions on The Exchage?

In MQL4 ( MT4, MT5 ), how do I get the total volume of open Short and Long positions on the Exchange, for a current pair at the current time?
Amber More
  • 131
  • 1
  • 15
2
votes
1 answer

Opening the Indicator in Multiple Charts

I found an interesting MT4 indicator which shows remaining time of the next bar in the chart. But that works for the particular pairs which I would choose. But I want that program to work/applied on all opened pairs by just applying to any of the…
2
votes
1 answer

How to setup a period of time in an MQL4 source code?

I am using MQL4. Currently, I am using [Expert Advisor]-s in MT4.StrategyTester, and set a period-of-time by the build-in pull-down calendar GUI-elements. What I want to do is to setup a period-of-time straight in an MQL4-source code. If it is…
whitebear
  • 11,200
  • 24
  • 114
  • 237
2
votes
3 answers

Why MQL4 OrderModify() will not modify the order when backtesting?

I'm trying to ADD a stop loss to my open market orders in MetaTrader 4 when a position gets 100 pips "to the good" which is to be equal to the Order Open Price; OrderStopLoss() == OrderOpenPrice() But this isn't happening. I've added Print() &…
user6216142
2
votes
2 answers

How to avoid array out of range

Does somebody know how to avoid the error array out of range when trying to display long number of bars (lets say 7000) in an indicator buffer?
JLLMNCHR
  • 1,551
  • 5
  • 24
  • 50
2
votes
1 answer

How to include Fibonacci levels in Expert Advisor (EA)?

I want to have access to various Fibonacci levels like 23.6%, 38.2%, 50%, 61.8% and 100% in my expert advisor (EA). How can I define those in my EA so that traders can select them via the inputs? I tried this input double Fibo=23.6; However, is…
Peter Simmons
  • 23
  • 1
  • 5
2
votes
1 answer

MT4 Data Feeder: Need to send UTF-8 formated news to specific group only

I am trying to send news to clients, through a specific Data Feeder. The news are in UTF-8 format, and they can only be sent to the clients that their platform can show them. So, my question is there any way of sending the news only to these…
CompuPlanet
  • 151
  • 1
  • 11
1
vote
1 answer

Cannot get python to connect with MQL4 via ZMQ

Screenshot ofDirectory and Errors here I'm trying to built an algorithmic trading bot. First step is to establish a connection between Python and MQL4 EA. I have the dir set up correctly. As shown below and my scripts are as follows. My Python…
1
vote
0 answers

Identify the structure of a .dat file in python

I have a .dat file that is coming from Mt4 platform and I want to read its content outside of mt4 but I cannot identify the encoding. I tried to use the struct library in python but I have to define its structure first in order to read it, but I…
1
vote
1 answer

'Hour' - wrong parameters count - mql4

I am attempting to restrict the hours during which trading can occur, but I have not been successful with my attempts so far. I would appreciate any input or suggestions on how to accomplish this. // Function to Check if Trade Time is Valid bool…
user1582596
  • 503
  • 2
  • 5
  • 16
1
vote
0 answers

TradingView Pine Editor - How to not join changing values in one line?

Here is my current pine script plotting opens and closes: plot(swt ? weekOpen : na, title="Weekly Open", style=line, linewidth=2, color=green,transp=0) plot(swt ? weekClose : na, title="Weekly Close", style=line, linewidth=2,…
Kevin A.
  • 99
  • 2
  • 2
  • 10
1
vote
0 answers

how to close an order using the api MT4-Manager-API without specifying the closing price?

I am using the MT4-Manager-API Api, and I want to close trades at the current market price, without having to specify it. So far I have been able to close a previously opened trade but specifying the closing price as follows: c++ code TradeTransInfo…
ldiaz997
  • 128
  • 8
1
2
3
14 15