bug on iBarshift

 

code:

   Print("wtf ", iBarShift("JPYJPY", 1, Time[0], true));

   Print("wtf ", iBarShift("JPYJPY", 1, Time[0], true));

output:

2013.07.05 10:49:29    test GBPUSD,M1: wtf 0

2013.07.05 10:49:29    test GBPUSD,M1: wtf -1

as you can see, giving ibarshift incorrect symbol produces inconsistent result.

 
jesuscheung:

code:

   Print("wtf ", iBarShift("JPYJPY", 1, Time[0], true));

   Print("wtf ", iBarShift("JPYJPY", 1, Time[0], true));

output:

2013.07.05 10:49:29    test GBPUSD,M1: wtf 0

2013.07.05 10:49:29    test GBPUSD,M1: wtf -1

as you can see, giving ibarshift incorrect symbol produces inconsistent result.


You are testing on GBPUSD your lines

It might be you have had a tick on GBPUSD  but first tick "JPYJPY"   (???????)    has still to come

What Symbol is   "JPYJPY"  ??????

 
deVries:


You are testing on GBPUSD your lines

It might be you have had a tick on GBPUSD  but first tick "JPYJPY"   (???????)    has still to come

What Symbol is   "JPYJPY"  ??????


i am just reporting a bug. please stop being stupid by defending the bug. "JPYJPY" is supposed to be wrong. i am telling you, ibarshift should not ever return 0 because "JPYJPY" doesn't exist.
 
jesuscheung:

i am just reporting a bug. please stop being stupid by defending the bug. "JPYJPY" is supposed to be wrong. i am telling you, ibarshift should not ever return 0 because "JPYJPY" doesn't exist.

Stop being stupid,  use a valid symbol . . .

If you want to report what you consider to be a bug then do it via the Service Desk. 

 

alright, since you dont get it, let me give you a real example why this would be a problem.

imagine your broker stops providing a stock symbol, so the stock doesn't exist anymore. now, what used to be valid becomes invalid. and then the EA would assuming ibarshift to return 'correct' results as always, that leads to zero divide problem and other things.

unbelievably retarded moderator, just cause i call someone stupid, they wont think logically

 
jesuscheung:


unbelievably retarded stupid 

 Calling me stupid makes me think you're stupid.  

 Calling RaptorUK unbelievably retarded  makes me think you wanna be called that way... 




 
deVries:

 Calling me stupid makes me think you're stupid.  

 Calling RaptorUK unbelievably retarded  makes me think you wanna be called that way... 


No,  he wants to receive a BAN . . .

From here: https://www.mql5.com/en/users/register   

"2. Any posts which may offend other visitors of the MQL4.com are forbidden. These messages will be deleted.

6.  Numerous breakings of rules, ignoring of remarks of a moderator and furthermore open disrespect for administration attract ban from the MQL4.com without any explanations."

 
jesuscheung:

alright, since you dont get it, let me give you a real example why this would be a problem.

imagine your broker stops providing a stock symbol, so the stock doesn't exist anymore. now, what used to be valid becomes invalid. and then the EA would assuming ibarshift to return 'correct' results as always, that leads to zero divide problem and other things.

unbelievably retarded moderator, just cause i call someone stupid, they wont think logically

OK,  for the moment let's ignore your unpleasant remarks about other Forum users . . .

Your issue is; how do you know if the symbol you are using is valid or invalid ?  and you expect iBarShift() to tell you that it is invalid . . . perhaps it should,  have you reported this omission to the Service Desk ? 

Lets assume that MetaQuotes won't fix this function,  what will you do instead ?  you are obviously not "retarded" so you must have come up with a work around by now ?

Maybe you did something like this ?

   GLError = 0;
   SymbolBid = MarketInfo(TestSymbol, MODE_BID);
   GLError = GetLastError();
   if(GLError == 4106)
      Print("Marketinfo - Unknown symbol: ", TestSymbol);
 

Or one may be able to generate a list of all symbols currently available from the broker...

see https://www.mql5.com/en/forum/144646https://www.mql5.com/en/forum/141214, and https://www.mql5.com/en/code/9102 

...and then determine if a particular symbol is available. 

Reason: