The Expert Advisor gets values of Bid and Ask prices on every tick and remembers them into the "prices" structure array. On every twentieth tick the Expert Advisor writes structure objects data into the file using