iBarShift issue

 
Hello !

string time = "2014.11.10 22:10"; 
iBarShift(Symbol(),Period(),StrToTime(time),true)

does not find the bar. But I can see the bar on the chart. The bar before the searched one ("2014.11.10 22:09") and the bar after it ("2014.11.10 22:11") is found without any problems. 

And

TimeToStr(iTime(Symbol(),Period(),29545)

is 0.

As the bar is clearly visble on the chart I wonder what I am doing wrong.

Thank you very much for any hints!

 

1) To convert a string-date you can use:

datetime tme = D'2014.11.10 22:10'; 

2) On a 15 min chart you don't get 22:10 precisely - remove the true?

 
gooly:

1) To convert a string-date you can use:

2) On a 15 min chart you don't get 22:10 precisely - remove the true?

Thanks for the quickk answer. I am using a M1 Chart. What I forgot to post is that the script that cointains the code is attached on a chart created by visual backterster (date range is from 2014/01/01 until 2014/11/30 what is not available on the chart from my broker. At least not on M1 timefrmae). I think that is the problem because dropping the script on the visual backtester chart leads the script to run on the data of my broker.

 
APeng: does not find the bar. But I can see the bar on the chart. The bar before the searched one ("2014.11.10 22:09") and the bar after it ("2014.11.10 22:11") is found without any problems.

As the bar is clearly visble on the chart I wonder what I am doing wrong.

  1. If there was no tick that minute there is no bar. See "Free-of-Holes" Charts - MQL4 Articles
  2. I doubt you.
 
WHRoeder:
APeng: does not find the bar. But I can see the bar on the chart. The bar before the searched one ("2014.11.10 22:09") and the bar after it ("2014.11.10 22:11") is found without any problems.

As the bar is clearly visble on the chart I wonder what I am doing wrong.

  1. If there was no tick that minute there is no bar. See "Free-of-Holes" Charts - MQL4 Articles
  2. I doubt you.

WHRoeder you doubt me???

You truly can believe me, I did see it with my own eyes!


Here is the evidence:

rofl...

(check out my second post, the failure was about the visual backtesitng chart)

 
APeng: Here is the evidence:
You image shows nothing! Unknown chart from unknown broker. No time of the bar before, bar indicated, bar after.
Open market watch, enlarge the bars to max so there's no question which one the cursor is on, capture 3 images, then maybe you have some evidence. Rofl also.
Reason: