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

 
Candid:

Can you elaborate on where to look for this set...?

You can see in the picture. "Save" - the set-file will be written with the set parameters. "Load" - the specified set-file will be loaded and external variables will be set. They are stored in the directory experts/presets.
 
granit77:
On the picture you can see. "Save" - the set-file will be written with the set parameters. "Load" - the specified set-file will be loaded and external variables will be set. They are stored in the directory experts/presets.

That is, if the user doesn't create it, it won't exist. So, this is not a solution for a dummy.


P.S. More precisely, not for a professional, because saving the user from "unnecessary" actions is one of the priority tasks of a professional.


P.P.S. Do not think that it was purely a polemical gimmick, I am not particularly fond of experts, so in fact did not know where they should be stored, so thanks :). Although of course before asking I made sure my terminals didn't have such files.

 

It may be late, but I have a thought - if it's an EA, you can put a pending one at a crazy price and with the right ID, for example in magik - there's certainly nothing you can do about it....

 
xrust:

you can put a pending order at an insane price and with the right ID, for example in magic - there's certainly nothing you can do about it....

it solves the problem of semaphores and restarts but does not solve the problem of binding to a certain chart and restarts of the terminal - the order will still hang when the terminal crashes :(
 

Any EA has a few (for example) adjustable (optimisable) parameters for at least one pair, the author does not mention any parameters of the EA at all, if he throws the EA on a chart and it just works, then his code already has all the parameters and settings at some point in time written), then it is not clear how he optimises it (to check the workability at least), it seems we are talking about some abstract and then not an Expert Advisor ))

 

... It looks a lot like a script that is being launched on all kinds of charts and it places orders, but it needs to place the first order while the others get "sad" )

 

Actually, in the context of the solution, this question is not important, the author is looking for a universal and most beautiful method for this situation - and I understand it :)

 

Programmer's actions :

1 Creates a text file with the settings.

2 Transmits it to the user for operation.

3 Explains to the user where to put the files sent to him.

User action:

1 Opens as many and as many charts as he wants.

2 Tosses as many copies of the Expert Advisor on the charts as needed.

3 Tampers with terminal: starts it, sometimes unplugs it, sometimes drops system unit on the table.

Actions of experts on the terminal

If the destructive actions of the user did not cause physical damage to the computer:

1 Expert first started (started as copy, started after compilation, started after terminal crash, etc.) Checks if file with name containing time exists and checks against current local time. If within 30 seconds (can vary), there is no file with the name containing the time for 10 seconds behind the local time (the time file is removed every 10 seconds and a new file with a new time is written), then no more copies of expert, which would maintain the file time up to date, starts working at the right chart with the required settings, reading settings from the settings file.


That's it. Only one Expert Advisor will work, only with the required settings, only trading the symbols allowed in the settings file and only on the required chart.

SZY posted not for ForexTools(he, apparently, has already figured out how to solve this problem), but for myself and for those who need it.

 
joo:

Programmer action :

...

If no file appears within 30 seconds (can be varied)

30 seconds is not enough of course, at night ticks are rare. But there is an unpleasant thing: there are symbols with quotes for which the quotes are not available 24 hours a day, but are available during sessions. If a working EA is sitting on such a chart, the parasitic EA may be checked and start working at any reasonable time.


To summarize my "research", it seems none of the readers of this thread ever bothered to find, open and analyze chr files. Because after that, a reliable recipe becomes obvious:


Copy the chr files to the files folder

Search for their own name (Expert Advisor name)

If the name occurs once - work.

If more than once - remove, as taught by Integer.


It's getting kind of sad :(

 
Candid:

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 from the socket? 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.

Candid:
A parasitic expert at any reasonable time can pass the check and start working.

If it passes the check, it will trade with the necessary settings. And if the job is done exactly the same, what do we care who does it - "that first one", or already "the wrong one"?