Python code to answer if sending money to home country beneficial for expats?
Normally, expats are really confused with the exchange rates going up & down rapidly, and not being able to figure out whether sending money back to their own country is beneficial or not, because of the transfer rates, exchange rates impacting the process.
Hence, we have come up with a simple Python program which was developed just under 10 minutes to showcase which option is better & why.
Well, in this tutorial, I am taking an example of an Indian expat staying in Hong Kong, and similarly you can update the program based on your needs.
Transfer fees through various mediums like Transfer-Wise, InstaRem etc differs, here in this example we shall be considering InstaRem as the transaction fees is lesser as compared to other vendors.
1. Amount to be sent back home every month: 25,000 Hong Kong Dollars.
2. Transferring transaction fees (InstaRem) every 5000 HKD: 17.5 HKD, hence for 25,000, the transaction fees shall be: 87.5
3. Let’s consider, the conversion rate on an average(Accumulate the conversion rate every month and divide it by 12) stays at 1 HKD = 9.2 INR.
#Configuring the variables
#Configuring the variables home = "India" abroad = "Hong Kong" #Setting the monthly value that we intend to save principal = 25000 #Setting the transaction fees which InstaRem charges for every 2500 trx = 87.5 #Setting the conversion rate (Assuming the mean conversion rate for the upcomin tenure to be 9.2) conv_rate = 9.2 #Total principal amount in Indian Rupees/month principal_inr = (principal-trx)*conv_rate
#Method to calculate Interest for the recurring deposit
def recurring_deposit(principal, rate, time): # Calculates the interest I = (principal*time*(time+1)*rate)/(2400) return I
Considering, the rate of interest for our Indian savings account as 5%, for a tenure of 12 months, our interest calculated is as below:
# Interest Calculation interest_inr = recurring_deposit(principal_inr, 5, 12) print(interest_inr)
Interest calculated is: 74488.37499999999
#Calculating the overall amount based on HKD inr_tot = (principal_inr*12)+interest_inr hkd_conv = inr_tot/conv_rate
Entire savings converted to Hong Kong Dollars would be: 307046.56 HKD (Rounded upto 2 decimals)
Now, considering we are not going to send the money to India, and we try to save it in our Hong Kong account, considering the rate of interest in Hong Kong backs to be 1% (Logically, interest rates in hong kong banks are even lesser than 1%)
#Interest Calculation hkd_interest = recurring_deposit(principal, 1, 12) #Calculating the overall amount based on HKD hkd_tot = (principal*12) + hkd_interest
Entire savings converted to Hong Kong Dollars would be: 301625.0 HKD
if(hkd_conv > hkd_tot): print(("Sending money to %s shall be beneficial") % home) else: print(("Keeping money in %s shall be beneficial") % abroad)
We can clearly understand that “Sending money to India shall be beneficial”
This is a simple Python program developed under 10 minutes, but the same can be a great Data Science project where we can calculate the exact savings & find out whether it’s actually beneficial to keep our money in Hong Kong or is it better to send the money back to India by using the predicted values of the exchange rates.
To understand how forecasting works on foreign exchange rates, follow this link: Forecasting Exchange Rates
Keep browsing beingdatum.com, cheers!!