Hi Popov,
The swap should be linked to a kind of “interest rate” which is applied on the value $ of the size.
In other words, the Swap represents the interest you pay or receive for holding a position overnight, since in FX you are effectively borrowing one currency to buy another.
In simplified terms:
Swap ≈ (Interest rate of the bought currency − Interest rate of the sold currency) × position size
Because the interest rate differential changes over time, swap can shift from negative to positive or vice versa.
If brokers were fully transparent and consistent in their swap calculation, it would be possible to estimate it quite accurately.
Instead of relying purely on historical swap observations, it could be interesting to model the swap component and integrate it directly into the strategy code. The underlying reference rates are public and transparent, so the main inputs are already available.
This could allow strategies to anticipate the swap impact instead of discovering it only ex-post in the results.
BR
Vincenzo