IBarShift error

Back to topics list To post a new topic, please log in or register
avatar
5
Danny_pip 2015.08.24 18:22
 

iBarShift does not seem to work properly with build 840.

I never see 1440 bars in a 1 day period using M1 timeframe.

I've seen a limitation on 1000 bars in the past and than things go wrong.

Is this a know bug ?


I've also added a list with the log-file.


Here's the code :

 previousday_start = iTime(NULL,PERIOD_D1,i);
 previousday_end   = previousday_start + 24*60*60 -60;
 
 start_bar = iBarShift(NULL,PERIOD_M1,previousday_start);
 end_bar   = iBarShift(NULL,PERIOD_M1,previousday_end);
 
 
 // ***** ONLY FOR TEST *****
 datetime testtime;
 int currentbar=0;
 int end = end_bar+1440;
 Log("end_bar = " + end_bar + "start_bar = " + start_bar);
 
 for (i= end_bar; i< end; i++)
 {
  testtime = iTime(NULL, PERIOD_M1, i);
  currentbar = iBarShift(NULL,PERIOD_M1,testtime);
  Log( "i = " + i + " Time = " + TimeToStr(testtime,TIME_DATE|TIME_SECONDS) + "  BarNr = " + currentbar);
 }
 Log ("end of cycle");
 // ***** ONLY FOR TEST TILL HERE *****



Attached files:
  ibarshift_list.txt  (69.60 KB)
avatar
12985
WHRoeder 2015.08.24 19:35 #
 
Danny_pip: I never see 1440 bars in a 1 day period using M1 timeframe.
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. Expected. If there is no tick in a minute, there will not be a M1 bar. "Free-of-Holes" Charts - MQL4 Articles
avatar
5
Danny_pip 2015.08.24 22:28 #
 

I believe you don't understand the problem WHRoeder; In one day there are 1440 minutes; every minute has a barnumber that should be able to be reached with iBarShift to find back the exact bar corresponding with that time.

avatar
6292
tara 2015.08.24 23:14 #
 
Danny_pip:

I believe you don't understand the problem WHRoeder; In one day there are 1440 minutes; every minute has a barnumber that should be able to be reached with iBarShift to find back the exact bar corresponding with that time.

What about minutes at weekend? 
avatar
12985
WHRoeder 2015.08.25 16:20 #
 

Danny_pip:

In one day there are 1440 minutes;

every minute has a barnumber

that should be able to be reached

Irrelevant.

Wrong

And wrong. No tick that minute, no bar for that minute. No minute bars over the week end either. Did you bother to read the article I linked to? What part of "holes" was unclear?



avatar
5
Danny_pip 2015.08.28 09:39 #
 
WHRoeder:

Irrelevant.

Wrong

And wrong. No tick that minute, no bar for that minute. No minute bars over the week end either. Did you bother to read the article I linked to? What part of "holes" was unclear?

The problem is that it's systematically showing up every day; even if there are ticks for that minute; do the test yourself ! This function does not work properly.
avatar
12985
WHRoeder 2015.08.28 14:39 #
 
No, you prove it. Take your time, get your shift, print the shift and time of that shift and the time of the next bar. Show your code and your result.
avatar
125
zirkoner 2015.08.28 19:22 #
 
Danny_pip:
The problem is that it's systematically showing up every day; even if there are ticks for that minute; do the test yourself ! This function does not work properly.
This function is working as expected. MT4 doesn't draw a bar if there is no tick, on M1 timeframe there is ALWAYS missing bars.
Back to topics list  

To add comments, please log in or register