SymbolInfoDouble error value?

 

Hi, why SymbolInfoDouble() shows 0 for ask and Bid with all symbols?

string Prices(){
   int total = 1;
   total = SymbolsTotal(0);
   string all = "Time,Open,High,Low,Close,Volume,Ask,Bid|||";
   for(int i=1;i<total;i++)
   {
    string s = SymbolName(i,0);        
    all = all +s+","+iTime(s,0,0)+","+iOpen(s,0,0)+","+iHigh(s,0,0)+","+iLow(s,0,0)+","+iClose(s,0,0)+","+iVolume(s,0,0)+","+SymbolInfoDouble(s,SYMBOL_ASK)+","+SymbolInfoDouble(s,SYMBOL_BID)+"|||";
   }
   return all;
}
 

Ok, works.

string Prices(){
   int total = 1;
   total = SymbolsTotal(1);
   string all = "Time,Open,High,Low,Close,Volume,Ask,Bid|||";
   for(int i=1;i<total;i++)
   {
    string s = SymbolName(i,1);         
    all = all +s+","+iTime(s,0,0)+","+iOpen(s,0,0)+","+iHigh(s,0,0)+","+iLow(s,0,0)+","+iClose(s,0,0)+","+iVolume(s,0,0)+","+SymbolInfoDouble(s,SYMBOL_ASK)+","+SymbolInfoDouble(s,SYMBOL_BID)+"|||";
   }
   return all;
}
 

Hi,

Now this doesn't work (How refresh function only on per period or OnBar)

It refresh Print every tick Why what is wrong with MT4 and Mql4 ?

string newbar = "";

void OnTick()
{
   if(newbar != Time[0]){          
   newbar = Time[0];
   Print(TimeToStr(Time[0], TIME_DATE|TIME_SECONDS) + " Account equity " + DoubleToString(NormalizeDouble(AccountEquity(),2),2));
   Balance(); 
   }   
}
 
datetime newbar = 0;
 

Thanks very much.

Ps. MQL4 can't fit as php, blah.

Reason: