Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1949
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
Thank you!
Why don't you like ENUM_TIMEFRAMES?
And you can put variables in input in the form of enumeration and select them as you like... Why should you make such a mess? And in mql4 this enumeration has been available for a long time...
Why don't you like ENUM_TIMEFRAMES?
And you can put variables in input as an enumeration and select them as you like... Why do you have to go through all this trouble? And in mql4 this enumeration has been available for ages...
+
Why don't you like ENUM_TIMEFRAMES?
And you can put variables in input in the form of enumeration and select them as you like... Why should you make such a mess? And in mql4 this enumeration has also been available for a long time...
Thank you! I had no idea.
Colleagues, please advise the best algorithm to find the price of the previously placed limit order closest to the current price - respectively to the ascending sell limit, to the bid
the buy limit which is closest to the bottom.
This f-iio counts the quantity but I need the PRICE of the previously placed limit order to make the f-iio return...
So far, I'm using min price for sell limit and max price for buy limit....
Colleagues, please advise the best algorithm to find the price of the previously placed limit order closest to the current price - respectively to the ascending sell limit, to the bid
the buy limit which is closest to the bottom.
This f-iio counts the quantity but I need the PRICE of the previously placed limit order to make the f-iio return...
So far I'm using min price for sell limit and max price for buy limit....
I want to save the required prices with tickets and maybe something else, for example time, in my structure or array and sort immediately after adding by price. By resources, if you search not often, it is the same or a little more expensive, and if often, it's better to remember. Of course, if you don't have 100500 orders) Then it may be too expensive. In general, sorting in a structure or multidimensional array problem is solved only for the first index unfortunately.
Sometimes I use several one-dimensional arrays with the same indexes, tickets, time, prices. And search by index of necessary property. For example, we get the index of a smaller time or a larger price and get the ticket of the necessary order. Of course, it is a crutch, but it works clearly.
A question has arisen, not found in the search. Is it possible to enable algotrading from the EA. Get the properties of the terminal, whether it is enabled or not.
And is it possible to run one EA in one terminal with algotrading enabled and another not.
to store in its structure or array the required prices with tickets and maybe something else, e.g. time, and sort immediately after adding by price. By resources, if you do not look often, it is the same or a little more expensive, and if you often, it is better to remember. Of course, if you don't have 100500 orders) Then it may be too expensive. In general, sorting in a structure or multidimensional array is solved only for the first index unfortunately.
Sometimes I use several one-dimensional arrays with the same indexes, tickets, time, prices. And search by index of necessary property. For example, we get the index of a smaller time or a larger price and get the ticket of the necessary order. Of course, it is a crutch, but it works clearly.
to store in its structure or array the desired prices with tickets and maybe something else, such as time, and sort immediately after adding by price. By resources, if you do not look often, it is the same or a little more expensive, and if you often, it is better to remember. Of course, if you don't have 100500 orders) Then it may be too expensive. In general, sorting in a structure or multidimensional array is solved only for the first index unfortunately.
Sometimes I use several one-dimensional arrays with the same indexes, tickets, time, prices. And search by index of necessary property. For example, if we get the index of a smaller time or a larger price, we obtain the ticket of the necessary order. Of course, it is a crutch, but it works very well.
I have done it this way:
The array is always sorted, a new order is inserted at the required point, with shifting of other orders, when an order is deleted there is a shift.
But this is in MT5
I have done it this way:
The array is always sorted, a new order is inserted at the right point, with a shift of other orders, when an order is deleted there is a shift.
But this is in MT5.
It would be nice to have code for shifting during writing, deleting and sorting. It's not a trivial task for me to sort the array structure by fields. Yes, and shifts too).
Shift code for writing, deleting and sorting would be good. It's not a trivial task for me to sort an array structure by fields. And shifts, too).
And probably the most interesting part: