Another problem with your theory, what copper cash does versus what copper stocks do is a different kettle of fish.
From my very limited knowledge of AmiBroker Formula Language (AFL) and Spanish, I think the logic from the comment for the original code at the end is Code: if in long trade if close(intermarketAsset) > SimpleMovingAverage(intermarketAsset, 4) and close(tradingAsset) > SimpleMovingAverage(tradingAsset, 4) exit long at next bar open if in short trade if close(intermarketAsset) < SimpleMovingAverage(intermarketAsset, 4) and close(tradingAsset) < SimpleMovingAverage(tradingAsset, 4) exit short at next bar open if close(intermarketAsset) < SimpleMovingAverage(intermarketAsset, 4) and close(tradingAsset) < SimpleMovingAverage(tradingAsset, 4) enter long tradingAsset at next bar open if close(intermarketAsset) > SimpleMovingAverage(intermarketAsset, 4) and close(tradingAsset) > SimpleMovingAverage(tradingAsset, 4) enter short tradingAsset at next bar open