[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 171

 
Zhunko:

They are the ones that are not supported by the server. Locally they work. I still use 225.

How's that?


Like this won't do?

//#define LAST_BUILD_KNOWN 406 на 432?

And then there's something like that to exclude, so it doesn't matter what build...

 
Roman.:


Like this won't do?

and then there's something like that to exclude, so that you don't give a damn about the build...

There are no functions or macros in MQL4 that return the build number.
 
Zhunko:
There are no functions or macros in MQL4 that return the build number.


Got it. Senkue.

I thought it was possible to do everything by analogy with removing a piece of code from the tutorial fi nd responsible for owl trading only on a certain account, password, etc.

 
Hello all. Please help.

Here's the gist: There is a bot which automatically places pending orders, at a certain price.

We need to put a ban on placing an order, provided that the order or a deal at that price are open.

I have been trying for three days and no luck.
 

there are several options.... do the test.

//
// проверим среди Выставленных ордеров /сработавших/ - есть ли Байка
//
void CheckOrdBye()
{
  int total = OrdersTotal();
  int TotalOpenOrders = 0;
  for( int cnt=0; cnt<total; cnt++){
     if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES) == true)  {
        if (OrderSymbol()==Symbol() ) {
            if ( OrderType() == OP_BUY)   { OrdYN = 1; return;}
            if ( OrderType() == OP_SELL)  { OrdYN = 2; return;}
        }
     }
  }
}
 
bestfx:
Hello all. Please help.

Here's the gist: There is a bot that automatically places pending orders, at a certain price. ...

Put this in front of the order sending block:
if (OrdersTotal()>0)
{  for (int i=OrdersTotal()-1; i>=0; i--)
   {  if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
      if (OrderSymbol()!=Symbol()) continue;
      if (OrderOpenPrice()==bad_price) // bad_price - значение цены при котором не хотите выставить очередной ордер
      return(0);
}  }
 
Aleksander:

there are several options.... do the test.



Could you please comment on the code? It's not clear what to do.
 
paladin80:
Put this before the order sending block:


What if there are e.g. 30 orders?

The essence is the following: two opposite deals with a difference of 40 points from the averaged price up to three decimal places are placed.

Let's say 1.251 for eur/usd i.e. buy 1.253 sell 1.249 then the market for example clips the buy price and comes back to 1.251 and now it places two more orders at the same prices. And while the market was moving to the buy price the script could place as many orders more and they should be dealt with the same way, i.e. one price = one order. How to implement this?

 
bestfx:


What if there are 30 orders, for example?

The essence is the following: two opposite deals with a difference of 40 points from the averaged price up to three decimal places are placed.

Let's say 1.251 for eur/usd i.e. buy 1.253 sell 1.249 then the market for example clips the buy price and comes back to 1.251 and now it places two more orders at the same prices. And while the market was moving to the buy price the script could place as many orders more and they should be dealt with the same way, i.e. one price = one order. How to implement this?


Just do the Magic == price
 
FAQ:

Just do the Magic == price

Could you be a little more specific?