3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-05-19 16:01:46 +00:00
coope/coopeV3/utils.py

8 lines
206 B
Python
Raw Normal View History

2019-06-23 12:53:18 +00:00
import math
def compute_price(price, a, b, c, alpha):
2019-06-23 13:31:55 +00:00
if price < alpha:
return float(price) * (1 + float(a) + float(b) * math.exp(-c/(price-alpha)**2))
2019-06-23 12:53:18 +00:00
else:
2019-06-23 13:31:55 +00:00
return price * (1 + a)