Last Entry Position of one symbol as input to another

I want to create a strategy which uses last long/short position from another symbol and use its exit price to enter in a symbol.

How to achieve it… In backtest as well as live execution??