Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 324
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
Is this correct?
for(int i=1; i<=OrdersTotal(); i++) // Order loop
{
if(OrderSelect(i-1,SELECT_BY_POS)==true) // if the following
{
int OT=OrdersTotal; //the number of open orders in the terminal
double Price=OrderOpenPrice(); // Price of the selected order
double Mas [Price][OT]; //array for putting in order all the orders
or
for(int i=1; i<=OrdersTotal(); i++) //order loop
{
if (OrderSelect(i-1,SELECT_BY_POS)==true) // if there is a
{
double Price=OrderOpenPrice(); // Price of the selected order
double Mas [Price]; //array to arrange all orders by price?
Is this correct?
for(int i=1; i<=OrdersTotal(); i++) // Order loop
{
if(OrderSelect(i-1,SELECT_BY_POS)==true) // if the following
{
int OT=OrdersTotal; //the number of open orders in the terminal
double Price=OrderOpenPrice(); // Price of the selected order
double Mas [Price][OT]; //array for putting in order all the orders
or
for(int i=1; i<=OrdersTotal(); i++) //order loop
{
if (OrderSelect(i-1,SELECT_BY_POS)==true) // if there is a
{
double Price=OrderOpenPrice(); // Price of the selected order
double Mas [Price]; //array to arrange all orders by price?
1. OrdersTotal returns the total number of orders, but they are numbered starting from zero. That's why the loop must be i < OrdersTotal()
2. The array must be declared double Mas[];. If the order is successfully selected, the array size should be increased, because we don't know how many orders there are in total.
3. The array string index must be in square brackets. Mas[i] = Price;
As a result, both of them are wrong.
1. OrdersTotal returns the total number of orders but they are numbered starting from zero. That's why the loop should be i < OrdersTotal()
2. The array must be declared double Mas[];. If an order is chosen successfully, the array size should be increased, because we don't know how many of them there are...
3. The array string index must be in square brackets. Mas[i] = Price;
As a result, both of them are wrong.
Thank you very much!
1. OrdersTotal returns the total number of orders, but they are numbered starting from zero. Therefore, the loop must be i < OrdersTotal()
2. The array must be declared double Mas[];. If an order is chosen successfully, the array size should be increased, because we don't know how many of them there are...
3. The array string index must be in square brackets. Mas[i] = Price;
As a result, both of them are wrong.
Will we get a one-dimensional array of order prices in this case?
double Price=OrderOpenPrice(); // Price of the selected order
double Mas[i] = Price; //array for putting in order all the orders
for(int i=1; i<OrdersTotal();) // Order loop
{
if(OrderSelect(i-1,SELECT_BY_POS)==true) // if there is a next
i++;
}
And in this case, it will be a one-dimensional array of order prices?
double Price=OrderOpenPrice(); // Price of the selected order
double Mas[i] = Price; //array for putting in order all the orders
for(int i=1; i<OrdersTotal();) // Order loop
{
if(OrderSelect(i-1,SELECT_BY_POS)==true) // if there is a next
i++;
}
Selected ==true may not be written.
No. It's more or less like this.
The highlighted ==true may not be written.
Thank you very much!
Hi. Can you tell me how to get rid of the closing and opening of a pending order on each bar? I need it to open and wait for the corresponding order to open.
Hello. Does anyone here use indicators from ClasterDelta in their work? I have a question about the automatic use of data from the VolumeProfile indicator. The thing is that this indicator does not return anything but only draws a histogram of trend lines. But when putting the cursor over this line, the value of volume traded on this tick will appear. How to get this information out of the indicator!
Any thoughts?
As I have encountered before studying the classes, again there are nuances that are not described in the articles or somewhere so hidden that it is not possible to find through a search engine. A whole day spent in vain looking for explanations. For example what this symbol means and how it affects if not. As seen below in the example of stati, first it is there and then it is not: &
Also this symbol is not clear what it means: ~
*