Errors, bugs, questions - page 2587

 
elibrarius:
I think it's easier to read bars from files.

I wrote you a solution in one line - add the test date to this condition and test in the tester with no problem, performance will at least decrease

or better yet, do as admin suggests - the file is of course not a problem, but there is a great temptation to peep into the wrong places with the neuronet - that's how I usually ended up doing it ))))

 
Roman:

The code uses lock_guard
But if it is commented out, there is no change
.

However, it started to leak, well, it is clear why, because of wrong sizeof
I'll come back from holiday, if it's not too much trouble, I'll study the issue. But logically the bug is not in mql, but in your code. By the way, just for fun, what if the library works with what encoding? Are you sure that utf-16, but what if it's utf-8, after all, the most common.
 
Igor Makanu:

I wrote you a solution in one line - add the test date to this condition and test in the tester with no problem, performance will at least drop

Or better yet, just follow admin's suggestion - the file won't be a problem, but you may be tempted to use neuronet to peek into places you shouldn't - that's how I usually ended up with it )))

Checked it out - didn't help.

And it shouldn't. After all, according to the article that admin quoted:
The minimum amount of history to download from the trading server for timeframes D1 and less is one year.

And the 100000 M15 bars I requested is about 3 years. For the first year the bars are copied, that's 37k bars, and beyond that they just aren't in the tester, waiting won't help.

 
elibrarius:

Checked it - didn't work.

Yes and it shouldn't. After all according to the article the admin quoted:
The minimum amount of history when downloading from the trading server for timeframes D1 and less is one year.

And the 100000 M15 bars I requested is about 3 years. For the first year the bars are copied, that's 37k bars, and beyond that they just aren't in the tester, waiting won't help.

it's working for me, put test 2000 - 2019 on M15, expert code:

input int InpBars = 100000;

void OnTick()
{  static bool print_once = true;
   int bars = Bars(_Symbol, _Period);
   if(bars < InpBars) return;

   if(print_once)
   {  Print("OK - ", TimeCurrent());
      print_once = false; }

}

got it in the log:

2019.10.04 22:15:19.567 Core 1 EURUSD,M15: testing of Experts\IgorM\tst.ex5 from 2000.01.01 00:00 to 2019.10.03 00:00 started with inputs:

2019.10.04 22:15:19.567 Core 1 InpBars=100000

2019.10.04 22:15:19.567 Core 1 2003.01.16 19:30:00 OK - 2003.01.16 19:30:00

2019.10.04 22:15:19.567 Core 1 final balance 10000.00 USD

add a date to the condition to start testing and train the NS, or do as admin suggested
 
Igor Makanu:

I got everything working, put test 2000 - 2019 on M15, expert code:

got it in the log:

2019.10.04 22:15:19.567 Core 1 EURUSD,M15: testing of Experts\IgorM\tst.ex5 from 2000.01.01 00:00 to 2019.10.03 00:00 started with inputs:

2019.10.04 22:15:19.567 Core 1 InpBars=100000

2019.10.04 22:15:19.567 Core 1 2003.01.16 19:30:00 OK - 2003.01.16 19:30:00

2019.10.04 22:15:19.567 Core 1 final balance 10000.00 USD

add the date from which you want to start testing in the condition and teach the NS, or do as suggested by admin

Now I understand your idea)

I.e. you should not run the test for the last 2 months, but for 3 years, skip all these 3 years in OnTick and start the calculation only on the last 2 months.

Yes - that's the easiest solution. Thank you!

 
elibrarius:

And the 100,000 bars M15 I requested is about 3 years. For the first year the bars are copied, that's 37,000 bars, and then they are just not in the tester, waiting will not help.

It would be faster to work with your history file in optimizer mode"Mathematical Calculations".

 
elibrarius:

Now I understand your idea)

I.e. the test should not be run for the last 2 months, but for 3 years, skip all those 3 years in OnTick and start calculations only on the last 2 months.

Yes - this is the easiest solution. Thank you!

Add time to the condition

input int InpBars = 100000;
input datetime InpDataTest = D'2015.01.01 00:00'; 
void OnTick()
{  static bool print_once = true;
   int bars = Bars(_Symbol, _Period);
   datetime t = TimeCurrent();
   if(bars < InpBars || t < InpDataTest  ) return;

   if(print_once)
   {  Print("OK, TimeCurrent() =  ", t);
      print_once = false; }

}

2019.10.04 22:36:42.729 Core 1 EURUSD,M15: testing of experts\IgorM\tst.ex5 from 2000.01.01 00:00 to 2019.10.03 00:00 started with inputs:

2019.10.04 22:36:42.729 Core 1 InpBars=100000

2019.10.04 22:36:42.729 Core 1 InpDataTest=1420070400

2019.10.04 22:36:42.729 Core 1 2015.01.02 09:00:00 OK, TimeCurrent()= 2015.01.02 09:00:00

2019.10.04 22:36:43.041 Core 1 final balance 10000.00 USD



 
Igor Makanu:

add time to the condition

2019.10.04 22:36:42.729 Core 1 EURUSD,M15: testing of experts\IgorM\tst.ex5 from 2000.01.01 00:00 to 2019.10.03 00:00 started with inputs:

2019.10.04 22:36:42.729 Core 1 InpBars=100000

2019.10.04 22:36:42.729 Core 1 InpDataTest=1420070400

2019.10.04 22:36:42.729 Core 1 2015.01.02 09:00:00 OK, TimeCurrent() = 2015.01.02 09:00:00

2019.10.04 22:36:43.041 Core 1 final balance 10000.00 USD



Yes, thank you. Everything works.

 
Aleksey Vyazmikin:

It would be quicker to work with your history file in the optimiser's"Mathematical Calculations" mode.

This is if you are purely in the NS itself and look at the result.

I'm testing the trade now, so that both costs and spreads are taken into account. The result of this is that the trading robot is ready for use in the tester and can be connected to a real trade.

 
elibrarius:

Well, that's if you're purely in the NS itself and looking at the result.

I'm testing the trade now, so that both costs and spreads are taken into account. That's why I'm interested in a ready-made robot that I can look at in the tester and connect to real trading.

I still don't understand - do your predictors need more depth of calculation? I really need one - MA on the days :) I'm just starting testing a year early and trading before that date can be banned...