Why are tick flags BUY , SELL always true ?

 

i'm using this code to test output flags of received historical ticks to a text file 

#property version   "1.00"

int OnInit()
  {
//---
  EventSetMillisecondTimer(44); 
//---
   return(INIT_SUCCEEDED);
  }
void OnTimer(){
  EventKillTimer();
    MqlTick receiver[];
    datetime since=(datetime)(TimeCurrent()-600);
    Print("Requesting all ticks since "+TimeToString(since,TIME_DATE|TIME_MINUTES|TIME_SECONDS));
    int all_ticks=CopyTicks(_Symbol,receiver,COPY_TICKS_ALL,((long)since)*1000,-1);
    Print("All ticks downloaded "+IntegerToString(all_ticks));
    Print("Oldest "+TimeToString(receiver[0].time,TIME_DATE|TIME_MINUTES|TIME_SECONDS));
    Print("Newest "+TimeToString(receiver[all_ticks-1].time,TIME_DATE|TIME_MINUTES|TIME_SECONDS));
    //store last 10 ticks in text form
    int f=FileOpen("Tick.txt",FILE_WRITE|FILE_TXT);
    for(int i=0;i<10;i++){
        FileWriteString(f,"---Tick("+IntegerToString(i)+")\n");
        if((receiver[i].flags&TICK_FLAG_ASK)==TICK_FLAG_ASK){FileWriteString(f,"Ask(Yes)\n");}else{FileWriteString(f,"Ask(No)\n");}
        if((receiver[i].flags&TICK_FLAG_BID)==TICK_FLAG_BID){FileWriteString(f,"Bid(Yes)\n");}else{FileWriteString(f,"Bid(No)\n");}
        if((receiver[i].flags&TICK_FLAG_LAST)==TICK_FLAG_LAST){FileWriteString(f,"Last(Yes)\n");}else{FileWriteString(f,"Last(No)\n");}
        if((receiver[i].flags&TICK_FLAG_VOLUME)==TICK_FLAG_VOLUME){FileWriteString(f,"Volume(Yes)\n");}else{FileWriteString(f,"Volume(No)\n");}
        if((receiver[i].flags&TICK_FLAG_BUY)==TICK_FLAG_BUY){FileWriteString(f,"Buy(Yes)\n");}else{FileWriteString(f,"Buy(No)\n");}
        if((receiver[i].flags&TICK_FLAG_SELL)==TICK_FLAG_SELL){FileWriteString(f,"Sell(Yes)\n");}else{FileWriteString(f,"Sell(No)\n");}

        }
    FileClose(f);
  Print("DONE");
  ExpertRemove();
  }
datetime flatten(datetime _time){
MqlDateTime mqt;
if(TimeToStruct(_time,mqt)){
  mqt.day=1;
  mqt.hour=0;
  mqt.min=0;
  mqt.sec=0;
  _time=StructToTime(mqt);
  }
return(_time);
}

void OnDeinit(const int reason){}

void OnTick(){}

the output is this :

---Tick(0)
Ask(No)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(1)
Ask(No)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(2)
Ask(No)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(3)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(4)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(5)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(6)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(7)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(8)
Ask(No)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)
---Tick(9)
Ask(Yes)
Bid(Yes)
Last(No)
Volume(No)
Buy(Yes)
Sell(Yes)

thanks

 
What symbol ? what server ?
 
Alain Verleyen #:
What symbol ? what server ?

EURUSD

XM.COM-MT5

 
Lorentzos Roussos #:

EURUSD

XM.COM-MT5

Buy/Sell flag is irrelevant for Forex, so why doest it matters ?

It's broker dependent. Probably just a wrong configuration on the server.