Trade different symbol then signal

I am trying to backtest a system by which signals generated are on different symbols then the buy and sell. For example the signal is generated on QQQ on when to buy- but the buy is done on QLD (2x QQQ). Any examples someone could point me to? I have a bunch of pairs that I want to trade like that- not just one. Thanks

The easiest way to do that is to place the symbols you want to trade into a watchlist that you run your backtest against. As each symbol is processed (e.g. QQQ), you use Foreign() or SetForeign() to retrieve the prices of the signal symbol (QLD) and calculate the relevant indicators using those prices.

This assumes you have created a mechanism to keep track of the pairs, i.e. that for trading symbol X the correct signal symbol is Y.

Check out these examples

Aah, knew there had to be a function to use- Foreign()- that should get me started- thanks guys.