[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 417

 

VladimirR:

But when an exit from the cycle occurs an "extra day" remains. And as a result the wrong answer will be printed.


In for you need to know for exactly what reason the exit occurred - day or TwoFarm. Then you will get it right.
 
rustein:

Help fix if orders open with SL, and if there are two opposing orders, for the second one it removes SL.... but this is not needed

What do you want?
 

I need it to trawl all open orders, but for some reason if there are 2 open orders, it deletes SL on the last one immediately after opening...

And it should trash all orders when indicator value is higher than OrderOpenPrice() for Buy and lower for Sell.

 
rustein:

I need it to trawl all open orders, but for some reason if there are 2 open orders, it deletes SL on the last one immediately after opening...

And it should trash all orders when indicator value is higher than OrderOpenPrice() for Buy and lower for Sell.


you forgot to add checks for Up and Dn (by analogy)
Up>0 && Up!=EMPTY_VALUE
 
sergeev:
you forgot to add checks for Up and Dn (by analogy)
...Thanks )
 
granit77:
Go through all the objects on the chart, find an object named lbl, take out the string FXRanger: Risk:Reward=x.xxx, parse it and convert x.xxx to double.
Please explain what "parsing" means and if it's not difficult, how to organize an object enumeration. I can order, but I haven't dealt with objects yet.
 
DhP:

Where is the source material?
What did I attach? There is nothing else, this file has been inserted into the indicators and it works
 
demlin:
What did I paste? There is nothing else, I pasted this file into indicators and it works

You didn't attach the source file with mq4 extension, but a compiled executable with ex4 extension.

 
demlin:
Please explain what "parsing" means and, if it's not difficult, how to organise the enumeration of objects. I can handle orders, but I haven't dealt with objects yet.
I believe that while searching through the objects, we must find the required Label and place its text into a string variable using the ObjectDescription() function.
Next, we "parse" the resulting string, i.e. parsing and extracting the information we need from it. We use string functions StringFind(), StringLen(), StringSubstr()
to find the position of "=" character in the "FXRanger::Risk:Reward=x.ххх" string and put the part of the string following it (х.ххх) into another string variable. Then use the StrToDouble() function to convert the string into the number you are looking for.

   int obj_total=ObjectsTotal();
   string name;   
   string myname="lbl";
   string mytext;
   
   for(int i=obj_total+1;i>-1;i--){
     name=ObjectName(i);   
     if(StringFind( name,myname,0)>-1){
       mytext=ObjectDescription(name);  
     }
   }
//далее парсим строку mytext
P.S.
This dancing is necessary because the indicator outputs data into objects, not buffers, and iCustom cannot be applied. And if you don't have the indicator code, you can't change anything inside it.
 

https://www.mql5.com/ru/code/10272

Good afternoon. Please help me to understand the buffers of the attached indicator. How to write in the code of the expert the conditions on opening, at colour change...Thanks.

Reason: