documentation WIP

This commit is contained in:
2025-05-18 17:03:59 +03:00
parent ffab00601a
commit 957b411ce1
15 changed files with 531 additions and 160 deletions

View File

@ -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)