The resource loading... loading...

98 undergraduate coins and the way to quantify

Author: The little genius harvester, Created: 2020-03-07 18:11:51, Updated: 2023-10-11 19:52:46

img

98 undergraduate coins and the way to quantify

1.入币圈

I'm currently studying computer science at a 985 undergraduate university in the year '98 and I will continue my studies there.

The first contact with the coin circle was on September 1, 2017, yes, I remember this day very clearly, because it was three days later that the coin circle was rocked by the Coin 94 Incident, the Central Bank and other five-ministerial committees issued a joint statement to protect against ICO risk, the coin price belt.

On September 1st, I saw a video about Bitcoin on a WeChat forum (like a video of Wang himself), I was very curious about it, so I downloaded the token, filled it with 100 bucks, and when I saw the price of Bitcoin, 3W more yuan, I was scared, so I bought a little bit of LTC, which was about 120 yuan, and the next night I looked at the float of a few shillings in the account, and the people in the circles of the money were talking qqq.

On September 4th, the central bank wrote a statement, the currency price jumped, frightened me to hurry to cut the meat off, and then slowly watched the currency's price drop, when the domestic exchanges such as tokens etc. could not be registered, the domestic exchange rate was huge, fat a wave of people moving.

Later I went back to school, and I didn't rush back to transcribe it (new cabbage only knows how to chase down), but I still pay attention to the movement of the coin circle, from time to time to see what everyone is talking about in a few QQ groups.

On January 18th, the bull market started to crash, I registered okcoin, started playing the contract, I have to say it was really exciting, 20 times the leverage, doubled, popped up, so many times, staring at the k line, sleepless nights.

Like almost all contract gamblers, I ended up in the middle of a bust. But I have to say that this experience taught me a lot of financial knowledge that I would never have recognized before.

2.搞量化

After many sleepless nights on my desk, as a computer student, I began to think about whether there was a way to let the program trade for me so I could sleep better.

In fact, I found fmz (then called botvs), but I was too lazy and didn't understand how to use the platform for half a day, so I gave up.

Later I started to write my own API for the bot (github:https://github.com/ccyanxyz/okexIn addition, he has written several strategies, such as double straight lines, grids, etc. Although he did not make much money, he also stepped into the quantitative gate, learned about various technical indicators, learned to use the talib library. Later, because there was a lot of school work, he did not continue to do it, the robot stopped, and returned to the manual viewing mode, but the frequency was very low, operating one or two from time to time.

3.用FMZ

After a spin, I went back to fmz, but this time it was very fast because I already had experience with my own handwriting strategies. I found that fmz pairs almost all mainstream exchanges, packs transactions, accounts, etc. into a single package, and is convenient and easy to use.

I found the policy repository open to fmz on GitHub.https://github.com/fmzquant/strategiesIt was like finding a treasure, I spent a night or two going through all the strategies, copying and proofreading, reading the strategy logic, trying to improve, but I have to say, I'm still a vegetarian, I've read the strategies and I haven't written a pencil.

Later, I also calm down and thought about it carefully, now the coin circle is not 17 years old, there will be no mythical story of 2000 pieces to 2000w, about my poor student, the cost of this coin, wanting to flip the coin is already a nightmare, so I gave up staring at the price of the coin chasing down, and also gave up trying to write this unrealistic idea of the strategy of the coin, and instead began to advertise in the FMZ area, honestly writing a little hard money.

By now, I have written a lot of strategies for people, and the process is actually quite twisted, often people come to me with some immature ideas or strategies that are not profitable at all, many people's needs are not clearly described, and the last strategy is measured to measure not profitable but also rude, so I changed my ads to the following, so as to set up the rules and standards of receipt, and also make myself a little less worried.

My frequency of calls was getting lower and lower, because I was busy at school and many people rejected me, but fcoin ran out in February and took most of my assets (although I didn't have much money), so I recently had to accept newcomers and make money.

My strategic library:

I also noticed something a little bit silent today on Fmz, a single-click friend who actually copied my single-click ad, which is his ad:

I'm going to change my familiar soup into a skilled soup, and then lower the starting price (smell a bit of nasty competition).

Why didn't I say that I'm fluent in FMZ, I don't know if you've ever heard a line that says that no one can be fluent in C++, haha, so my resume and other related skills are used to writing "familiar".

4.一个套利思路

Recently I have been researching some of the strategies of hedging, hedging, hedging, hedging, hedging, hedging, etc. I saw a strategy idea that I have not seen before (maybe I am a loner), share it here.

Let's assume that there are several trades in the Forex market at the following prices:

USDollar/BritishPound 0.5
BritishPound/FrenchFranc 10.0
FrenchFranc/USDollar 0.21

In this case, regardless of the transaction fees, if I had 1 USD, I could exchange it into British Pounds first, then into French Francs, then into USD, and again down from 1 USD to 1x0.5x10.0x0.21 = 1.05 USD, profit 0.05 USD.

In the above example, there is a leverage opportunity, but this one is not:

USDollar/BritishPound 0.5
USDollar/FrenchFranc 4.9
BritishPound/FrenchFranc 10.0
BritishPound/USDollar 1.99
FrenchFranc/BritishPound 0.09
FrenchFranc/USDollar 0.19

How do we determine if there is a leverage in this huge market?

This problem can be abstracted as a shortest path problem with a directional graph, with each currency as a vertex, with the exchange rate as a side weight, forming a directional graph, and then starting from a vertex (e.g. USD) looking for a circular path in the graph that can be used.

The example above is from an OJ article.http://poj.org/problem?id=2240In the meantime, I'm going to try to get some answers to these questions.http://hehejun.blogspot.com/2018/10/poj2240-arbitrage.html

So I've been wondering recently if I could come up with a strategy to capture leverage and leverage, and a quick search on GitHub has already done that:https://github.com/wardbradt/peregrineThis project is to abstract this setup problem into the shortest path problem of the negative right-hand side of a directed graph. Unlike the OJ problem above, the shortest path problem of the negative right-hand side of a directed graph uses the Bellman-Ford algorithm.

I myself made a simple implementation on fmz, referring to OJ's problem-corresponding solution idea, which is not finished yet and cannot guarantee correctness, paste it out, throw in quotes:

var coins = {
    EMPTY: 0,
};
var price = {};

function get_coins() {
    for(var i = 0; i < exchanges.length; ++i) {
        var base = _C(exchanges[i].GetCurrency);
        var quote = _C(exchanges[i].GetQuoteCurrency);
        var len = Object.keys(coins).length;
        if(!coins.hasOwnProperty(quote)) {
            coins[quote] = len;
            len += 1;
        }
        if(!coins.hasOwnProperty(base)) {
            coins[base] = len;
            len += 1;
        }
    }
}

function get_graph() {
    var graph = [];
    for(var i = 0; i < exchanges.length; ++i) {
        var ticker = _C(exchanges[i].GetTicker);
        var base = _C(exchanges[i].GetCurrency);
        var quote = _C(exchanges[i].GetQuoteCurrency);
        graph.push({
            from: coins[base],
            to: coins[quote],
            weight: ticker.Buy
        });
        price[base + quote] = ticker.Buy;
        graph.push({
            from: coins[quote],
            to: coins[base],
            weight: 1 / ticker.Sell
        });
        price[quote + base] = 1 / ticker.Sell;
    }
    return graph;
}

function bfm(graph, initAmount, feeRate) {
    var dist = [];
    var pre = [];
    var i;
    var j;
    var fee = 0;
    for(i = 0; i < Object.keys(coins).length; ++i) {
        dist.push(0);
        pre.push(-1);
    }
    dist[1] = initAmount;
    for(i = 0; i < Object.keys(coins).length - 1; ++i) {
        for(j = 0; j < graph.length; ++j) {
            var from = graph[j].from;
            var to = graph[j].to;
            var rate = graph[j].weight;
            if(dist[from] * rate > dist[to]) {
                dist[to] = dist[from] * rate;
                pre[to] = from;
            }
        }
    }
    if(dist[1] <= initAmount) {
        return false;
    }
    var path = [];
    var top = pre[1];
    var coin_keys = Object.keys(coins);
    path.push({
        from: coin_keys[top],
        to: coin_keys[1],
        rate: price[coin_keys[top] + coin_keys[1]]
    });
    while(top != 1) {
        var temp = top;
        top = pre[top];
        path.push({
            from: coin_keys[top],
            to: coin_keys[temp],
            rate: price[coin_keys[top] + coin_keys[temp]],
        });
    }
    path.reverse();
    
    fee = path.length * feeRate * initAmount;
    if(dist[1] - initAmount <= fee || path.length == 0) {
        return false;
    }
    return path;
}

function onTick() {
    var graph = get_graph();
    var account = _C(exchanges[0].GetAccount);
    var balance = account.Balance;
    
    var path = bfm(graph, balance, 0);
    if(!path) {
        return;
    }
    Log(path);
    
    // buy & sell follow the path 
    ...
}

function main() {
    get_coins();
    
    while(1) {
        onTick();
    }
}

5.总结

In summary, fmz is a good platform, useful and reliable, the buzz is making money, hopefully fmz will get better and better, I'm going to graduate and continue my studies (also in the blockchain direction), and then continue to move to fmz and spend zero money.

(Written on the afternoon of March 7, 2020, just after helping someone write a strategy and seeing their own FMZ balance is not enough, they came to cheat the script Fehhahahaha)

We have also received a number of requests for information.


Related

More

liuyuxuanThe micro-signal is wrong, how can I contact you?

superzhang2021The micro-signal error

wjunThanks for sharing. Github link to Strategy Repository, very helpful!

oolndooHello, it's good to see you, I just posted a strategic request. Now the landlord can't pay.

Inventors quantify - small dreamsI'm not going to say that I'm not.

The grassThank you for sharing.

b6712It can be used in monetary circles, but foreign exchange swaps in international finance are undergraduate work, so it is possible that there is no swap.

czgcoolIt's a geek's way of getting the most out of learning about finance through quantification.

John。I'm not going to lie to you.

The little genius harvesterI'm not going to do it.