실제 디스크가 작동할 때 가격의 소수를 제한하는 방법

저자:제인, 창작: 2019-11-02 15:00:19, 업데이트:

예를 들어, 최근 실제 거래에서 오류가 자주 발생했습니다. 아마도 제가 사용하는 거래소는 소수점만 사용할 수 있습니다. 지점을 찾으십시오.img


더 많은

발명가 양자화 https://www.fmz.com/api#setprecision

초목이 게시판에 게시된 문서를 보시기 바랍니다.

초목이 게시판에 게시된 문서를 보시기 바랍니다.

초목교환.구매 (_N(구매 가격,2),_N(구매 금액,3)

초목공개된 정책은 일반적으로 정확성에 특별한 제한이 없습니다. 다른 통화에 대해 직접_N을 사용해서 설정하세요.

초목_N(2.312,1)

제인기본적으로 공개된 많은 전략들이 이 문제를 가지고 있고, 몇 가지 시도를 해본 적이 있습니다. 가격은 소수의 정수이고, 거래가 이루어지고, 종종 오류가 발생하며, 실행되는 거래는 실행되지 않으며, 전략은 기대되는 효과를 전혀 얻지 못합니다.

제인잘됐네

제인부호가 어디에 있는지 예를 들어, 이 횡령 전략은 function CancelPendingOrders ((orderType) }는 while (true) { var orders = _C (exchange.GetOrders); var count = 0; if (typeof(orderType)!= 'undefined') { for (var i = 0; i < orders.length; i++) { if (order[i].Type == orderType) { 이 문서는 ♪ ♪ ♪ ♪ } else { 괄호의 길이는 ♪ ♪ if (count == 0) { ♪ ♪ for (var j = 0; j < orders.length; j++) { if (typeof(orderType) == 'undefined' の で (orderType == orders[j].Type)) { exchange.CancelOrder ((order[j].Id, orders[j]); if (j < (orders.length-1)) { 잠자리 (Interval); ♪ ♪ ♪ ♪ ♪ ♪ ♪ ♪ ♪ ♪ function updateProfit ((accountInit, accountNow, 티커) { var netNow = accountNow.Balance + accountNow.FrozenBalance + ((accountNow.Stocks + accountNow.FrozenStocks) * ticker.Buy)); var netInit = accountInit.Balance + accountInit.FrozenBalance + ((accountInit.Stocks + accountInit.FrozenStocks) * ticker.Buy); 로그프로프트 (netNow - netInit); ♪ ♪ var InitAccount = null; var LastBuyPrice = 0; var LastSellPrice = 0; function on Tick ((() { var ticker = _C (exchange.GetTicker); var BuyPrice = ticker.Buy + SlidePrice; var SellPrice = ticker.Sell - 슬라이드 가격; // 수익은 사라졌습니다 만약 (SellPrice - BuyPrice) <= MaxDiff) { CancelPendingOrders (중계 주문 취소) ♪ ♪ 이 모든 것은 var cancelType = null; 이 모든 것은 if (LastBuyPrice > 0 && (ticker.Buy - LastBuyPrice) > SlidePrice) { cancelType = ORDER_TYPE_BUY; ♪ ♪ 이 모든 것은 if (LastSellPrice > 0 && (LastSellPrice - ticker.Sell) > SlidePrice) { if (cancelType == null) { cancelType = ORDER_TYPE_SELL; } else { cancelType = -1; ♪ ♪ ♪ ♪ 이 모든 것은 if (cancelType == -1) { CancelPendingOrders (중계 주문 취소) } else if (cancelType!= null) { CancelPendingOrders (CancelType) 를 사용 하 여 ♪ ♪ var orders = _C (exchange.GetOrders); if (orders.length == 2) { ♪ ♪ var account = _C ((exchange.GetAccount); var amountBuy = _N ((Math.min ((account.Balance / BuyPrice, Lot)); var amountSell = Math.min ((account.Stocks, Lot)); if (amountBuy >= MinStock) { if (orders.length == 0 の ordres[0].Type == ORDER_TYPE_SELL) { if (order.length > 0) { 업데이트Profit ((InitAccount, account, ticker)); ♪ ♪ 교환.Buy ((BuyPrice, amountBuy); LastBuyPrice = 구매 가격 ♪ ♪ ♪ ♪ if (amountSell >= MinStock) { if (orders.length == 0 の オーダー[0].Type == ORDER_TYPE_BUY) { if (order.length > 0) { 업데이트Profit ((InitAccount, account, ticker)); ♪ ♪ 교환.Sell (SellPrice, amountSell) LastSellPrice = SellPrice; ♪ ♪ ♪ ♪ ♪ ♪ function onexit ((() { CancelPendingOrders (중계 주문 취소) ♪ ♪ function main (() { InitAccount = _C (exchange.GetAccount); 로그 (InitAccount); SetErrorFilter (("502: 503: 502: 503: 502: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 503: 502: 503: 503: 503: 503: 503: 503: 503: 503: 502: 503: 503: 502: 503: 503: 503: 503: 503: 502: 503: 502: 503: 503: 503: 502: 503: 503: 503: exchange.SetRate ((1); 루프 인터벌 = Math.max ((루프 인터벌, 1); 로트 = Math.max ((MinStock, 로트); while (true) { (onTick)) Sleep (LoopInterval * 1000); ♪ ♪ ♪ ♪