Type/to search

Version simple d'ordre iceberg d'achat

Study
3
Follow
1507
Followers

Très simple, juste pour apprendre. Le code est la meilleure annotation.

Achat par iceberg : diviser l'ordre en petites quantités M pour éviter un impact sur le marché. C'est une excellente stratégie d'apprentissage simple pour débuter le trading quantitatif de Bitcoin.

Source
JavaScript
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.
Strategy parameters
Strategy parameters
amount to buy
iceberg order size
orders exist time(second)
Comment
All comments (1)

    仅为教学目的,最简单的冰山策略。

    7 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)