Questions about MQL4 - page 9

 
Is it correct to assume that:
1. Mutual closing of orders takes place automatically without market maker intervention?
2. Modification of open orders (if the accepted distances are respected) takes place automatically without intervention by the market maker?
3. Deletion and modification of pending orders (if the accepted distances are respected) takes place automatically without intervention of a market maker?
 
Is it correct to assume that:<br / translate="no"> 1. Mutual order closures are automatic without market maker intervention?
2. Modification of open orders (if the accepted distances are respected) takes place automatically without intervention by the market maker?
3. Deletion and modification of pending orders (if the accepted distances are respected) happens automatically without any intervention from the market maker?

this is not correct. you need to ask your broker how the orders are processed. automatic processing is allowed. but even on our demo server sometimes the automatic processing is disabled and manual confirmations are performed.
 
Slawa,
thank you very much for the clear answer.

Should we assume that the same applies to the automatic TrailingStop pull-up?
Are there any differences at all for the market maker in terms of the source of controlling influence formation (EA or MT)?
 
Yes. Since the broker does not know who is moving the stops - the trader manually, experts (or scripts) or the client terminal with the trailing stop mechanism.
 
1) why does the indicator get Bars==0 in init() after recompilation?

2) it's relatively slow to access the array elements. can it be accelerated only by cumbersome constructs or something else?
   static int know; static double caa,cbb,ccc,cdd,cee,cff, cgg; if(b-know!=0){ if(b-know==1){ caa=cbb; cbb=ccc; ccc=cdd; cdd=cee; cee=cff; cff=cgg; cgg=Close[b+6];/*vzad po istorii*/ }else if (b-know==-1){ cgg=cff; cff=cee; cee=cdd; cdd=ccc; ccc=cbb; cbb=caa; caa=Close[b]; /*vperjod*/ }else{ caa=Close[b]; cbb=Close[b+1]; ccc=Close[b+2]; cdd=Close[b+3]; cee=Close[b+4]; cff=Close[b+5];cgg=Close[b+6];}  know=b; }
 
Slawa,
thanks again. It's more than clear.

Myxu,
try using ArrayCopy();
 
Slawa, you often help me with important details so I will address you personally.
If in one window the Expert Advisor and the script are working at the same time, in case they approximately at the same time give orders to the server for modification:
- EA modifies Buy at time t_o, Sovet=OrderModify(...)
- script modifies BuyLimit at time t_o +1ms, Script=OrderModify(...)
Further events:
-server returns TRUE on successful execution of modification (I do not know which) order,
(which of variables will acquire value TRUE - Sovet or Script ?)
and after 1ms...
-server returns FALSE on successful execution of modification (I don't know which) of order

Question.
1. Is it correct to assume, that requests to server are configured in such a way, that they are named and server's responses will not be mixed up, and each of the responses will be returned to its own OrderModify() ?
2. If not, is there any routine way to distinguish between server responses ? (other than the practice of creating another order after receiving a response to the previous one) ?

(I've got some more similar questions; if not crucial, please answer them in MQL4 forum, the question is duplicated there, and if it's possible, the discussion can be held there, because it's more convenient to present the codes there).
 
quotation from new dictionary
===
There is only one thread, which is started in a program trading context, to perform trading operations from experts and scripts. Therefore, if this context is occupied by a trade operation of an EA, another EA or script cannot call trade functions at that moment due to error 146 (ERR_TRADE_CONTEXT_BUSY). The IsTradeAllowed() function must be used to detect the possibility to perform trade operations. For the clear separation of access to the trade context you can use the semaphore based on the global variable whose value must be changed using the GlobalVariableSetOnCondition() function.
===
You cannot trade several EAs (or an EA and a script) at the same time. In error #6 branch there is an example of how to handle the situation using semaphore
 
Slawa,
thanks for your reply. Very important information. Some things are clarified.

But there are still questions.
Does the fact that
There is only one thread for executing trades from EAs and scripts
...
to execute orders in one EA or script according to the following schemes?:
a=OrderModify(..number1); c=OrderModify(..number2)
;


OrderModify(..number1); OrderModify(..number2);


Is it correct to assume that:
- in the first example, OrderModify(..number2) will not start executing until the assignment operator a= is executed after receiving the server response to OrderModify(..number1)?
- in the second example, OrderModify(..number2) will start executing immediately without waiting for the server to respond to OrderModify(..number1)?

 
in both cases, the start-up of the functions will be sequential. unlike triplets, all functions (meaning primarily trading functions) are now synchronised