Backtesting on 4 pairs not working

 

Hi Everyone,

I am trying to run my expert on 4 currencies pairs during backtesting to check for margin calls etc. Unfortunately, one of the two following things keep happening during every backtest; 1) the expert does not trade on all forex pairs, infact it only trades on one, or 2) if it does trade on multiple pairs, the expert breaks after a few trades and starts doing wrong things like not setting Take Profits etc. 

A bit of background, I wrote the expert and all the various inputs/variables/parameters that require a symbol all use a text input like "EURUSD" or similar. None use "null". "_symbol", "symbol()", etc. The expert works perfectly as intended when run on only one forex pair (Even if the selected pair on the Tester is a different pair). It only breaks when run on multiple. Also I put a unique Magic Number for each pair as the methods use magic number as unique idnetifier. 

I have tried the following steps;

1) Turn the expert into an "include" type class and have a main .mq5 to create the 4 instances of the trader. This caused the trader to only work on one of the pairs although all 4 charts are present in the tester visualiser. 

2) I tried literally copy and pasting the code 4 times making modifications so that all 4 works in tandem with variables, methods etc and all off one OnTImer to run the whole thing. I tested each of these 4 "instances" just by commenting out the individual callers, and each worked as intended. When I tried testing all 4 at once, the program starts doing its own things after a few trades and not working as intended. 


I was hoping to get some advice or similar from anyone who knows a good way to backtest the trader on 4 pairs as the trader itself is only coded to trade on one pair, as when going live I was going to put the trader on 4 different charts and have 4 instances. But I cannot do that on the backtester.

Any help is appreciated, thank you