Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 173

 
hoz:

Where does it say that? It's not in the documentation. Or are they hiding it on purpose? :)

The C file is just a piece of information. If you' ve worked with databases, you'll have to get used to it.
 
tara:

In C a file is just a piece of information. If you have worked with databases, you will have to wean yourself off it.

It's not specified anywhere in general? :)
 
Hm.
 
Hello, could you tell me if there is an advisor on the Internet that sets the total TakeProfit/StopLoss to the level of planned profit in rubles (dollars) and recalculates the TakeProfit/StopLoss level (open both in buy and sell) when you change the number of orders?
 
ALXIMIKS:

Come on, give me the fucking source.

Did you take the value of the last bar closed as 1?

and the 4 bars behind it have a value of 0.33 0.33 3 3 ????????????????????????????????????????????????

Now you have entered some coefficient of your own to characterise the variation and you want to calculate this coefficient for [1] bar?


well, not exactly.

is an array of ratios of values. one to another. these are not absolute values, but indices, ratios.
this means that say 0.5 is not "50% less". it means 2 times less
and 0.2 is not 80% less, but 5 times less.
2 or 5 is just right, it expresses the point - 2 and 5 times more, respectively

example array
1.2 1.02 0.833 10 0.98 0.1

we need to find the average (in this example, the average will obviously be 1)

arithmetic or geometric mean will not make it clear here, it just compares values, for these methods 0.5 - this is exactly 50% less.

to understand the logic - as I have already written - it is even possible to present it as a graph -
when the value is less than one represented by an inverse negative fraction. will come out

1.2 1.02 -1.2 10 -1.02 -10

here already you can calculate the arithmetic mean

but here there is a snag - if the final average for example 0.2 = it is in fact 1.2 (ie it should add 1)
if the final average for example -0.2 = it is essentially 0.8 (more precisely 0.8333) (i.e. also generally add 1)

however, in case all values are say 3, the output will be 3. So how do we know whether we should add 1?
check - if the value is less than 1, then yes? if not, then no?
apparently so

again - this is an algorithmic solution. i.e. with multiple conversions according to

I asked with the hope that maybe there is a simpler solution, maybe a formula ;-))))

i don't know which one needs a primer))
if no one can understand that 0.2 is not 80% less, but 5 times less... I withdraw my question (((((((

[update]
I think I found it.
in forming second array you have to subtract 1 from values,
and add this unit to final result 0.2 -> 1.2, -0.2 -> -1.2 (this one also has to be converted into negative fraction, you get 0.833(3))
everything will add up.

if anyone knows another, mathematical solution - I would be grateful)



 
https://docs.mql4.com/ru/series
If there are not enough bars on the chart, then increase it in the MT4 settings.

Thank you, I am interested in the tick prices of each bar. That's what I want to summarise and divide by the number of ticks to find the average price.

Maybe, it can be done in MQL5, while nobody knows about it in MQL4.

 
rosomah:

Thank you, I am interested in the tick prices of each bar. I want to sum them up and divide by the number of ticks to find the average price.

Maybe, it may be done in MQL5, while no one knows in MQL4.

First, you have to determine the period (time) for which you want to count. For example, for a minute. When a new M1 bar arrives, you collect "tick" price values for each incoming tick into an array. The array size can be set statically, and it can be changed dynamically. When the next bar comes, you will calculate the average price. You can calculate the average price for the current bar by the number of incoming ticks. The calculated data can be written to a file synchronized with the bar opening time. There is no tick history in MT4 - it is a matter of opinion.
 
TarasBY:
You must first define the period (time) for which you want to count. For example, for a minute. When a new M1 bar arrives, you must collect in an array the "tick" values of the price at every incoming tick. The array size can be set statically, and it can be changed dynamically. When the next bar comes, you will calculate the average price. You can calculate the average price for the current bar by the number of incoming ticks. The calculated data can be written to a file synchronized with the bar opening time. There is no tick history in MT4 - it is a matter of opinion.

Thanks for the last sentence. I somehow thought it was necessary to sum the ticks (Ask or Bid?) of the current bar, divide by the number, i.e. find the average and send it to the array.

Is there a tick history in MQL5, do you know it? I haven't read it or found it there.

 
GameOver:

Not exactly.

There is an array of ratios. These are not absolute values but indices, ratios.
this means that say 0.5 is not "50% less". it means 2x less
and 0.2 is not 80% less, but 5 times less.
at the same time, 2 or 5 is just right, expressing the meaning - 2 and 5 times as much, respectively

example of array
1.2 1.02 0.833 10 0.98 0.1


Dear what's wrong? I wrote you a script, maybe I did not quite understand what and how you think - but it's fucking working

double volume[7]={1,1.2, 1.02, 0.833, 10, 0.98, 0.1};
int aver_bar=7;                         
//double muss[n];
 for (  int n=0; n>=0;n--)                                          // n - номер бара для поиска коеффициента, i- количество баров в которіх будет найдено коефф.
 {
  double z,k,zz,f;
  k=0;                                                              // k счетчик
  z=volume[n];                                                      // Volume- буфер величины которую сравниваем, z-записываем чтобы каждый раз не обращаться в массив
  for (int m=n+aver_bar-1; m>=n+1;m--)                              // перебор всех баров влияющих на коееф.
  {
   zz=(volume[m])/z-1;                                              // отношение во сколько раз величина на исходном баре больше или меньше искомого 
   if( zz<0) zz= -1/(zz+1)+1;                                       // если величина zz меньще 1
   k+=zz;                                                           // сумируем в k значение
  }       
  //muss[n]=-k/((aver_bar-1)/1.0);                                  //  рассчитиваем коеффициент на n-м  баре
  Alert ("rez = ", k/((aver_bar-1)/1.0)+1);
 }

Alert returns 0.9999

The indicator, based on this algorithm, shows wrong logic (more correctly, if in the indicator will be muss[n]=-k/((aver_bar-1)/1.0) instead of muss[n]=k/((aver_bar-1)/1.0)+1)

And it is remotely similar to RSI but more sensitive (in terms of the slope angle between the bars)

Reason: