天天看點

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

加密數字貨币市場現狀

My name is 01001000 01000001 01001100, AI of AIs;

Look upon my Works, ye Traders, and despair!

我的名字是01001000 01000001 01001100 ,AI的AI; 交易員,請看我的作品,絕望!

A while ago I covered Intelletic’s AI-generated “Price Prediction Alerts”, and unpacked what makes their cortical algorithms so interesting. They’ve designed a mixed-biological hierarchical model that generates “warnings” of Bitcoin price spikes in either direction. These predictions can then be used to make more informed trading decisions.

不久前,我介紹了Intelletic的AI生成的“價格預測警報” ,并解壓縮了使他們的皮質算法如此有趣的原因。 他們設計了一種混合生物學的分層模型,該模型會生成雙向警告的比特币價格上漲“警告”。 這些預測然後可以用來做出更明智的交易決策。

I also spoke about harnessing pigs to sniff out truffles, which is more relevant than you’d think.

我還談到利用豬嗅出松露,這比您想象的要重要得多。

However, I wrote “how and why the tech works”, not “does it actually work?”. When money’s on the line, this is rather important.

但是,我寫了“技術如何以及為什麼起作用”,而不是“它實際上起作用了嗎?”。 當有錢的時候,這很重要。

So I wrote a bot that trades virtual Bitcoin portfolios based on PPAs, and gave it the last 4 years of data to see if it works.

是以,我寫了一個機器人,可以根據PPA交易虛拟比特币投資組合,并提供最近4年的資料以檢視其是否有效。

It works. Terrifyingly so.

有用。 太可怕了。

自動交易算法 (Auto-trading Algorithms)

The PPA-generating AI itself is like a pig sniffing for truffles. But the pig is robotic, so it’s always sniffing and notifies you immediately if it picks something up. Also, if you don’t dig up the truffle within an hour, the pig eats it.

産生PPA的AI本身就像是豬在嗅松露。 但是這頭豬是機器人,是以它總是在嗅探,如果發現了東西,會立即通知您。 另外,如果您在一小時内沒有挖到松露,豬就會吃掉它。

This something of a hassle to deal with manually. Rather than make my own decisions based on Intelletic’s price alerts, I decided to write a bot that just bets 10% of the portfolio when a PPA tells it to buy or sell Bitcoin.

手動處理這很麻煩。 我不是根據Intelletic的價格警報做出自己的決定,而是決定編寫一個機器人,在PPA告訴它購買或出售比特币時,隻下注10%的投資組合。

Specifically, it trades with auto-stops based on each PPA’s 75% confidence threshold. A

5_minute_long

PPA with

75%_confidence = 50

means: During 75% of previous

30_minute_longs

, the price of BTC rose by at least $50 at some point during the 75 minutes (time and direction determined by type of PPA).

具體來說,它會根據每個PPA的75%置信度門檻值與自動停止進行交易。 一個具有

75%_confidence = 50

5_minute_long

PPA是指:在之前的

30_minute_longs

75%中,BTC的價格在75分鐘内的某個時候至少上漲了50美元(時間和方向由PPA類型決定)。

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

source 資源

The bot bets on that 75% chance the price will rise at least $50. Upon receiving the above alert, it converts 10% of the portfolio’s $USD to BTC.

該機器人下注了75%的機會,價格将上漲至少50美元。 收到上述警報後,它将投資組合的10美元的美元轉換為BTC。

The bot then sets an “auto-stop”: a subroutine that observes price changes for the next 75 minutes, and automatically sells 10% of the portfolio’s BTC if the price reaches the +$50 threshold.

然後,機器人設定“自動停止” :該子例程在接下來的75分鐘内觀察價格變化,如果價格達到+ $ 50門檻值,則會自動出售投資組合的BTC的10%。

The reverse is true for a predicted price drop: it sells 10% of its BTC and buys more BTC (with 10% of $USD) if the price drops far enough.

相反,對于預期的價格下跌是正确的:如果價格下跌得足夠遠,它将出售10%的BTC并購買更多的BTC(價格為10%)。

This is some wickedly simple logic, by the way. There’s no threshold gradients at which to sell different percentages, no steady sequestering of a portion of profit to guard against volatility. The bot merely rides the price lines like a surfer going with the waves.

順便說一下,這是一些非常簡單的邏輯。 沒有可以出售不同百分比的門檻值梯度,也沒有穩定地隔離一部分利潤以防止波動。 機器人隻是像沖浪者一樣順着價格行進。

Simple is usually better.

簡單通常更好。

是誰的午餐? (Whose Lunch Is It?)

I like being “disruptive” as much as the next machine learning engineer, but who or what exactly are we trying to disrupt? What’s our competition — whose lunch are we trying to eat?

我喜歡和下一位機器學習工程師一樣具有“破壞性”,但是我們到底想破壞誰? 我們的競争是什麼-我們想吃誰的午餐?

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

source: Morningstar, The Balance 資料來源:Morningstar,The Balance

Index funds are pretty good : The S&P 500 has yielded 11% average annual returns since 1926, though it varied from 30% in 2013 to -38% in 2008.

指數基金相當不錯:自1926年以來,标準普爾500指數的年均收益率達到11%,盡管從2013年的30%到2008年的-38%不等。

Mutual funds are more consistent, but can fall shorter overall and include management fees. Based on the past 15 years, we see ~5–8% annuals quite often.

共同基金更為一緻,但總體而言可能會減少,并包括管理費。 根據過去的15年,我們經常看到約5–8%的年增長率。

Senior fund managers make decisions for mutual portfolios, so I suppose their managerial lunch is what we’re after.

進階基金經理會為共同投資組合做出決策,是以我想他們的管理午餐便是我們所追求的。

如果future_price ==上升:buy() (if future_price == rise: buy( ))

Initial testing was quite compelling: 450% growth of the initial $5,000 investment over 3.5 years! Nice.But remember, BTC was $900 per coin in early 2017 and peaked at $20,000 mid-2018. One can hardly expect the same growth or results in the future.

初始測試非常引人注目:在3.5年内,5,000美元的初始投資增長了450%! 不錯,但請記住,BTC在2017年初為每枚代币900美元,并在2018年中期達到20,000美元的峰值。 人們幾乎不可能期望未來會有相同的增長或結果。

I drummed up a “rolling backtest” algorithm that begins a new 90-day portfolio every day. This allows a much more nuanced metric of performance:We now have ~1,300 portfolios, one created each day since the beginning of 2017, to average and compare overall.

我提出了“復原測試”算法,該算法每天都會開始一個新的90天投資組合。 這使得性能名額更加細微:我們現在擁有約1,300個投資組合,自2017年初以來每天建立一個投資組合,以求平均并比較整體。

The bot manages each portfolio according to the following logic:

機器人根據以下邏輯管理每個産品組合:

every 5 minutes:    if PPA activates:
        buy/sell() with 10% of USD/BTC # make bet
        create auto-stop # track bet    check each auto-stop:
        if current_price exceeds stop.threshold:
            buy/sell() # bet paid off
            profit()
           
加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

I later fixed some typos which boosted performance (go figure) 後來我修複了一些錯别字,進而提高了性能(見圖)

Here’s an unpleasantly long, non-modular version. Coding it wasn’t that bad, all things considered.

這是一個令人讨厭的長非子產品化版本。 考慮到所有因素,編碼并不是那麼糟糕。

I created a Portfolio class that keeps track of wealth & dates, as well as Auto-Stop objects that are stored in the portfolio & deactivate over time.

我建立了一個Portfolio類,該類跟蹤财富和日期以及存儲在Portfolio中的自動停止對象并随時間停用。

Runtime isn’t amazing; I ended up with a lot of nested loops to keep track of each portfolio at every 5-minute interval for 3.5 years.

運作時并不驚人。 我結束了很多嵌套循環,在3.5年的時間裡每隔5分鐘跟蹤一次每個投資組合。

But it trades quite well, in the end. We’re left with two lists of portfolios, one having completed their determined length and the other left unfinished.

最終,它交易得很好。 我們剩下兩份投資組合清單,一份完成了确定的長度,另一份未完成。

Let’s have a look through the average

wealth_change

for each portfolio.

讓我們看一下每個投資組合的平均

wealth_change

擊敗市場 (Beating the Market)

Aggregating each portfolio in the list of

ports

:

彙總

ports

清單中的每個投資組合:

The average starting investment per portfolio was

$16,409.16

;The average 90-day growth was

$1488.47

;

每個投資組合的平均初始投資為

$16,409.16

;平均90天的增長為

$1488.47

The scrappy little bot brought home 9% returns in three months.

這個頑皮的小機器人在三個月内帶回了9%的回報。

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

I ran another rolling backtest, this time with 6-month portfolios:

我又進行了一次滾動回測,這次是6個月的投資組合:

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

16.5% isn’t bad for simply doubling the length to 180 days, either.

隻需将長度增加一倍至180天,也不差16.5%。

It may be unfair to directly compare these 3-month and 6-month returns to the index / mutual 12-month averages, of course, due to the differences in time periods.

當然,由于時間段的不同,直接将這三個月和六個月的回報與指數/十二個月的共同平均值進行比較可能是不公平的。

However, I am left with two choices for my own savings:

但是,我有兩種選擇可以節省自己的錢:

  1. Trust a hedge fund manager to give me ~4–8% gains every 12 months

    信任對沖基金經理,使我每12個月可獲得約4-8%的收益

  2. Trust an AI manager to give me ~9% gains every 3 months

    信任AI經理,每3個月可獲得約9%的收益

Both managers use highfalutin jargon and care for my well-being about the same. One is significantly harder to understand than the other.

兩位經理都使用highfalutin行話,并關心我的幸福。 一個比另一個更難了解。

加密數字貨币市場現狀_如何用人工智能打敗加密貨币市場 自動交易算法 (Auto-trading Algorithms) 是誰的午餐? (Whose Lunch Is It?) 如果future_price ==上升:buy() (if future_price == rise: buy( )) 擊敗市場 (Beating the Market)

TODO: program bot to brag about crypto gains on twitter TODO:程式機器人吹噓Twitter上的加密收益

This backtesting has instilled in me the desire to test further. The results seem almost too convenient, which makes me feel like I’ve made a hilarious error in my code somewhere along the way. If you find one on my GitHub, do let me know.

這種回測使我灌輸了進一步測試的願望。 結果似乎太友善了,這讓我覺得我在執行過程中的某個地方在代碼中犯了一個滑稽的錯誤。 如果您在我的GitHub上找到一個,請告訴我。

Overall, this was a very fun first examination into how Intelletic’s PPAs can augment a trading strategy. The algorithm I designed is extremely simple, and there’s infinite room to improve and add nuance.

總體而言,這是對Intelletic的PPA如何增強交易政策的一次非常有趣的考察。 我設計的算法非常簡單,并且有無限的空間可以改善和增加細微差别。

The next step is to write a real bot that engages with an exchange’s API, so I can actually make some cash. Perhaps enough to buy a pig.

下一步是編寫一個與交易所的API互動的真實機器人,這樣我就可以實際賺錢了。 也許足以買一頭豬。

翻譯自: https://medium.com/@mark.s.cleverley/how-to-beat-the-crypto-market-with-artificial-intelligence-898b57af2f66

加密數字貨币市場現狀