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 ]

437 questions
3
votes
2 answers

What is the difference between init() and OnInit()?

I am learning MQL4. On their reference website, creating a custom indicator is done like as follows: #property indicator_chart_window int init(){ return(0); } int deinit(){ ObjectsDeleteAll(); return(0); } int start(){ return(0);…
CyberShed
  • 41
  • 1
  • 7
3
votes
2 answers

creating a basic dll in metatrader4

I am trying to create a basic hello world dll using codeblocks and metatrader4 and trying to do it in a striped version. my compile .dll and .def are in the same dir as the .mq4 file. in file test.mq4 #property copyright "Copyright 2014, MetaQuotes…
user3766148
2
votes
0 answers

Why my calculation does not match metatrader 4 backtest loss?

I am writing and expert advisor and ran a test. And I cannot understand, and find info why loss amount is not matching my calculations. To do backtesting I should get correct results. So in the image we see there was 0.79 lot position opened at…
Dariux
  • 3,953
  • 9
  • 43
  • 69
2
votes
1 answer

How do I convert a VB delegate into a python event handler?

I have to rewrite the following VB code that is subscribing to a delegate (event), into python, using python.net. Imports MtApi Public Class Form1 Private apiClient As MtApiClient Public Sub New() InitializeComponent() …
not2qubit
  • 14,531
  • 8
  • 95
  • 135
2
votes
1 answer

How to get a profit of Nth open position MQL4 / MT4?

I want to create a function that can get random profit open position. For example : a profit of the Last 2 Open Position of overall Total Position a profit of the First 3 Open Position of overall Total Position Below function seems it only gets…
Roller
  • 35
  • 7
2
votes
1 answer

ZeroMQ Connector still sent data successfully but failed to get response from MT4 Server

I was following the 7 video tutorials on how to interface python with a MetaTrader Terminal 4 and got no problem running them on iPython kernel just as instructed in this video By no problem I mean a trade was sent to the server with ease and client…
tiensison
  • 21
  • 3
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
0 answers

What is the PineScript equivalent of MQL4's _Point?

I am trying to convert this indicator to PineScript. Couldn't figure out how to get Point variable. Is there any way to achieve the same thing in PineScript? _Point official definition: The _Point variable contains the point size of the current…
Peter
  • 656
  • 1
  • 6
  • 14
2
votes
1 answer

MQL4 TEMA indicator. Indicator line gets messed up when I limit the amount of bars the indicator is processing

I have this TEMA indicator which worked fine. I added a piece of code in order to limit the amount of bars to process but the indicator line gets messed up in the back in an abnormal way and when I limit the amount of bars to process to a small…
2
votes
1 answer

Expert Advisor is not opening trades

I tried to create an EA in mql4 which opens and close the trade position as per condition given, but it is not opening the trade after mating the conditions, EA Works till signal which shows buy and sell and after that nothing happens. How can I…
2
votes
3 answers

How can someone send data from MetaTrader 4/5 Terminal to external server?

this is somehow intended to (maybe) be(come) a guideline post in terms of MetaTrader 4/5 and its corresponding language MQL4 both set into context with sending data to external servers. In my special case I am building a Django/Python based web…
JSRB
  • 2,492
  • 1
  • 17
  • 48
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

Creating textfile with MQL4

I am trying to create a textfile with MQL4. No sucess. It just doesn't work. A very simple script: void OnStart() { string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH); string…
Alexsander Santos
  • 107
  • 1
  • 2
  • 7
2
votes
0 answers

Calculating the sin value of the angle between bars

I'm trying to convert this indicator to run on TradingView: https://www.mql5.com/en/market/product/14320#description The calculation seems straightforward but I'm getting really absurd numbers from this calculation. The steps for calculation are…
Élodie Petit
  • 5,774
  • 6
  • 50
  • 88
2
votes
4 answers

What is the reason for the error 'invalid ticket for Order close function' in mql4?

In my mql4 Expert Advisor, I've written this function to close all the buy trades at once. When I test it via the Strategy Tester, it closes some buy trades, but for a few other buy trades it returns the: OrderClose error 4051:invalid ticket for…
user6534695
1 2
3
29 30