購入価格を設定して,購入が成功した後,自動で販売価格を設定して,販売価格を設定します. このプラグインは,取引端末のキーボードで起動し,手動取引を容易にするための手数料がかからない.詳細は:https://www.fmz.com/digest-topic/5051
function CancelPendingOrders() { var orders = _C(exchange.GetOrders); for (var j = 0; j < orders.length; j++) { exchange.CancelOrder(orders[j].Id, orders[j]); } } function main() { Log('robot starts to run') if(BUYPRICE >= SELLPRICE){ throw 'check buy and sell price' } CancelPendingOrders() var account = _C(exchange.GetAccount) var init_account = account Log('account: ', account.Balance); if(account.Balance > BUYPRICE*BUYAMOUNT){ exchange.Buy(BUYPRICE, BUYAMOUNT); }else{ throw 'account balances is not enough' } while(true){ account = _C(exchange.GetAccount) if(account.Stocks >= init_account.Stocks + 0.01){ exchange.Sell(SELLPRICE, account.Stocks - init_account.Stocks) } Sleep(Intervel*1000) } }