How to protect yourself against copying long trades from the tester

 

Greetings all.

The question is in the title. The goal is to protect the EA from being used on real data, but still allow it to be run in the strategy tester. So we could run the demo version in the strategy tester and see that it works, but we would not be able to copy trades by transferring them manually to another terminal.

The problem is that Expert Advisor trades can last for weeks. And this means that an unscrupulous user can run a demo version in the strategy tester and open the same trades manually in another terminal a day late. In this case he/she does not lose much profit.

Consequently, we decided that the Expert Advisor must work in the Strategy Tester only until the date one month earlier than the current date. At the same time, when new dates appear, the Expert Advisor must be allowed to work in the Strategy Tester for a longer and longer time.

A fixed date of the end of work in the tester is not good - users suspect that the quotes are stored in the Expert Advisor exactly until this date, which is why it works. Therefore, we need to get the current date in the Strategy Tester and allow the Expert Advisor to work only until the date, which is a month earlier.

It is hard to get the current date from the tester, but we have managed to do it. However, we found a clever user turning the time on his computer forward and easily reading performed deals from the Strategy Tester.

How can I prevent the tester from running on last month's quotes ?

What do you suggest to do, colleagues ?

 
I say more! Having learnt a bit about WINAPI, you can write a utility which will drum the "start" button in the tester, save the report and read new trades from there. And then you can simply duplicate trades in the terminal.
 

Yes, Dimitri, you can do it even without WinAPI, just using the script on AutoIT.

Not only Expert Advisors that work on daily periods but even Expert Advisors that work on five-minute periods do not feel comfortable in this case.

In my opinion, the most reasonable solution is to stop the operation of the tester one month before the current date. But what to do when the date is changed on your computer?

The idea I have is to somehow get from the tester the real time of last quotes from the terminal. But I don't know how to do it. Also, I don't want to mess with additional self-written DLL, they also "scare" the clients.

 
George Merts:

Yes, Dimitri, you can do it even without WinAPI, just using the script on AutoIT.

Not only Expert Advisors that work on daily periods but even Expert Advisors that work on five-minute periods start to feel uncomfortable in this case.

In my opinion, the most reasonable solution is to stop the operation of the tester one month before the current date. But what to do when the date is changed on your computer?

The idea I have is to somehow get from the tester the real time of last quotes from the terminal. But I don't know how to do it. Also, I don't want to mess with additional self-written DLL, they also "scare" the clients.

The date in the terminal is not translated. TimeCurrent() gives last server time.
 
Dmitiry Ananiev:
The date in the terminal does not translate. TimeCurrent() gives the latest server time.

So TimeCurrent() is simulated in the tester... Or am I missing something? You need to know the real current time from the tester, don't you?

In theory, you can use WebRequest, requesting real current time from some server (including your own). And the requirement for strategy test would be to enter the address of this server in the terminal.

 
Игорь Герасько:

So TimeCurrent() is simulated in the tester... Or am I missing something? You need to know the real current time from the tester.

You can get the current time of your computer from the tester.

The only problem is that a user with malicious intent may change it drastically.

Ideally, you could use WebRequest to request the real current time from some server (including your own). And the requirement for the test strategy would be to enter the address of this server in the terminal.

WebRequest is not executed in the strategy tester.
 

George Merts:

Consequently, it is necessary to get the current date in the tester and only allow the EA to work up to a date that is a month less.

--

[]...there was a clever user who turned out to advance the time on his computer, and quietly read the completed trades from the tester.

Get the time from a third, independent party - either through DLL, or by WebRequest, as advised above. There are no other options, I suspect.
 
Igor Konyashin:
Get the time from a third, independent party - either via DLL or WebRequest, as advised above. There are no other options, I suspect.
WebRequest, as it turns out, is not applicable in strategy tester. Yes, it's very sad, but so far I can't think of anything except self-written DLL... And it would seem - you just need to know the date of the last received real quotes of the terminal...
 
George Merts:

It is possible to find out the current time of the computer from the tester.

The only problem is that a user with malicious intent can change it drastically.

That's what I mean. Except that TimeCurrent() doesn't work in the tester either.
WebRequest is not executed in the strategy tester.
I did not know about it. Thanks for the information.
 
Игорь Герасько:
That's what I'm saying. Except that TimeCurrent() does not work in the tester either.
TimeCurrent() - does not work at all, it returns not the current computer time, but the quote time, which depends on the strategy tester settings.
 
George Merts:
TimeCurrent() - does not work at all, it does not return the current computer time, but the quote time, which depends on the strategy tester settings.
What settings should I put in and where? TimrCurrent() - server time. In the tester, it is the server time ticks arrival time. For as long as I have been writing owls, I have never attached them to the local computer time.
Reason: