The swap is essentially a fee debited or payment credited to your trading account for holding a forex trade overnight.
Generally, this fee is calculated by comparing the interest rates of the central banks’ associated with the underlying currencies quoted in the currency pair. This is a good time to remind you that when you enter a forex trade, you are simultaneously buying one currency and selling another currency (or vice versa).
This fee's value is determined by the interest rate differential and either debited or credited to your account.
For example, lets suppose you have taken a trade on the GBP/USD.
If you are long this currency pair (buy position) and the Bank of England's (BoE) interest rate is higher than the US Federal Reserves, you should experience something called a positive carry – where the interest rate received from holding the GBP position long is higher than the interest rate paid for holding the USD short.
In contrast, if we were short (sell position) this same currency pair, we would experience a negative carry – where the interest rate received from holding the USD position long is lower than the interest rate paid holding the GBP short.