건조물 - 단위 정밀도 및 가격 정밀도 - 모든 거래소에 적용

저자:노인 피부, 2021-07-02 19:24:39 날짜
태그:도구


from collections import Counter
def GetAmountPrecision():
    depth = _C(exchange.GetDepth)    
    amountPrecisions = []
    for ask in depth["Asks"]:
        i = ask["Amount"]
        amountPrecision = 0
        if str(i).count('.') == 1:
            amountPrecision = len(str(i).split(".")[1])
        amountPrecisions.append(amountPrecision)
    amountPrecision = max(amountPrecisions)    
    return amountPrecision

def GetPricePrecision():
    depth = _C(exchange.GetDepth)    
    pricePrecisions = []
    for ask in depth["Asks"]:
        j = ask["Price"]
        pricePrecision = 0
        if str(j).count('.') == 1:
            pricePrecision = len(str(j).split(".")[1])
        pricePrecisions.append(pricePrecision)
    pricePrecision = Counter(pricePrecisions).most_common(1)[0][0]
    return pricePrecision

관련

더 많은

크루이"이건 정말 멋진 일이야, 정말 멋진 일이야, 정말 멋진 일이야".

77924998JS 버전이 있나요?

77924998어떻게 전략적으로 활용할 수 있을까요?

lcgs005네, 단위 데이터를 연결하여 소수를 추출하는 방법, API를 사용하여 가장 낮은 가격, 가장 높은 가격, 단계 길이 데이터를 직접 가져다가 실제 디스크에서 주문 가격을 수정하는 예가 있습니까?

gg50933064이것은 거래소의 새로운 전략인가?

btcrobotfunction GetPrecision (() { if ((IsVirtual)) return {price:6, amount:6} ♪ ♪ var precision = {값:0, 양:0} var depth = exchange.GetDepth (이용) if ((!depth) { '거래소에 연결할 수 없어 해외 유탁자가 필요해' ♪ ♪ for ((var i=0; i -1? depth.Asks[i].Amount.toString (().split('.') [1]length: 0 precision.amount = Math.max ((precision.amount,amountPrecision) 에 해당하는 문서) var pricePrecision = depth.Asks[i].Price.toString (().indexOf('.') > -1? depth.Asks[i].Price.toString (().split('.') [1]length: 0 precision.price = Math.max (정밀.가격, 가격정밀) ♪ ♪ 반환 정밀도 ♪ ♪

노인 피부해, 더 많은 검색, 더 많은 자원.

노인 피부예, 하지만 js의 코드는 더 길고, 당신은 나를 추가하고, 나는 당신에게 개인 전송

77924998감사합니다.

노인 피부이 함수들은

노인 피부가장 낮은 가격과 가장 높은 가격은 고정된 비율이 있는 것처럼 보입니다. 현재 가격의 10% 또는 5%입니다.

노인 피부그리고 이 모든 것은 우리가 할 수 있는 모든 것이 아닙니다.

gg50933064거래소가 새로운 전략을 세우고 있습니까?

노인 피부아니면, 거래 쌍의 가격 정확도와 단위 정확도를 얻는 함수는 개발 전략에서 자주 사용됩니다.

노력하는 양성강인함