How to ensure that the EA only works on the chart where it was first dropped - page 9

 

joo:

What difference does it make to us whether "the first one" does it or "the wrong one" does it?

The main thing is that BOTH should not start trading at the same time ;)
 
joo:

Yes, but you still have to use the settings file. Otherwise, the Expert Advisor may get the right to trade with "wrong" settings.

What if the user likes to unplug the plugs? Or many mums of users usually do so - "so that the coputer does not smoke at night" - what will happen to chr file then? That's why we need check on the file with time, and traded instruments are written in the settings file, moreover, if it is impossible to trade on an instrument at a certain time of day, nothing will be able to trade on it.

If it passes the check, it will trade with the necessary settings. And if the work will be carried out absolutely the same, what do we care who does it - "the first one", or "the wrong one"?

Well, setting control is elementary, you don't even need to read the chr, although there is a lot of stuff in there...

And the user will not accidentally do anything with chr, these files are kept and updated by the terminal. The Expert Advisor is thrown on the chart - a record appears in the file, the Expert Advisor is removed - the record disappears. That is why for me the variant with them had an obvious advantage "BEFORE" (I hope you know who this nickname is for :) )

 
ForexTools:
The main thing is that BOTH should not start trading at the same time ;)


I think that in order to avoid "accidents", we need to introduce accidents of our own :)

int init()
  {
   //проверка признаков запуска другой копии эксперта
   MathSrand(TimeLocal());
   Sleep(MathRand());
   //проверка признаков запуска другой копии эксперта и возможно останов данной копии эксперта
   return(0);
  }
 
Fuck those kind of accidents. First of all, they're not working, and secondly, sleep for half a minute.
 

On the second page of the thread, option 1.

---

- Doctor, everyone's ignoring me.

- Next!

 
gip:

On the second page of the thread, option 1.

---

- Doctor, everyone's ignoring me.

- Next!

In this case, it is not the clone that will have to stop trading, but the original one. However, now I also think this dilemma is farfetched, if the EA cares so much about which chart it uses, let it have a symbol and timeframe as parameters and check them on startup.


P.S. There is no guarantee that a global variable will not be deleted by an inquisitive user.
 

After all, how many years in programming, but I observe the same behavior of Russian programmers - inability to self-organize and learn.

Everyone totally ignores the code formatting standards, each of them makes something of their own. If mastered, they are categorically unable to switch to a better one.

Programming templates are not at all a science for Russian minds.

As a result, we end up with metatrader products which are not adapted to perform their main functions...

 
Candid:
In this case it is not the clone but the original that has to stop trading. However, I now consider this dilemma farfetched too. If the EA cares so much about the chart it uses, let it take the symbol and timeframe as parameters and check them at startup.


Well, you could have read all three options and understood them, couldn't you? But you didn't. The second option solves the problem you mentioned.

Also, the start procedure code should not be based on the values of local variables.

We are going around in circles, getting lost in the middle of nowhere.

 
gip:

After all, how many years in programming, but I observe the same behavior of Russian programmers - inability to self-organize and learn.

Everyone totally ignores the code formatting standards, each of them makes something of their own. If mastered, they are categorically unable to switch to a better one.

Programming templates are not at all a science for Russian minds.

As a result, we end up with metatrader products which are not adapted to perform their main functions...

Still, russian programmers are considered some of the best, the americans invented windup, and there are still holes.
 
sanyooooook:
Still, russian programmers are considered to be among the best, the americans invented windup, there are still holes


They don't. The best are considered to be Indian bullheaders :)))

Self-importance...