簡単で 学ぶために コードが一番いいのは注釈です
アイスマンの委託購入,小文字Mで注文を分割して購入し,市場の衝撃を避けるのは,Bitcoin量化取引への簡単な入門の良い学習戦略です このプラグインは,取引端末のキーボードで起動し,手動取引を容易にするための手数料がかからない.詳細は:https://www.fmz.com/digest-topic/5051
function main(){ var initAccount = _C(exchange.GetAccount) while(true){ var account = _C(exchange.GetAccount) var dealAmount = account.Stocks - initAccount.Stocks var ticker = _C(exchange.GetTicker) if(BUYAMOUNT - dealAmount >= BUYSIZE){ var id = exchange.Buy(ticker.Sell, BUYSIZE) Sleep(INTERVAL*1000) if(id){ exchange.CancelOrder(id) // May cause error log when the order is completed, which is all right. }else{ throw 'buy error' } }else{ account = _C(exchange.GetAccount) var avgCost = (initAccount.Balance - account.Balance)/(account.Stocks - initAccount.Stocks) return 'Iceberg order to buy is done, avg cost is '+avgCost } } }