
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Yeah, I get that. But again, in the strategy tester - you get ticks sequentially, and you don't know when you will have the last tick.
dll is not needed
Inite there is something you can do to pull the first bar and the number of bars by character(any). But this is for old build. And I do not know whether it will work in the tester. But I have access to history in MT4 without dll
You can find out the time of the first bar(start), and the number of bars in the symbol history, that's enough.
In the strategy tester, the time of the first bar is the time of the incoming tick. And it will constantly increase with the arrival of ticks in the strategy tester.
A concrete example:
-----------------------------------------------
The current date is 1.05.2015, we start the strategy tester for the last year. On the first tick in the strategy tester, we will get the zero bar time of 1.1.2015. Although, the real time on the computer is 1.5.2015. As the ticks come in the strategy tester - the date will shift, and the zero bar as well.
Using file operation, we can get that even though our last (zero bar) has a date of 1.1.2015, the real time is 1.05.2015. Accordingly, we process ticks in the tester only up to 1.04.2015.
As new real days come - in the tester we will get more and more later date, and, accordingly, process ticks further and further, but not closer than a month to the real date.
Now - the user has decided to cheat us, and set the date on the computer six months ahead. Now, in the tester, together with the date 1.05.2015 we will get the date 1.11.2015, and the ticks will be processed until 1.10.2015, despite the fact that the real date - still 1.05.2015, and in the terminal really data only to this date. However, there is no way we can get this value from the tester at the beginning of the test.
This is the problem.
That is, if we could get the real last date of the timeseries recorded in the tester from the tester - the problem would be solved. But the problem is that it's not clear how to do it.
dll is not needed
Inite there is something you can do to pull the first bar and the number of bars by character(any). But this is for old build. And I do not know whether it will work in the tester. But I have access to history in MT4 without dll
In the strategy tester, the time of the first bar is the time of the incoming tick. And it will constantly increase with the arrival of ticks in the strategy tester.
A concrete example:
-----------------------------------------------
The current date is 1.05.2015, we start the strategy tester for the last year. On the first tick in the strategy tester we will get the zero bar time of 1.1.2015. Although, the real time on the computer is 1.5.2015. As the ticks come in the strategy tester - the date will shift, and the zero bar as well.
Using file operation, we can get that even though our last (zero bar) has a date of 1.1.2015, the real time is 1.05.2015. Accordingly, we process ticks in the tester only up to 1.04.2015.
As new real days come - in the tester we will get more and more later date, and, accordingly, process ticks further and further, but not closer than a month to the real date.
Now - the user has decided to cheat us, and set the date on the computer six months ahead. Now, in the tester, together with the date 1.05.2015 we will get the date 1.11.2015, and the ticks will be processed until 1.10.2015, despite the fact that the real date - still 1.05.2015, and in the terminal really data only to this date. However, there is no way we can get this value from the tester at the beginning of the test.
This is the problem.
That is, if we could get the real last date of the timeseries recorded in the tester from the tester - the problem would be solved. But the problem is that it's not clear how to do it.
There is a history file, we should open it (FileOpenHistory), read it, find the first (THE LAST BAR in history), read its time and count total number of bars.
This will be enough to manipulate stopping the Expert Advisor at the right moment in the tester.
There is a history file, you need to open it, read it, find the first (the LEFTEST BAR in the history), read its time, count the total number of bars.
This will be enough to manipulate stopping the EA at the right moment in the tester.
You don't need to get the last date, you need to get the first date in the history file and the total number of bars in the history file by reading it from the init
А ! Now that's interesting.
I'll have to give it a try.
That's right, but how do you access it from the strategy tester?
So is this a normal file operation, or is the tester not allowed to access the history?
I haven't tried it myself, but there are no bans on it in the help