-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoumpound_Interest.py
34 lines (27 loc) · 1.21 KB
/
Coumpound_Interest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def compound_interest(P, R, T):
Amount = P * (pow((1 + R / 100), T))
CI=Amount-P
return CI
P=float(input("Enter The Principle : "))
duration=int(input("how many days?"))
interest=float(input("what interest?"))
positionVolume=float(input("how much $ per position")) #maximum opend position size is 100$ for example
positionsperday=2
automaticposinc=False #Automatic increase of the positions number
if P>positionVolume:
daycounter=1
while(daycounter!=duration):
if automaticposinc:
mop=int(P/positionVolume)#maximum openable position number
P+=compound_interest(positionVolume,1,interest)*mop #R=1 because we trade each position one time per day
else:
P+=compound_interest(positionVolume,1,interest)*positionsperday #R=1 because we trade each position one time per day
mop=positionsperday
interestsMade=compound_interest(positionVolume,1,interest)
print(f"Ballance:{P} ------PositionVolume:{positionVolume}---Positions:{mop}---Intersets Made:{interestsMade} per position ---totall interests made:{interestsMade*mop}")
daycounter+=1
else:
print("Try again")
exit
# Finding Out The Simpl Interest
#compound_interest(P,R,T)