Errors, bugs, questions - page 1665

 

Please explain why the code below:

  datetime test1 = StringToTime("2016.09.02 23:55");
  datetime test2 = StringToTime("2016.09.05 00:00");
  datetime test3 = StringToTime("2016.09.05 00:08");
  
  int n = Bars(_Symbol, PERIOD_D1, test1, test2);
  Print("time1=", (string)test1, " time2=", (string)test2, " n=", n);
  n = Bars(_Symbol, PERIOD_D1, test2, test3);
  Print("time1=", (string)test2, " time2=", (string)test3, " n=", n);

?

(EURUSD,M1)     time1=2016.09.02 23:55:00 time2=2016.09.05 00:00:00 n=1
(EURUSD,M1)     time1=2016.09.05 00:00:00 time2=2016.09.05 00:08:00 n=1

?

The first date pair contains two different days. IMHO, it should return the number of bars equal to 2.

 
Stanislav Korotky:

Please explain why the code below:

?

?

The first date pair contains two different days. IMHO, it should return the number of bars equal to 2.

And check what you get if you write it like this

n = Bars(_Symbol, PERIOD_D1, test2, test2);

Oddly enough, you will get 1 even at the opening of a new daily bar.

 
Alexey Viktorov:

And check what you get if you write like this

Oddly enough, you will get 1 even at the opening of a new daily bar.

This is normal. The problem is different: for a range of different dates the number of daily bars returns 1.
 
Stanislav Korotky:
That's fine. The problem is different: for a range of different dates, the number of daily bars returned is 1.

This is the developers' idea of time. They believe that the time 00 hours 00 minutes 00 seconds refers to the previous day. This is not the only bug in this function but they do not want to see or hear about it.

Add 1 second and you get 0.

n = Bars(_Symbol, PERIOD_D1, test2+1, test3);
 

Question!

For a reason I don't understand. Every time I load the mt5 trading platform the quotes are not activated by default - I see a blank window without a price chart, and that's it.

I have to switch from one TF to another several times until they "break" and become active and visible,

why?

 
 
How do I determine in an indicator if it has been set by hand, via IndicatorCreate or via#property tester_indicator?
 
fxsaber:
How do you determine in an indicator if it was set by hand, via IndicatorCreate or via#property tester_indicator?

No way. I wrote a request to the service desk(2014.06.11 14:44,#1025934) - it was rejected.

It is basically impossible to determine the "master" of an indicator in five, as there can be several masters

 
Alexey Viktorov:

This is the developers' idea of time. They believe that the time 00 hours 00 minutes 00 seconds refers to the past 24 hours. This not only causes bugs in this function, but they don't want to see or hear about it.

Add 1 second and you get 0

Was there a request to the service desk about it or create one? This is clearly a bug.
Reason: