Hi all, working on my algorithm and appreciate all the help I'm getting on these forums! 

I'm having a few more problems that I've searched around and have been unable to solve. The first problem is that I don't think it is pulling the EMAs properly, for instance the algorithm buys EURUSD at 19:00 on 4/02 and I believe I have it coded that it should only buy if it is not currently long and the 13EMA is greater than the 48EMA, however on my charting platform at that time I have the 13EMA considerably under the 48EMA and a buy crossover doesn't occur until 22:00 on 4/04.

The next problem I'm having is it seems that whenever a crossover happens for one symbol, it seems to be buying or selling all of them at the same time. I may be mistaken as I'm still learning this language but I thought the foreach() should take care of that so that it's running each symbol from the string separately and it's not.

I really appreciate it, thank you!