Questions tagged [mql]

For questions related to Freebase's Metaweb Query Language. Please use MQL4 and MQL5 for questions related to FOREX MetaTrader Terminal platform MetaQuotes Language.

Disambiguation was needed, as the MQL tag is, unfortunately, used for two different things:

  1. The Metaweb Query Language which is a JSON query-by-example style language used to query Google's Freebase.com

  2. MetaTrader Terminal platform programming language developed at MetaQuotes, Inc., under a code name MQL4 and MQL5 programming language. These compiled, c-like languages are used for complex control of the MetaTrader Terminal software used in Terminal/Server relation for foreign exchange trading, derivatives trading and commodities trading.

Most, but not all, StackOverflow questions relate to the first context of use.

For the sake of the second, rather use MQL4 or MQL5 respectively.

281 questions
0
votes
1 answer

EA Opens more orders than expected in MQL4

Everything seems fine. But EA usually opens multiple trades in the same second... The way I built it is very linear and i can't seem to spot the logical mistake. It is basically a random martingale EA to test stuff out. Any indicator (that's why I…
0
votes
2 answers

How can I shorten this code to avoid redundancy?

Here's my code snippet: string trend() { double emaTrend0 = iMA (NULL,0,200,0,MODE_EMA,PRICE_CLOSE,0); double emaTrend1 = iMA (NULL,0,200,0,MODE_EMA,PRICE_CLOSE,1); double emaTrend2 = iMA (NULL,0,200,0,MODE_EMA,PRICE_CLOSE,2); …
Renz Carillo
  • 349
  • 2
  • 11
0
votes
1 answer

ctor error function already defined and has different type c++ or mql

i define class with ctor and use it in my code but compiler give me error class MovingAvrage_Expert { public: MovingAvrage_Expert(void); ~MovingAvrage_Expert(void); bool Init(void); double TradeSizeOptimized(void); void…
mohamad mazaheri
  • 122
  • 1
  • 12
0
votes
1 answer

GCP dashboard Query editor

I have a dashboard created from stackdriver custom log metrics. My question is how can I show only one split stack bar for 1 day. This is the query in query editor: fetch gae_app | metric 'some-custom-metric' | filter (metric.log ==…
0
votes
1 answer

MongoDB Cross-Collection Query

Assuming the following structure: Assets { "_id" : LUUID("d34a3fed"), "name" : "A", "records" : [ LUUID("3627f3ac"), LUUID("80e9d125"), LUUID("4d5e8af5"), LUUID("17593a39"), } Records { "_id" :…
cmac
  • 1
  • 2
0
votes
1 answer

Why is it that when the second arrow indicator shows up the EA doesn't execute anything?

I've written some code on an Expert Advisor to trade on the Fiji-trend-indicator. The EA recognises the first arrow indicator and executes a trade accordingly, however, when the second arrow is supposed to show up on a back test, the rest of the…
vinny9592
  • 37
  • 5
0
votes
1 answer

How to calculate indicator buffer only once per day mql4

I have an indicator which gives one signal [Down Buffer]... I wish to only give signal once per day... Like after the first signal it will not paint any signal for the rest of the day! I have tested with below code it's now not painting at…
0
votes
0 answers

Why is Async Query Failing

I have the following exposed endpoint in my API: [HttpGet] [ActionName("GetResponse")] public string GetResponse() { ClientCertificate = LoadCertificate(); //confirmed this works fine if (ClientCertificate != null) …
user2463517
  • 197
  • 1
  • 5
  • 14
0
votes
0 answers

Google Monitoring Query Language Metric Too many time series identifier columns

I'm trying to create a query in GCP Monitoring with the Google Monitoring Language (MQL Documentation). The metrics are from istio (Istio Metrics). As soon as I start working with the metric, I get the following error: Line 1: Too many time series…
0
votes
0 answers

MQL4 Make Gann zigzag indicator plot SR lines

Somebody has an ideia how to plot SR LINES when this zigzag based on gann angle changes? #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 DeepSkyBlue #property indicator_color2 Black //---- input…
Otávio Barreto
  • 1,536
  • 3
  • 16
  • 35
0
votes
0 answers

FileReadString returning empty values in MQL5

I am trying to read a file (ativos.txt) in MQL5 and print the assets within it. However, it seems that it reads them but do not print (empty). Can anyone help? //+------------------------------------------------------------------+ //| Expert…
Maverick13
  • 15
  • 6
0
votes
1 answer

mql4 - How to read .txt file into mql variable

variable.txt file : 10;20;30;40;50 how to import the variable.txt into mql4 variable a=10 b=20 c=30 d=40 e=50 thank you
0
votes
1 answer

How to check if MACD value is Negative or Positive?

I am using iMACD(NULL, PERIOD_CURRENT, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, i) function to get an MACD value but it returns fraction number, like 0.154154 or -0.154549, so I need to check if the MACD value is positive or negative. How do I check that?
0
votes
1 answer

problem in writing a character in *.TXT file in MQL

I'm trying to to read from a TXT file and do some calculation and write it back to another TXT file but when I read the character it changes to ASCII number (ex : '1' convert to 50) and when I try to write it in another file it's the ASCII number.…
0
votes
0 answers

Problems with returned function values in differents periods and chart timeframes

I need to do somthing like this if ( iAO( Symbol(),PERIOD_M1, 0) <= iAO( Symbol(), PERIOD_M5, 0) ) { .... } But iAO( Symbol(), PERIOD_M5, 0) does not work when my chart timeframe is M1 (It return 0 always). Is it possible to obtain the real…
Iván Rodríguez
  • 447
  • 4
  • 10