Download MetaTrader 5
To add comments, please log in or register
Have you installed MetaTrader 5? Find out more about it!
danny_pip
118
danny_pip 2015.08.24 16: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 *****

Files:
whroeder1
13597
whroeder1 2015.08.24 17: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
danny_pip
118
danny_pip 2015.08.24 20: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.

Алексей Тарабанов
7220
Алексей Тарабанов 2015.08.24 21: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? 
whroeder1
13597
whroeder1 2015.08.25 14: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?



danny_pip
118
danny_pip 2015.08.28 07: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.
whroeder1
13597
whroeder1 2015.08.28 12: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.
Zirkon
123
Zirkon 2015.08.28 17: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.
/
To add comments, please log in or register