The resource loading... loading...

The city of Ox Bear is judging V1.0_

Author: Quantification of district classes, Date: 2019-10-14 17:05:12
Tags: Bollinger

We found that the most important thing to quantify investment is to decide whether the current market is a bear market or a bull market or a bear market.

There are many ways to make a decision, including straightforward judgments, brown lines, highs and lows of transactions and cycles.

Average line judgement is the tendency of the average line to judge whether the current market is up or down. By judging whether the 5-day average line is standing, judge whether the bull is standing, judge whether the 120-day average line is falling, judge whether the bear market is entering. Several factors together determine the strength of the current market.

The Brin line is a good way to judge whether the market is rising or falling based on the slope of the middle line. It is a good practice in the bull market to pull up and down based on the high and low points of the Brin line. If the opening increases, the Brin line is a harbinger of market volatility.

Transaction volume is generally an auxiliary means, generally both at the bottom and at the top. The advantage of digital currencies is that the depth of the transaction is easily obtained. By analyzing the ordering situation and combining the transactions, it is also possible to determine the current market heat.

The above strategies have some difficulties to be implemented, and need to be adjusted slowly. Cycle high and low are the main strategies discussed in this article, with simple and direct benefits. The idea of cycle high and low is very simple, it is a combination of short cycle high and low and long cycle high and low, to determine whether the current market is bull, bull or bear, bear or bear market.

We first paste some of the code, the main idea is in the commentary, which is understandable. Long cycle selects the day line, 5 days for the cycle. Short cycle selects the 30-minute line, 10 for the cycle, i.e. 5 hours.img img

We'll post the results again. Seeing the bulls turn into bears on September 24 and September 25 and the bulls on September 26 and October 7 and the bulls on October 9 are all good tips. Seeing the cycle highs and lows is not easy. img  img

If you combine a digital currency selection strategy with a hedging strategy, there is more to play with. If you list the top 20 digital currency bulls by market cap, you can basically achieve low-risk arbitrage by selecting two digital currency bears and bulls to hedge against each other.

I'm sure you'll be able to help me.I've been trying to find you.▽ Coinbase is a place where you can write articles and earn money with digital currency. I can't believe this!img


/*backtest
start: 2019-01-01 00:00:00
end: 2019-10-10 00:00:00
period: 1d
exchanges: [{"eid":"Bitfinex","currency":"BTC_USD"}]
*/
//通过快慢周期的高低点判断当前处于什么市场
//注册币乎后https://m.bihu.com/signup?i=1ewtKO&s=4&c=4
//搜索 物联网区块链 可以联系到作者区班主
function main() {
    var dhigh;
    var dlow;
    var mhigh;
    var mlow;
    var status_name=["猴市","大牛","小牛","大熊","小熊"];  //定义并赋值
    var before_status=0;
    var now_status=0;
    while (true) {
        var drecords = exchange.GetRecords(PERIOD_D1);
        var mrecords = exchange.GetRecords(PERIOD_M30);
        //日线5天内的高低点(不包含当前Bar)
        dhigh=TA.Highest(drecords, dnum, 'High');
        dlow=TA.Lowest(drecords, dnum, 'Low');
       
        //30分钟线10个周期内的高低点(不包含当前Bar)
        mhigh=TA.Highest(mrecords, mnum, 'High');
        mlow=TA.Lowest(mrecords, mnum, 'Low');
        
        if(mlow>dhigh){ //分钟低点突破日高点,大牛开始
            now_status=1;
            //Log("大牛");
        }else if(mhigh>dhigh&&mlow<=dhigh){ //分钟高点突破日高点,但是分钟低点还没突破日高点,小牛开始
            now_status=2;
            //Log("小牛");
        }else if(mhigh<dlow){  //分钟低点跌破日低点,大熊开始
            now_status=3;
            //Log("大熊");
        }else if(mlow<dlow&&mhigh>dlow){  //分钟低点跌破日低点,但是分钟高点还没跌破日低点,小熊开始
            now_status=4;
            //Log("小熊");
        }else{  //没有方向,猴市
            now_status=0;
            //Log("猴市");
        }
        if(now_status!=before_status){
            Log("日线高点",dhigh," 日线低点",dlow,"30分钟线高点",mhigh," 30分钟线低点",mlow);
            Log(status_name[before_status],"转",status_name[now_status]);
            before_status=now_status;
        }
        Sleep(Interval*1000);
    }
}

Related

More

fmzguestThe quantitative thinking of the boss is worth learning, it's great.

dsaidasiThis kind of quantification is nothing more than the human eye.

P. | Algo-BeatsI'm going to be in the city tomorrow.