I did some programming for metatrader before but it was a few years ago. Now I am back and I have MT5 and I want to build a robot for myself for arbitrage trading. But first I just want to test and get all required values and then use them in either a graph format or just as a spreadsheet/text file so I can see a history data or current trading data and analyze it.
The problem is I need to work with bid/ask values for two symbols at the same time so in every tick in any of two symbols that I am interested in I can do some simple calculation between bid of one symbol and ask of the other and vice versa. I have tried expert adviser sample code and added and modified some code with OnTick Event but it seems I am only getting data from a symbol the adviser is running on. Here is a code
//Print(last_tick1.time,": Bid = ",last_tick1.bid, " Ask = ",last_tick1.ask);
Print(last_tick1.time,": Sell = ",spreadSell, ": Buy = ",spreadBuy);
else Print("SymbolInfoTick() failed, error = ",GetLastError());
SYMB1 and SYMB2 are just a string variables that are in fact symbols codes.
Is there any way I can get the onTick event triggering on two symbols at the same time?
If not, how can I do what I want? I guess I can run two expert advisers(one on each symbol), storing all acquired data in the same file and then analyzing it. Is there any other simpler way?