Currency market is a 24/5 market meaning it is open round the clock for five days during the week. The market is only closed for trading during the weekend. This round the clock action in the currency market can be confusing to the new traders as they can't figure out when the day in the Forex market starts and when it ends. For this purpose, in order to divide the days, the normal convention used is to consider 5:00 PM EST as the end of a Forex trading day.
When you hold a position overnight, it is subject to rollover. Rollover is the interest rate that you either pay or you earn as the result of the interest rate differential between the two currencies that you are trading. So if you open a position before 5:00 PM EST and continue it after 5:00 PM EST, it will be considered to be held overnight for the purposes of calculating the rollover.
The new trading day in the currency market is considered to occur right after 5:00 PM EST. For each trading day that you hold a position open you earn or pay interest. For example, you open a position at 9:00 AM EST and continue with that after 5:00 P.M EST. You close it at 10:00 P.M EST. For the purposes of rollover calculations this would be considered as one trading day.
Suppose, you took a short position on USD CAD meaning you sold USD and bought CAD. If the interest rate on CAD is 2% and the interest rate on USD is 1%, you will get a rollover payment of 1% on the position that you kept open overnight. If it had been other way round meaning interest rate on CAD was only 0.5%, you would have paid an interest of 0.5% on keeping the position open overnight.
Now, this division of 5:00 PM EST is very strict meaning even if you opened a position at 4:59 P.M EST and closed it at 5:02 PM EST, it will be considered to have been held overnight for the purposes of rollover calculations as you had opened it before 5:00 PM EST and closed it after 5:00 P.M EST.
In the same manner, if you open a position at 5:02 P.M EST and close it the next day at 4:59 P.M EST the next day, it will not be considered to have been held overnight for the purposes of rollover calculations.