Set the price of Bitcoin and WeChat push 100 to get a full breakthrough push

Author: FMZ_JH, Date: 2020-10-15 16:45:50
Tags: Tool

Teaching strategies: When the price is an integer of 100, a WeChat push is performed, which produces an array of changes containing 10 elements.

Preferred locking data area Did the data from the consultation cross this range? Then above this range, break up to compare the data from the previous trigger if it's different. And then the top of this range is going to break down and compare the data to the last time you triggered it, and if it's different, note that there's a 100 range that needs to be added because it all comes down to the bottom integer range. Push the array forward The Cycle


/*backtest
start: 2020-10-13 00:00:00
end: 2020-10-14 01:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"OKEX","currency":"BTC_USDT"}]
*/
var a=[1,2,3,4,5,6,7,8,9,10]
var ticker= _C(exchange.GetTicker)

function lock(){                                //锁定现价在哪个整数区间
    P=parseInt(ticker.Last/100)*100
    HP=P+100
    lock_tickLast=ticker.Last
//    Log(P,HP,ticker.Last)
} 

function stack(){
    for(var k=0;k<a.length;k++)
        a[k]=a[k+1]
}    

function onTick(){
    ticker = _C(exchange.GetTicker) 
    var get=parseInt(ticker.Last/100)*100
    if(get>P){
        a[9]=get 
        if(a[8]!=a[9]){
            str=a.toString()
            if(a[9]-a[8]>100)
                Log("向上跳空突破成功",get,ticker.Last,"{",str,"}",'@')
            else                        
                Log("向上突破成功",get,ticker.Last,"{",str,"}",'@' )
            lock()
            stack()
        }
    } 
    else if(get<P){
        a[9]=get+100
        if(a[9]!=a[8]){
            str=a.toString()
            if(a[8]-a[9]>100)
                Log("向下跳空突破成功",a[9],ticker.Last,"{",str,"}",'@')
            else
                Log("向下突破成功",a[9],ticker.Last,"{",str,"}",'@' )
            lock()
            stack()
        }
    }
}

function main(){

    lock()
    a[8]=P
//    var ticker=0
    Log("程序运行开始推送",ticker.Last,'@')
    
    while(true){ 

            onTick()  

        Sleep(Interval*1000)                      
            
    }    
}



Related

More