Skip to content

Instantly share code, notes, and snippets.

@adrianmoses
Created April 22, 2015 01:01
Show Gist options
  • Save adrianmoses/57ab8d4f7ac614306676 to your computer and use it in GitHub Desktop.
Save adrianmoses/57ab8d4f7ac614306676 to your computer and use it in GitHub Desktop.
Forex Monthly Trajectory
from calendar import monthrange
MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
INITIAL_DEPOSIT = 10000
YEARS = 3
STARTING_YEAR = 2016
YEAR_RANGE = list(range(STARTING_YEAR, (STARTING_YEAR + YEARS+1)))
amount = INITIAL_DEPOSIT
daily_amount = 0
print YEAR_RANGE
for i in YEAR_RANGE:
print "In Year %s:" % i
last_month_days = 30
for month in MONTHS:
amount += round(daily_amount * last_month_days, 2)
daily_amount = round(amount * float(.01), 2)
days = monthrange(i, month)[1]
last_month_days = days
print "Month %s: Starting with %s, 1%% is %s" % (month, amount, daily_amount)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment