gRPC is a high performant framework to exchange message for remote procedure call. It use protocol buffers for serializing structured data.

RESTful API is a very popular Web Service framework, which allow web developer to exchange json message through http call.

On the perspective of ease of use, REST is definitely easier than gRPC because gRPC requires the developer to define the message struct in the protocol buffer, and compile it to GO module with protoc compiler.

However, on the perspective of performance, gRPC is much faster than REST. Google Cloud run service can now serve both HTTP and gRPC…

Market Index consists of a list of major companies stock price. There should be a correlation between their prices. Here I would like to use the Machine Learning Model (LSTM) to predict the market index with the historical data of certain stocks.

Data Collection

I use the python package yfinance to get the daily stock price. I downloaded 3-year figures including “Open”, “Close”, “High”, “Low”, and “Volume”

Data Preprocessing

The target variable of the prediction is the Index ETL close price rate of return of the next day, which is defined as

target(t) = ( Close(t+1) - Close(t) )/Close(t) * 100%

Since the value…

Just learned the Oscillator of Moving average (OsMA) and RSI from the post. RSI is an useful indicator of trend and momentum. Inspired by that, I want to try to use that as the machine learning feature to predict the future stock return.

Calculation of RSI and its OsMA

Relative Strength (RS) and Relative Strength Indicator (RSI) can be computed from the Moving Average (MA) of the historical positive price difference (%) divided by that of negative price difference (%).

RS = (MA of positive difference) / (MA of negative difference)

RSI = 100–100/(1+RS)

Here is the code of Julia of the computation. …

(和合本) 應當一無掛慮、只要凡事藉著禱告、祈求、和感謝、將你們所要的告訴 神。



(和合本) 我將這些事告訴你們、是要叫你們在我裏面有平安。在世上你們有苦難.但你們可以放心、我已經勝了世界。



和合本的 “放心” 原文是(02293)鼓起勇氣,是一個命令語句。

(和合本) 我留下平安給你們、我將我的平安賜給你們.我所賜的、不像世人所賜的.你們心裏不要憂愁、也不要膽怯。





你們心裏不要憂愁.你們信 神、也當信我。





(和合本) 所以我親愛的弟兄們、你們務要堅固不可搖動、常常竭力多作主工、因為知道你們的勞苦、在主裏面不是徒然的。




(和合本) 所以我親愛的弟兄們、你們務要堅固不可搖動、常常竭力多作主工、因為知道你們的勞苦、在主裏面不是徒然的。





(羅馬書 6:19 和合本)

既然作主的奴僕,就當然要作主工,奉獻給主用。(58節) 所以……常常竭力多作主工……



(和合本) 感謝 神、使我們藉著我們的主耶穌基督得勝。



羅馬書 第6章正正就解釋左林前15:57所說的勝利,藉著主耶穌基帶來,就係勝過罪和死的權勢。基督為我們的罪而死,使我們脫離罪和死的律,從此不再作罪和死的奴隸,而轉移成為主的奴僕。所以復活不單單只是不致滅亡,更在於勝過罪成聖。


(羅馬書 6:22 和合本)


Matthew Leung

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store