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

 
globad:
I see. And if you simultaneously place orders on one account from multiple terminals, they will not be placed one after another?


And there are variations possible here. For example, we attach one and the same EA to one and the same currency pair in two terminals. But we set a different magik in each EA. As a result, the order of one EA will be accepted by the other EA as someone else's one and the second EA will also open a position when there is a signal.

And another option - both EAs have the same magiks. One Expert Advisor has opened a position based on the signal. The second one has detected the signal and saw that the position has been already opened. As a result, it will not open anything and will switch to the monitoring mode.

I do not know what will happen if both EAs see the signal and no position at the same time. They will simultaneously try to give orders to the server to open a position. Most likely, there will be two open positions. If this is true, we can get around this problem by having the second EA sleep for the amount of time it takes the server to respond to the trade request from the first EA. In this case, the first EA will place the order first, and only then the second EA will detect that there is a signal and the order already exists.

 

I don't fucking get it, what's wrong ..... I've never been good with functions, especially their description. Can someone give me a detailed answer? This is a forum for programmers......

int start()
  {
int TotalOrders, TotalOrders1;
int i=1;
 
if (b!=Bars){
b=Bars;
   if (iCustom(NULL, 0, "",set,up,2,1)!=0){
     OpenFirstOdrer();
      }
      
  return(0);
  }
  
}
//+------------------------------------------------------------------+
//Открыть ордер
double OpenFirstOdrer();  
 {
   int ticket;
   double BySignal;
   
         if (iCustom(NULL, 1, "",set,up,2,1)!=0){
     
         }
   
   return (0);
 }  

Every time an error gets harder and harder. )))) It feels like... ))))) Anyway, what's wrong?

 
nikelodeon:

I don't fucking get it, what's wrong ..... I've never been good with functions, especially their description. Can someone give me a detailed answer? This is a forum for programmers......

Every time an error gets harder and harder. )))) It feels like... ))))) Anyway, what's wrong?

And what do you want to achieve with a function that does nothing?
 
drknn:


And we can make some variants of it. For example, we connect one and the same EA to one and the same currency pair in two terminals. But we set a different magician in each EA. As a result, the order of one EA will be considered by the other EA as someone else's order and the second EA will also open a position when we get the signal.

And another option - both EAs have the same magiks. One Expert Advisor opened a position on the signal. The second one has detected a signal and saw that the position has already been opened. As a result, it has not opened anything and has switched to monitoring mode.

I do not know what will happen if both EAs see the signal and no position at the same time. They will simultaneously try to give orders to the server to open a position. Most likely, there will be two open positions. If this is true, we can get around this problem by having the second EA sleep for the amount of time it takes the server to respond to the trade request from the first EA. In this case, the first EA will place the order first, and only then will the second EA find out if there is a signal and the order already exists.

Thank you for the tip. It would be good if the orders are placed simultaneously, or almost at the same time. I have checked the above variant using the handheld tool by opening several terminals on the real account. All orders start to be processed simultaneously and are placed almost at the same time. That's why I'm looking for an easier EA or script. It only has to place one order at a certain distance from the price at a certain time with tp and sl. Preferably, it should also be able to delete this order after a certain period of time.

We open several terminals on one account. We send such an EA to each of them and as a result, we have a number of orders at the necessary price. The time spent for setting these orders will be approximately equal to the time needed for one order. The only thing that remains is to find such an EA. Maybe, someone knows it?

 
globad:

All that remains is to find such an advisor. Does anyone know?

Wouldn't it be easier to order one, if you really need one? You will save time and effort, and with a proper trading system, the money spent on it will soon be paid back.
 
drknn:
Wouldn't it be easier to order it if you really need it? You'll save time and effort, and with a proper trading system, the money spent on it will soon be paid back.
I think there are plenty of such goodies ready-made. The EA opens one deal at a given time...
 
artmedia70:
And what do you want to achieve from a function that does nothing?

No, there was no need to put a semicolon there....
 
nikelodeon:

No, there was no need to put a semicolon there....

What does the function do anyway?

//+------------------------------------------------------------------+
//Открыть ордер
double OpenFirstOdrer() 
 {
   int ticket;
   double BySignal;
   
         if (iCustom(NULL, 1, "",set,up,2,1)!=0){
     
         }
   
   return (0);
 }  

It returns zero anyway... So I asked the question without looking at the syntax.

 
Can you tell me if Meta Trader 4 allows you to open a deal at a given time and close it after a certain number of pips from the opening deal. Maybe a script can be written, does anyone knowhow to do it?
 
kellin:
Can you tell me if Meta Trader 4 allows you to open a deal at a given time and close it after a certain number of pips from the opening deal. Maybe a script can be written, do you knowhow to do it?
)) I have the same question, only a variant with orders. delete also by time.
Reason: