[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 100
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
WindowRedraw() redraws graphical objects. It has nothing to do with buffers.
Got it... If there is another way with redrawing?
Got it... If another way with a redraw?
Good afternoon! Please help me with the ArrayMo function (it returns the maximum of the density curve).
The following questions have arisen:
1.What is the purpose of creating a temporary array
2. It's not clear what the values of the temporary array will be taken from, and therefore it's not clear how this array may be searched:
3. And then generally for me the truth is deeply hidden))))) Once we have ascertained that there is no value, we begin to determine the size of the array of "unclear values".
I would be very grateful for a ray of light in this story))))I don't think the function is written quite correctly after all. The main reason is that after the announcement.
it is necessary
otherwise(I quote)
!!!Note: an array declared locally in any function, which has been resized, will remain unchanged after the function is executed. When the function is called again, such an array will have a different size than the declared one!!!!
And thus with multiple calls the function will "fall in the past")
About how the algorithm works. The array m[][2] itself is a direct representation of empirical distribution of the number of hits of variable x[i] by its different values. That is, each element of the array consists of two numbers - the number of hits on some value (the first field) and the value itself. The loop searches for the same value in the array m for each x[i], and if it is found, the number field is added, otherwise a new element is created using ArrayResize() and our x[i] is written there.
Next, once the array is filled, we just need to find the element with the maximum number of hits, i.e., by definition, the modulus of distribution x.
This is done by strings
Although it seems to me (not sure about the multidimensional array), you could have just
All in all I can say (with all due respect to the code's author) that even when correcting all the defects, this algorithm is extremely inefficient and can often give wrong results. The reason is that we are working with the type double, which means that the probability of x[i] values being close but still distinguishable is quite high. This may not be so noticeable when the sample size is much larger (hundreds of times or more) than the total number of intervals into which x[i] is defined. However, in the many cases where this constraint is not met, there will be a lot of wrong calculations.
The more correct way to calculate the mode is this: an empirical distribution function (not to be confused with the frequency distribution) is constructed, then it is interpolated from piecewise linear to smooth, and finally the point of maximum derivative is looked for. Such an algorithm is free of the drawbacks listed above and works quite effectively even with small sample sizes. At least, I had to solve just the task of finding a mode for samples of 50-100 elements with a comparable number of intervals using MQL - and everything was OK. The only disadvantage is that interpolations usually cause a significant drop in calculation speed, of course, if we want to smooth qualitatively.
here: https://www.mql5.com/ru/job
Thank you. Maybe there are more options.
Thank you. Maybe there are more options.
Try typing "martingale" into a website search and you'll be surprised
Already looked! But what I want is missing(
Have a look here
https://www.mql5.com/ru/forum/136747
Hello. I've just started in MQL4.
Please advise on the OrderModify function. The manuals and examples show that this function is used for trawling, i.e. change of stop loss. I need to change only take profit on an open order. Stop loss is not set when order is opened and must also remain at 0 during modification .
How should the calculation and selection of orders look like ?
The final target should look something like this
if (OrderType()==OP_BUY && OrderOpenPrice()-Bid>kof*Point) // there is a buy, but it has gone down by kof
{
OrderModify(OrderTicket(),OrderOpenPrice(),0,OrderOpenPrice()+tpnew*Point,0,CLR_NONE);// we move TP lower than the previously placed
The same for sell.
Thank you for any answers.