Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 988

 
mt4trade:

Paladin80, everything you write about, I know very well. And about freezing and unfreezing and the boundary, etc.

The only question was whether the pendulum should be deleted and put a regular one, if a strategy is required (!).

That is, the pendulum at the "now" price will not work (and we need it to work and it is unacceptable to wait).

Thank you!

If only the DCEs in their service were as scrupulous as you are!
 
borilunad:
If only the DCs at their service were as meticulous as you are!
Believe me, it doesn't matter. :)
 

Is it possible to programmatically request from the brokerage company a permissible transaction limit?

There is such an error:

148

ERR_TRADE_TOO_MANY_ORDERS

The number of open and pending orders has reached the limit set by the broker


And it is:

ACCOUNT_LIMIT_ORDERS

Maximum allowed number of active pending orders (0 - no limit)


This is not exactly what we need.

You need the first option, but not as an error.

Of course, an error is usually sent by brokerage companies but we would like to consider it beforehand. We can set it manually, but it is not the most convenient variant to bother a user to find out and set it.

To be honest, I couldn't even find the parameter I wanted in version 5.

 
mt4trade:
Suppose that there is a pending order that has already been set.
We use the indicator to move its price.
At one moment, the order cannot be modified because the new calculated price for it has fallen into the prohibited range due to the stop signs like Ask/Bid +/- MarketInfo(Symbol(), MODE_STOPLEVEL / MODE_FREEZELEVEL) .

But the order has to be opened "by the market".

What can we do in this case?

Can we delete the pending order and open a new one by the market?

Or, is it possible to change the pending order into an open one?

You can't 'turn' a pendent into an open one. You can only enter on the market.

Your description is correct: you have to delete the pending (or limit) and enter the trade on the market.

You do not have to pay attention to what is close to you. If you personally need to do something through the "right ear", do it. Every trader profits from their decisions.

 
Chiripaha:

Is it possible to programmatically request from the brokerage company a limit on the number of trades?

...

Try AccountInfoInteger(). Here is a script for example:

#property strict

void OnStart()
  {
   long amount=AccountInfoInteger(ACCOUNT_LIMIT_ORDERS);
   Print("Максимальное кол-во отложенных ордеров (0-ограничений нет) = ",IntegerToString(amount));
  }
 
digital:

Why does the debugger "crash" when debugging the indicator (because it accesses the array boundaries), but at the same time everything is drawn normally on the chart?

MT4 build 950, Alpari demo.

The indicator is attached.

Yuri, you are asking this question to the wrong address because this indicator has a specific author from whom you must have downloaded it: https://www.mql5.com/en/code/7116.

It would be absolutely correct and more correct to ask him these exact questions. He will answer you more quickly and accurately. Translate your question into English via Google: https://translate.google.ru/

 
paladin80:

Try AccountInfoInteger(). For an example script:

I've already tried it - it gives a limit on the number of pending orders, but in no way a limit on the number of trades. And I need exactly the number of deals. Different brokers have different amount on different types of accounts, so there is a need to request limits.
 
Chiripaha:
I've already tried it - it gives a limit on the number of pending orders, but no limit on the number of trades. And I need exactly the number of trades. Different brokers have different amount in different accounts, so I need to ask for limits.
I see. So you need to know how many open positions you can have?
 
paladin80:
I see. So you need to know how many open positions you can have?
Yes. Exactly deals. Frankly speaking, I understand from mistake 148 that our broker considers both deals and pending (limit) orders. But in my case there are no pending orders because I enter the market, that's why we are speaking about deals.
 
Chiripaha:
Yes. Exactly the trades. True, as I understood from error 148 description, the broker takes into account both trades and pending (limit) orders. But there are no pending orders in my case as I enter the market, so we are speaking about deals.

1) I was also very interested in this topic and made an experiment. I have a demo on MetaQuotes-Demo, using the script I wrote above, I found that the maximum number of orders (as I understand both open and pending, their amount) on this server = 200. I opened 200 positions manually, but when I tried to open 201 positions error message popped up: 2015.12.29 08:27:02.029 '7363947': order #0 sell 0.01 EURUSD at 1.09650 failed [Too many open orders].

2) 2 out of 200 open positions were closed. I created 2 pending orders and failed to open the 3rd one. Also failed to open a new position. I.e. 198 open positions + 2 pending orders = limit for any order type.

So I come to the conclusion that ACCOUNT_LIMIT_ORDERS shows the maximal number of all orders on the given server, including positions.
Reason: