[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 518

 
FAQ:

What prevents you from telling the EA that if there are more orders than 123 then there are less orders by 123 ?

How can it tell OrdersHistoryTotal() ?
 
sss2019:


Well in this case why error 129 can be there, what can be changed in this code at all, there are specific numbers.


ERR_INVALID_PRICE129Incorrect bid or ask price, possibly non-normalised price. It is necessary to refresh the data after a delay of 5 seconds or more using the RefreshRates function and try again. If the error persists, it is necessary to stop all trading attempts and change the program logic.
 

Have you tried this?

RefreshRates();
OrderSend(Symbol(),OP_BUY,Lots,Ask,10,Ask-50*Point,Ask+75*Point,ExpertComment,MagicNumber,0,Green)
 
ask:

How do you say OrdersHistoryTotal() ?

int MyTotal = OrdersHistoryTotal();
if(MyTotal>123){MyTotal-=123;}
 
FAQ:



THANK YOU! HUGE!
 
Roman.:

Have you tried this?


Thank you, I will try it, but what kind of delay can there be, everything is executed on the fly, the condition is to open an order.
 

Unfortunately the reality is far from the idea...

usually when setting a pending order RefreachRates() is not needed (if you put the order far from the price), but they recommend to do this operation in any case, although I think in yours it doesn't help much, so you just ran into requotes...

 
FAQ:

Unfortunately the reality is far from the idea...

usually when setting a pending order RefreachRates() is not needed (if you put the order far from the price), but they recommend to do this operation in any case, although I think in yours it doesn't help much, so you just ran into requotes...


Refreshrates doesn't help, same errors, maybe something else you can try:?
 
sss2019:

Refreshrates does not help, same errors, maybe something else can be tried:?

The main thing is that there are no errors in the sell orders, although they are as close.
 
sss2019:

The main thing is that there are no errors in the sell orders, although they are placed just as close.

Although errors 130 and 136 appear in pending buy and sell orders, and error 129 only in market buy orders