[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 885

 
Max747:
No one has been able to give me an answer... Does anyone have a clue?

Maybe you need to check PARASTEP and PARAMAX types and their values.
 
valenok2003:

Is this the only option?

1) write to a file

2) search for the required order and read the ticket

 

Unexpectedly encountered the following problem:

I wrote an EA, one of the functions of which is to open pending orders. But before opening another pending order, the program polls already placed orders (price) and opens a new one only if there is no already placed order with the same price. I am working on EURUSD.

for (Price=Max_Price-Step*Point; Price>Ask+10*Point; Price=Price-Step*Point) // go from the maximum to the current price
{
int N=0; //order counter
for (int i=1; i<=OrdersTotal(); i++) // loop through orders
{
if(OrderSelect(i-1,SELECT_BY_POS)==true) //select order
{ //analyse open order
if (Price==OrderOpenPrice()) //if price is the same
{
N=N+1;
}
} //select the next open order
}
if(N==0) //if no order with the same price is found
{ //open order
Alert("New BUYSTOP ", Price);
int Ticket=OrderSend(Symb, OP_BUYSTOP, Lot, Price, 0, 0, Price+TP*Point);
if (GetLastError()>0)
Alert("Error ", GetLastError());
}
} //Come to market

Everything is fine until the max is 1.3980, but as soon as I set 1.4000 the program stops seeing orders with the same price (counter N remains null) and generates the same orders.

It is interesting that if we set the maximum price 1,5000, then up to 1,4000 all is normal and from 1,3980 begins duplicating orders with the same price

WHAT COULD IT BE????????

And the situation repeats on the platform of another dealing centre

Files:
 


I am running in the tester, I can't understand why this error may appear: OrderModify error 1 (No error, but the result is unknown).

I use trawl function, there is nothing else, I check both min stop level and point size and everything that is required, the error does not always appear.

Is it a crude error or is it tolerable to run on real account?

 
Infinity:


I tried it in the tester, I don't know where it may cause such error: OrderModify error 1 (No error, but result is unknown).

I use the trawl function, there is nothing else, I check min stop level and point size and all that is required, the error does not always appear.

I have tested in the tester, I cannot understand what kind of error it is.


https://docs.mql4.com/ru/trading/OrderModify it says here about this error
 

Here is the function :

double ObFindObjectsByPrefix(string Prefix)
{

string OBJECT_PREFIX="LEVELS";
double price_max;
int L = StringLen(Prefix);
int i = 0;
int time_min=TimeCurrent();
while(i < ObjectsTotal()-1)
{
string ObjName = ObjectName(i);
if(StringSubstr(ObjName, 0, L) != Prefix)
{
i++;
continue;
}
double price=ObjectGet(ObjName,OBJPROP_PRICE1);
if (MathAbs(price-Bid)/Point<m)
{
int time1=ObjectGet(ObjName,OBJPROP_TIME1);
if (time1<time_min)
{
time_min=time1; price_max=price;
}
}
}
return(price);
}

what's wrong with it, why isn't it working ?

look for the longest segment with a prefix and return the price value.

 
https://www.mql5.com/ru/code/8976 do you happen to have a normal, working .dll file for this indicator? I can't compile it myself(
 

People, where should I write to get MT5 to make a decent translation into German? It's a shame... It breaks to "save" (save) files in CSV format, to select sounds for different "events" (events) and to end programmes by clicking on "Exit" (from the building, not from the programme)

 
valenok2003:

You may need to check the PARASTEP and PARAMAX types and their values.
They do not change because they are extern types. The values are chosen on the chart itself with the indicator together!
 
YDzh:

People, where should I write to get MT5 to make a decent translation into German? It's a shame... It's breaking to "save" (save) files in CSV format, to choose sounds for different "events" (events) and to end programs by pressing "Exit" (from the building, not from the program)


If you cannot write in the mql5.com forum, there is only one way out - write to the UN.

PS. We are already fixing the German interface by posting at the mql5.com forum. Thanks for the message.

Reason: