[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 135

 
MaxV42 >> :

Can you give me a hint, please?

I have a terminal running at home and an EA is trading on the chart.

If I run the terminal on another PC (at work) and set the same EA with the same parameters on the chart

1. Will my connection with server on my home PC be interrupted?

2. If the connection with the server on my home computer is broken, will the Expert Advisor "pick up" the open orders on my work computer?

Thank you.

1. no

But you can have double openings.

 
An advisor in your case is no different from a human being. Let's say two people are trading on different computers and on the same terminal. Both make trades and do not depend on each other, like two EAs on different computers. They do not see each other, they do not see trades of the other and act according to their situation. If one computer loses connection, only one of them will trade. But the connection will not be broken by the presence of two EAs on different computers.
 
MaxV42 >> :

Can you give me a hint, please?

I have a terminal running at home and an EA is trading on the chart.

If I run the terminal on another PC (at work) and set the same EA with the same parameters on the chart

1. Will my connection with server on my home PC be interrupted?

2. If the connection with the server on my home computer is broken, will the Expert Advisor "pick up" the open orders on my work computer?

Thank you.

If your EA has a magic number (magic number or ID or similar) in its parameters, you will have less problems. Set the same magic number on both terminals.

'What is 'magik' and price slippage?'

If the connection is interrupted, the other EA will "pick up" trades using this magic number. We should actually clarify this point.

But I suppose that if a magician is included in the OrderSend() function, then information about it is stored on the server!

Well, I hope the experts can correct me if I'm wrong. In the article 'MagicNumber - "magic" identifier of the order'.

nothing is said about that.

It is true that double opening can sometimes occur.

 

Can you please tell me how to make a script periodically executed, for example 10 seconds before the creation of a new bar, in the period of M5 chart

(ie, I want it to be executed in (hour:min:sec) x:04:50; x:09:50; x:14:50).

 
VeDMeD писал(а) >>

Can you please tell me how to make a script periodically executed, for example 10 seconds before the creation of a new bar, in the period of M5 chart

(ie, I want it to run in (hour:min:sec) x:04:50; x:09:50; x:14:50).

put the script code into the construction

bool bWas;

while (!IsStopped())
{
  // проверяем время
  if (MathMod(Minute()+1, 5) ==0)
  {
      bWas=false;
      if (Seconds()>=50 && ! bWas)
      {
        // делаем то что вам надо 
          bWas=true; // только один раз
          RefreshRates(); // обновляем данные валюты
        //........
      }
  }
}
 
MaxV42 писал(а) >>

Can you give me a hint, please?

I have a terminal running at home and an EA is trading on the chart.

If I run the terminal on another PC (at work) and set the same EA with the same parameters on the chart

1. Will my connection with server on my home PC be interrupted?

2. If the connection with the server on my home computer is broken, will the Expert Advisor "pick up" the open orders on my work computer?

Thank you very much.

The computers will work independently.

You need a clear control of the situation here.

Given the limited possibilities, all we can suggest is to arrange a "conversation between EAs" when there is a pending order with certain parameters.

The 1st PC can move the order down a bit - like "I'm trading here", so you, 2nd PC, should not interfere yet.

2nd PC can adjust the order back to its place - like, yeah, I got it, I'll keep quiet...

It's not hard to make up an algorithm to set the main PC (where the master PC is). By understanding their peaceful conversation properly, the PCs will always know which one is the main one and which one is on the sidelines.

The frequency of "conversation" should be small, otherwise the broker will consider this phenomenon undesirable and may prohibit the use of Expert Advisors.

 
How do you find a bar at, say, the five-minute mark at the start of the day? I can't really figure it out. Thank you.
 
datetime dtD1 = iTime(Symbol(), PERIOD_D1, 0); // получили время начала текущего дня
int shiftM5 = iBarShift(Symbol(), PERIOD_M5, dtD1); // получили смещение в таймсерии M5
double priceDayOpenM5 = iOpen(Symbol(), PERIOD_M5, shiftM5); // работаем со смещением в таймсерии M5
 
The proposed solution does not take into account the GMT offset.
 
DrShumiloff >> :
The proposed solution does not take into account the GMT offset.

And how can the GMT offset affect the M5 time series relative to D1?

Please enlighten Dear DrShumiloff.

Question from a newbie with 20 years of programming experience.