Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 486

 

Can someone tell me how it is possible that using one robot with the same parameters on one period at one broker with the same version of MT4 for 2 people get completely different results?

History downloaded in full

 
Roman Sharanov:

Can someone tell me how it is possible that using one robot with the same parameters on one period at one broker with the same version of MT4 for 2 people get completely different results?

History downloaded in full

Is the spread also the same and fixed and not "current"?

 
Roman Sharanov:

Can someone tell me how it is possible that using one robot with the same parameters on one period at one broker with the same version of MT4 for 2 people get completely different results?

The full history is downloaded

Are the number of ticks the same?
Is the account loaded in the same way?
Quotes of other pairs involved in the test, e.g. to display profit s currency of the account?
 

Good afternoon!

Question: how to speed up the tester in the terminal?

I have it using only 1 CPU thread out of 4, and only 150mb of RAM. (i.e. it doesn't use all the power of my PC).

What are the options?

If this has already been discussed, throw in the links Please!

 
Roni Iron Good afternoon!
Question: how to speed up the tester in the terminal?
It only uses 1 CPU thread out of 4, and only 150mb of RAM. (i.e. does not use all power of PC)
What are the options?
If this has already been discussed, throw in the links Please!

In the top right corner of this website there is a search icon Click on it and enter

 

Please help me to add to MarketProfile indicator moving through chart like VP-Range-v6 !!!!!!.

Or at least just add to make it work on time, not just date. It seems to be there, but it doesn't work

Files:
 
Roni Iron:

Good afternoon!

Question: how to speed up the tester in the terminal?

I have it using only 1 CPU thread out of 4, and only 150mb of RAM. (i.e. it doesn't use all the power of my PC).

What are the options?

If this has already been discussed, throw in the links Please!

MT tester uses only one core, go to MT5

 

How do you read the 8th line of a file?

the question is about file operations

https://docs.mql4.com/ru/files


Everything in mql is done by brute force, as someone once told me?

for(i=1; i<=8; i++)           
{
Str_DtTm =FileReadString(Handle);
}

Is there no other way?
 

Koo!

Could you please tell me who knows

I need to calculate the average price of a certain number of bars (BarCount). The problem is that the function remembers the maximum and minimum price values and outputs them, although the bars with these highs and lows are already outside the BarCount. How can I make the function recalculate constantly and output the values only for the specified number of bars?


extern int BarCound = 3;

double mp, max, min, avg, maxprice = -999999, minprice = 999999;

double AvgPriceBar()
{
int i=0;
for (i=0; i<BarCount; i++)
{
max = iHigh(Symbol(), PERIOD_CURRENT, i);
if (max > maxprice) maxprice = max;
}
for (i=0; i<BarCount; i++)
{
min = iLow(Symbol(), PERIOD_CURRENT, i);
if (min < minprice) minprice = min;
}
{
mp = (maxprice + minprice)/2;
if (mp > 0) avg = mp;
}
return();

}

 
Roman Pechurenko:

Hi forum users!

Please advise if you know

I need to calculate the average price of a certain number of bars (BarCount). The problem is that the function saves max and min price values and gives them out, but the bars that have these highs and lows are already out of the BarCount. How can I use it to recalculate constantly and output the values only for the specified number of bars?


extern int    BarCound   = 3;

double mp, max, min, avg, maxprice = -999999, minprice = 999999;
double AvgPriceBar()  
   { 
   int i=0;
      for (i=0; i<BarCount; i++)
         {
         max = iHigh(Symbol(), PERIOD_CURRENT, i);
            if (max > maxprice)  maxprice = max;
         }   
      for (i=0; i<BarCount; i++)
         {
         min = iLow(Symbol(), PERIOD_CURRENT, i);
            if (min < minprice)  minprice = min;
         }
      {
         mp = (maxprice + minprice)/2;
            if (mp > 0) avg = mp;
      }
      return();

   }

1. This is how the code inserted in the message should look like.

2. Why reinvent the wheel when there is a working moped in the shed?

There are such functions as iHighest and iLowest in mql4.

I hope these functions are easy to use.

Well, let's start with the problem:

Pinocchio was given 5 apples. He ate 2 of them. How many apples does Pinocchio have left?

You think it's three? Wrong. No one knows how many apples Pinocchio had before he was given five more apples.

Conclusion: Zero out the variables...

iHighest - Доступ к таймсериям и индикаторам - Справочник MQL4
iHighest - Доступ к таймсериям и индикаторам - Справочник MQL4
  • docs.mql4.com
[in]  Индекс (смещение относительно текущего бара) начального бара, с которого начинается поиск наибольшего значения. Отрицательные значения игнорируются и заменяются нулевым значением. Индекс наибольшего найденного...
Reason: