documentation WIP
This commit is contained in:
13
src/arbus.py
13
src/arbus.py
@ -1,6 +1,7 @@
|
||||
import options
|
||||
from random import randint
|
||||
|
||||
|
||||
async def getLevels(amount, highPrice, lowPrice, roundDecimals):
|
||||
# Returns array of prices from low to high for each level
|
||||
levels = []
|
||||
@ -9,10 +10,20 @@ async def getLevels(amount, highPrice, lowPrice, roundDecimals):
|
||||
levelPrice = lowPrice
|
||||
for i in range(amount - 1):
|
||||
levels.append(levelPrice)
|
||||
levelPrice = round(levelPrice + delta, 2)
|
||||
levelPrice = round(levelPrice + delta, roundDecimals)
|
||||
levels.append(highPrice)
|
||||
return levels
|
||||
|
||||
def floor(value, decimals):
|
||||
# Rounds float to the lower side with the decimals given
|
||||
factor = 1/(10**decimals)
|
||||
return (value//factor)*factor
|
||||
|
||||
def countDecimals(value):
|
||||
# Counts decimals in a float
|
||||
decimals = len(str(value).split('.')[-1])
|
||||
return decimals
|
||||
|
||||
|
||||
def getArbus():
|
||||
# Returnes n arbus (n is random 1 byte positive number)
|
||||
|
||||
Reference in New Issue
Block a user