फिक्स्ड अंतराल बैच संलग्नक प्लगइन

लेखक:घास, दिनांकः 2020-03-12 16:34:05
टैगः

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



function main() {
    var ticker = exchange.GetTicker()
    if(!ticker){
        return  'Unable to get price'
    }
    for(var i=0;i<N;i++){
        if(Type == 0){
            if(exchange.GetName().startsWith('Futures')){
                exchange.SetDirection('buy')
            }
            exchange.Buy(Start_Price-i*Spread,Amount+i*Amount_Step)
        }else if(Type == 1){
            if(exchange.GetName().startsWith('Futures')){
                exchange.SetDirection('sell')
            }
            exchange.Sell(Start_Price+i*Spread,Amount+i*Amount_Step)
        }else if(Type == 2){
            exchange.SetDirection('closesell')
            exchange.Buy(Start_Price-i*Spread,Amount+i*Amount_Step)
        }
        else if(Type == 3){
            exchange.SetDirection('closebuy')
            
            exchange.Sell(Start_Price+i*Spread,Amount+i*Amount_Step)
        }
        Sleep(500)
    }
    return 'order complete'
}

अधिक