Forum

Problem with MQL5 account switching

I have installed an expert advisor on a VPS , and so far everything has worked correctly. However, I am facing a problem: when I switch accounts, the robot also switches automatically. What I want to do is that the robot continues to operate on account X while I continue to work on another account

Count pending orders in a period MQL5

Hello I have the following code that calculates the open orders in a given Timeframe, but I don't know how to count also the pending orders . int TradeCount( ENUM_TIMEFRAMES TimeFrame) { int Cnt; ulong Ticket; long EntryType; datetime DT[ 1 ]; Cnt = 0 ; if ( CopyTime (

MQL4 no history data in short periods of time

Hello, I am creating a trading robot in MT4, part of it works with resistance and support zones: iHigh ( _Symbol , PERIOD_M1 , 0 ); //Example The problem is that by using such a small time period, the broker simply does not have enough historical data, is there any way to solve this problem? Thanks

MQL5 Automatic optimization

Is there a way to automate the values, for example every month? I have used this code, but my code is complex and I would like to know if there is any way to do it directly. Thanks. void OnTick () { int bars = iBars ( _Symbol , PERIOD_MN1 ); if (totalBars != bars) { totalBars = bars;

How can I include a csv file directly in MQL4?

The problem I have is that when reading a CSV file it does not link directly to the robot, that is, to read this file it must be stored in the data folder "Files". My question is, is there any way to include a CSV file directly using for example #include and be able to read the file from there