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

Creating DLL for MT4 or MT5?

i want to make DLL for Metatrader however unlike MQL programming i didn't find any good source to learn on this subject can anyone point me to a website or book etc so i study those thanks for your help in advance
Amin
  • 471
  • 4
  • 5
1
vote
1 answer

MetaTrader 4: Automated Orders don't work, but also give no useful error message

I'm trying to place an automated order in MetaTrader 4 using an EA on a Demo account. The order does not get placed, but also returns an error code that means no error given. What am I doing wrong here? It doesn't work. No order is ever generated,…
Hakachukai
  • 90
  • 6
1
vote
1 answer

How can I ensure that the default colour for every manually drawn rectangle object is yellow till I change it manually

I know how to set the colour of a rectangle object programmatically, as seen below. I want to set a default colour that every manually created rectangle is set to in such a way that I can change the colour after creating it. For example, every…
TenOutOfTen
  • 467
  • 6
  • 14
1
vote
1 answer

How can I programmatically get the upper and lower values of a manually drawn rectangle

I am using the code below to write a message if blue or red rectangle is drawn manually on a chart. I tried getting the one of the rectangle values using OBJPROP_PRICE1 but it didn't work. How can I get the upper and lower values of a manually drawn…
SuperHueman
  • 165
  • 15
1
vote
1 answer

How can I try to place a pending order every X minutes till it's successfull?

From the research I've done, the stop level seems to prevent my pending order from being placed. I want to solve this by checking every X minutes if the pending order will go through till it has successfully been placed. How can I do this? I am…
SuperHueman
  • 165
  • 15
1
vote
1 answer

Timeframe as a variable, which declaration type?

I am working on a MQL4 expert advisor. This advisor uses 2 separate timeframes for its signals and entries/exits. Up until now I have used an "sinput" to allow the user to choose the desired timeframe for the higher timeframe indicators. I…
1
vote
1 answer

Import internet time data into metatrader4

I found that the TimeGmt() function is not accurate if the server time is set up wrong, especially for getting other timezones with daylight savings. Is there any way to scrape time data from the internet and into the expert advisor? I found the…
1
vote
1 answer

MQL4 (Metatrader 4 prog language) OrderSend() , take profit and stop loss variables

if (Ask > highest_price) { double takeprofit=NormalizeDouble(Bid+15*Point,Digits); double stoploss=NormalizeDouble(Bid-5*Point,Digits); int ticket=OrderSend(Symbol(),OP_BUY,0.1, Ask,0,stoploss,takeprofit,"My order",0,0,clrGreen); } Currently…
Stephanos B.
  • 340
  • 3
  • 15
1
vote
0 answers

TimeGMT() gives wrong time

Why is my EA not giving me the right time? here is my code (I omitted a lot of stuff that i dont think contribute to the problem): void OnTick() { static int OpenHour=99; if(OpenHour!=TimeHour(TimeGMT())){ OpenHour=TimeHour(TimeGMT()); …
1
vote
1 answer

MQL4 How to alert when a price reaches certain levels?

I have this free indicator is the name is FiboPiv_v2.mq4. It's a tool I use with good result in trading scalping. I set normally the alert by hand, but I see that the code is open and so I'd like to do a modification but I'm quite newbie in…
user5351312
1
vote
1 answer

Issue with MT4 OHLC to .CSV file

Newb here. I downloaded this indicator to extract OHLC from MT4 client terminal. It seemed fine at first, but: 1. It saves data with 2 decimal places only; 2. It doesn't save the OHLC for all instruments. Can someone give me a hand with the…
I. Я. Newb
  • 329
  • 1
  • 12
1
vote
2 answers

How to find day's first candle's HIGH, LOW in current Time frame

I am new to MT4, know little basic programming for MQL4. I am trading in UTC+5:30 in Indian Stocks. I just want a small piece of code to get today's First candles HIGH and LOW in current TimeFrame. Our trading starts at 9:15 AM IST and ends at 3:30…
Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
1
vote
2 answers

How much historical closed trades does mt4 store?

OrderSelect(,,MODE_HISTORY) In a live metatrader account, does it store all closed positions from the first time i opened an account with a broker? I wanted to make an expert advisor that calculates my winrate on a certain pair. I need to find out…
1
vote
1 answer

Dynamically canceling already sent BUYLIMIT order

I am using OrderSend like this OrderSend(Symbol(),OP_BUYLIMIT,Lots,100, 50,200,"",Magic,0,Red); in this case, buy will be executed when price comes 100. But I want to check one more layer when the price comes 100. like this. // when price comes to…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

MT4 API on Android

I would like to ask if it is possible to use an API ( MT4 to be exact ) and use it for creating an android app? The MT4 API consists an header file and a DLL file. Thank you very much.
batch 1999
  • 109
  • 9