स्पॉट आइसबर्ग एनट्रस्ट सेल प्लगइन

Study Trade-aided Iceberg
निर्माण तिथि: 2020-03-20 16:38:52 अंत में संशोधित करें: 2020-03-24 10:50:43
कॉपी: 31 क्लिक्स: 2692
3
ध्यान केंद्रित करना
1444
समर्थक

Very simple, just for learn. Code is best annotation.

बर्फ के पहाड़ों को बेचने के लिए, आदेशों को छोटे टुकड़ों में बेचने के लिए, बाजार को झटका देने से बचने के लिए, यह एक अच्छी सरल शुरुआत है और बिटकॉइन की मात्रा में व्यापार करने के लिए सीखने की रणनीति है प्लगइन को ट्रेडिंग टर्मिनल पर एक क्लिक के साथ शुरू किया जा सकता है, बिना किसी शुल्क के, मैन्युअल ट्रेडिंग की सुविधा के लिए। अधिक जानकारी के लिएः https://www.fmz.com/digest-topic/5051

रणनीति स्रोत कोड
function main(){
    var initAccount = _C(exchange.GetAccount)
    if (initAccount.Stocks < SELLAMOUNT){
        throw 'check your account amount to sell'
    }
    while(true){
        var account = _C(exchange.GetAccount)
        var dealAmount =  initAccount.Stocks - account.Stocks
        var ticker = _C(exchange.GetTicker)
        if(SELLAMOUNT - dealAmount >= SELLSIZE){
            var id = exchange.Sell(ticker.Buy, SELLSIZE)
            Sleep(INTERVAL*1000)
            if(id){
                exchange.CancelOrder(id) // May cause error log when the order is completed, which is all right.
            }else{
                throw 'sell error'
            }
        }else{
            account = _C(exchange.GetAccount)
            var avgCost = (account.Balance - initAccount.Balance)/(initAccount.Stocks - account.Stocks)
            return 'Iceberg order to sell is done, avg price is ' + avgCost
            
        }
    }
}