I recently realized that broker (particularly interbank fx) spreads can diverge more than 10 pips. I am scalping using MT3, and I attempted to code an algorithm to stay out of the market in such times. As the code is fairly simple, i seem to have problems with the following:
Code:
define: spread(2);
tt= spread * Point;
spr =ask - bid;
if spr != tt then
{
sd++;
Print ("SPREAD DIFF ", spr);
FileWrite(h1,bid,ask,spread,TimeToStr(CurTime),sd);
}
Comment("BID (",bid,") Ask (",ask,") Spread (",spr,")");
When the result of spr is .0002 and tt = .0002 the expression for some reason still results as true. Any ideas to why?