Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 488
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
No, this topic is on both mql4 and mql5
There's a topic at https://www.mql5.com/ru/forum/6343.
Don't get confused ;)
Here you can ask how to convert from a 4 to a 5, for example...
mql5 distinguishes between positions and orders. A position is the result of a trade. And a trade is the result of triggering of an order.
First of all, a trade request is sent to the server, and either a pending order (if the request was to set one) or a market order (if the request was to open a position) appears.
If the market order triggered (a trade occurred), a position appears (or an existing position is modified) as a result of this trade.
On a hedge account, there can be many separate positions (including multidirectional), on a netting account there can be only one position.
So, to loop through all positions, you need to organize the loop by their number - respectively, use PositionsTotal() instead of usual for mql4 OrdersTotal().
If we need to search all orders in mql5, then (in mql5) we will use the usual for mql4 OrdersTotal().
Yes, I see.
But, where to insert this index, it's still unclear?
I need to create multidimensional dynamic arrays, plus copy e.g. a one-dimensional array into a two-dimensional one
Is there any library that would allow working with dynamic arrays?
I need to create multidimensional dynamic arrays, plus copy, for example, a one-dimensional array into a two-dimensional one.
I have never even thought of checking the possibility of copying a one-dimensional array into a two-dimensional one. But the question immediately arose: "What happens if the number of elements of a one-dimensional array is odd?
There seems to be a library in mql4, but the documentation is only for mql5. And I don't know how it will work in mql4.
Can you please advise why the EA stops seeing its orders (opens several orders instead of one) if there are other orders in addition to its orders? If only EA's orders - no problems. When opening an order the "Medjik" is set and onlyorders with this "Medjik"are selected according to the conditions of order opening.
How to program a crutch/indicator/script (as an indicator with tabs "about, general, input parameters, colours, display") for MT4 so it will take data from .csv file, like format of source file:
I.e.the indicator took the recorded data from a file and put itwith a comment on a chart in the form of bars (TF, TA) or a coloured band(EA) with parameters of extent exactly "day" (from the border to the border of the vertical day separators on МТ4), for lines selection of the line colour, line type, selection of the text colour and comment size and adding to the line a comment segment, for example "TF - 1,192" the second line "TF - 1,1733" which are taken from the corresponding lines of the file. The first digit of the line EUR;TF;1.192;1,1733 is taken from the line EUR;TF;1.192;1,1733 as a distance and the second digit from the line 1.192 and the end of the distance 1.192.
There are also ranges, for example EA, the principle is the same from the beginning to the end of the day but the price is different and the line begins and ends with CHF;AB1;1.03484132734247;1.02549513556164 beginning is1.03484132734247 end of the range1.02549513556164. It runs when you turn on MT4 (as a usual indicator on the gafik), every day on the chart and adds all the data exactly for the current day once, all the lines applied earlier are not deleted from the chart and do not duplicate it. With all this it selects and displays all of the segments and ranges for the day, only where the active window is now and on other active windows (i.e., where it is running) (i.e., it opened a pair and the indicator drew all of the segments and ranges of the current day and calmed down and so on for the pairs).
For example, how should look the tab of indicatorInput parameters:
I tried to scribble myself, but do not get a damn thing, but seemed easy (but I'm a humanitarian, what can you do....) Please help a drowning !!!!!!!!
Example Line: http://SSMaker.ru/35997bd0/
help please...brain boiling from not knowing how to code...
inkosto:
Добрый день! нужна помощь гуманитарию ...
Please insert the code correctly.
It's even clearer:
I need to integrate zigzag into my indicator (now it's counting by handle)
The thing is, my indicator does not use OnCalculate().
So how do I make the zigzag work and where do I get rates_total and prev_calculated for its calculation?