Saving logs+data to dir. fixes
All checks were successful
Build and Push Docker Image / build-and-push (release) Successful in 1m20s

This commit is contained in:
2025-05-22 14:27:04 +03:00
parent 808f7112f7
commit a94f90dd64
12 changed files with 198 additions and 62 deletions

View File

@ -14,6 +14,33 @@ from logger import generalLogger
from logger import tradingLogger
def getPrice(client, pair):
ticker = client.get_tickers(
category = "linear",
symbol = pair
)
price = float(ticker.get('result').get('list')[0].get('ask1Price'))
return price
def getStartBalance(client, pair):
coin = pair[:-4]
response = client.get_wallet_balance(
accountType = "UNIFIED",
coin = coin
)
balance = float(response['result']['list'][0]['totalAvailableBalance'])
return balance
def getStartFilters(client, pair):
instrumentInfo = client.get_instruments_info(
symbol = pair,
category = "linear"
)
infoContents = instrumentInfo.get('result').get('list')[0]
minimumQty = float(infoContents.get('lotSizeFilter').get('minOrderQty'))
return minimumQty
class tradingData:
def __init__(self, pair, levels, highBreak, lowBreak, takeDelta, stopDelta, orderSize):
self.client = HTTP(