int bar1=iBarShift(Symbol(),PERIOD_M1,iTime(Symbol(),PERIOD_D1,0));//Print(bar1); //first bar
int MaxVol=0;
int i=0, n=0;
for (i=bar1; i>0; i--)
{
//if (i<bar);
//if (TimeMinute(Time[i])!=Minute()) break;
if (iVolume(Symbol(),0,i)>MaxVol)
{
MaxVol=iVolume(Symbol(),0,i);
n=i;
}
//Print(MaxVol," MaxVol ", n, " n");
}
datetime MaxVolT = iTime(NULL, PERIOD_M1, n);
Well, here we have it.
Now you can think about reducing and simplifying the code.
Here you have found the first bar. This means that we will have to copy so many bars into the array. This reduces the code to three strings.
1. Find the first bar.
2. copy the volumes of the first example into the array
intCopyTickVolume(
string symbol_name, // имя символаENUM_TIMEFRAMES timeframe, // периодint start_pos, // откуда начнем (с нулевого или первого)
int count, // сколько копируем(первым пунктом определили)long volume_array[] // массив для копирования тиковых объемов(предварительно объявляем массив глобального уровня или локального)
);
Downloaded the archive of quotes. Here is an example of one entry: 4071656556,D,EUR/USD,2015-05-31 17:00:02.803000000,1.098020,1.098120 The field headings are as follows: lTid,cDealable,CurrencyPair,RateDateTime,RateBid,RateAsk What do the first 2 fields mean?
Downloaded the archive of quotes. Here is an example of one entry: 4071656556,D,EUR/USD,2015-05-31 17:00:02.803000000,1.098020,1.098120 The field headings are as follows: lTid,cDealable,CurrencyPair,RateDateTime,RateBid,RateAsk What do the first 2 fields mean?
The first three columns can be safely discarded, they have no practical application for creating quotes for MT4.
I use many blocks in Expert Advisor, each block has the same indicator. Can I declare this indicator once in OnTick() and then in each block I don't have to declare it again?
I use many blocks in Expert Advisor, each block has the same indicator. Can I declare this indicator once in OnTick() and then in each block I don't have to declare it again?
Could you please tell me why there are warnings - implicit conversion from 'string' to 'number' and implicit conversion from 'number' to 'string' in variable locations (after int command and then after message). It must be one and the same warning? I am not good at programming.
Also, tell me more, if the code works but there are warnings only, is it bad?
And one more question, how do I get local time in the message? I write message= TimeLocal()+..... and nothing happens...
Could you please tell me why there appear warnings - implicit conversion from 'string' to 'number' and implicit conversion from 'number' to 'string' in variable locations (after the int command and then after the message). It must be one and the same warning? I am poorly versed in programming.
And tell me more, is it bad if the code works but there are only warnings?
Code fragment:
And read the difference between a string and an interleaver. You should probably declare the variables as string type if they are to be output.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Got it! That's it. Thanks.
int bar1=iBarShift(Symbol(),PERIOD_M1,iTime(Symbol(),PERIOD_D1,0));//Print(bar1); //first barWell, here we have it.
Now you can think about reducing and simplifying the code.
Here you have found the first bar. This means that we will have to copy so many bars into the array. This reduces the code to three strings.
1. Find the first bar.
2. copy the volumes of the first example into the array
3. ArrayMaximum(from this array)
It's not clear why you're using the n variable
Downloaded the archive of quotes. Here is an example of one entry:
4071656556,D,EUR/USD,2015-05-31 17:00:02.803000000,1.098020,1.098120
The field headings are as follows: lTid,cDealable,CurrencyPair,RateDateTime,RateBid,RateAsk
What do the first 2 fields mean?
Downloaded the archive of quotes. Here is an example of one entry:
4071656556,D,EUR/USD,2015-05-31 17:00:02.803000000,1.098020,1.098120
The field headings are as follows: lTid,cDealable,CurrencyPair,RateDateTime,RateBid,RateAsk
What do the first 2 fields mean?
Hello!
I use many blocks in Expert Advisor, each block has the same indicator. Can I declare this indicator once in OnTick() and then in each block I don't have to declare it again?
Hello!
I use many blocks in Expert Advisor, each block has the same indicator. Can I declare this indicator once in OnTick() and then in each block I don't have to declare it again?
How? Please show me an example.
Read the manual about the visibility of variables declared at different code levels.
Hello,
Could you please tell me why there are warnings - implicit conversion from 'string' to 'number' and implicit conversion from 'number' to 'string' in variable locations (after int command and then after message). It must be one and the same warning? I am not good at programming.
Also, tell me more, if the code works but there are warnings only, is it bad?
And one more question, how do I get local time in the message? I write message= TimeLocal()+..... and nothing happens...
Code snippet:
Hello,
Could you please tell me why there appear warnings - implicit conversion from 'string' to 'number' and implicit conversion from 'number' to 'string' in variable locations (after the int command and then after the message). It must be one and the same warning? I am poorly versed in programming.
And tell me more, is it bad if the code works but there are only warnings?
Code fragment:
And read the difference between a string and an interleaver. You should probably declare the variables as string type if they are to be output.