Forum

Metatrader 5 - TimeCurrent() function returning old date

Hi, When I run the following line of code against the EURUSD I get a value of: D'2016.05.05 21:52:41' datetime timeCurent = TimeCurrent (); However when I open up a chart in Metatrader the last bar is '2016.05.06 23:55' . As per the TimeCurrent() documentation

Metatrader 5 - Takes alot of memory when cycling a chart through symbols

Hi, I've got an Expert Advisor that has been setup to cycle through symbols and it chews alot of memory. I've noticed this is when the symbols are loaded into and out of the Market Watch that is slowly creeps up. So it's not the chart cycling through existing items in the Market Watch but more when

Mql5 - ChartSetSymbolPeriod - Crashes the chart window

Hi, I'm testing the ChartSetSymbolPeriod method in mql5 however it seems to be crashing my chart window. Steps: Open MetaTrader and open a "AUDCAD" chart so that it's the only chart open . Open MetaEditor Create a new script In the OnStart() method I put the following line of code

Which operating system is the fastest for Metatrader 5 in the cloud?

Hi, I'd like to run Metatrader 5 in the cloud and am investigating operating systems to use: I'm looking for something that is fast. Things I've looked at My laptop: i7, 16Gb RAM Runs lots of windows concurrently with an EA on each quite happily. Amazon AWS free tier: Windows Server 2012 This is

WebRequest - Error when hitting a local url

Hi, I"m trying to fetch a local url on my machine (http://localhost:52957). The code below is from the following url (https://www.mql5.com/en/docs/common/webrequest). I am able to browse to http://localhost:52957 with a web browser. I keep getting the following error: 5200

Screenshot only taking the RHS of the graph after Navigate

Hi, I'm trying to take a screenshot of the 680th bar (see below). When I run the code below on the chart the screenshot does not navigate to the -680th position. It takes a screenshot of the chart as it is when you open the chart. If I step through the code (leaving a break point on the

How do you calculate moving average in MQL5?

Hi, I'm porting code across from MQL4 to MQL5 and am battling on what I thought would be quite simple. I want to work out the moving average. In MQL4 it was: double movingAverage = iMA(m_symbol, m_timeFrame, period, index, m_maMethod , PRICE_CLOSE, 0); In MQL 5 we now get: double firstMA =

How are multiple orders in the Strategy Tester treated in MQL5?

Hi, I'm using MQL5. When running my back tester I'm doing the following. Example (see below for a screenshot): Open Trade1 SL=100 with volume=0.01 Open Trade2 SL=150 with volume=0.01 Open Trade3 SL=200 with volume=0.01 I then run in the strategy tester. The price then rises in the strategy tester

Waiting for Update Error - When debugging with Start with History Data

Hi, I've been getting the "Waiting for Update" message intermittently when running MQL Scripts from the MetaEditor. Has anyone else experienced this and know how to resolve it? Steps to create: 1) I run an EA from Metaeditor in history mode and am able to debug successfully 2) Suddenly it'll start

How do you show an indicator on the Strategy Tester in Metatrader5

Hi, I'd like to have a moving average showing on my Strategy Tester when running it in Metatrader5. Does anyone know how to do this? Thanks