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. …


source: https://bible.fhl.net

這節聖經,和合譯本跟希臘原文,意思基本上一樣。第二句:「親身擔當了我們的罪」中的擔當,原文除了有擔當的意思,另外也有呈獻,特別是一個獻祭制度的術語,是帶上去祭壇的意思 (下面點2):


(和合本) 他對我說、我的恩典彀你用的.因為我的能力、是在人的軟弱上顯得完全.所以我更喜歡誇自己的軟弱、好叫基督的能力覆庇我.

(希臘文原文)

source: https://bible.fhl.net

有一個字,這節出現了兩次,第五節也出現了一次,就係軟弱(00769)


(和合本) 我靠著那加給我力量的、凡事都能作。

(希臘文原文)

source: https://bible.fhl.net

I just written the following article for the data science blogathon competition. It is about how to use Bayesian inference with Geometric Brownian Motion to simulate Stock Price. The implementation is by the Julia package “Turing.jl”. If you interested, you may take a look to support me.

https://www.analyticsvidhya.com/blog/2021/05/bayesian-approachgeometric-brownian-motion-in-stock-price-simulation/


(和合本) 我的 神必照他榮耀的豐富、在基督耶穌裏、使你們一切所需用的都充足。

(希臘文原文)

source: https://bible.fhl.net

動詞在希臘文是很重要的,這節經文只有一個動詞,就係充足(04137),其意思是使…滿足,fulfills ,使什麼得到滿足呢?就係我哋每一個需求丶需要的事,如何得到滿足呢?是照著神的豐富,照著意思解作依據丶按照,即係依據神的豐富來滿足我們的需求,並非緊緊合格或勉強足夠,而這個豐富是在榮耀裏和在基督耶穌裏的,我的理解是神藉耶穌基督來滿足我們的需要,而且是顯出神的榮耀,我哋祈禱的時候,奉耶穌基督之名向天父祈求,神應允,是耶穌成就左救恩的結果,因為神藉基督的寶血悦納我哋,而且也是顯出神的榮耀。

另外,充足滿足這個動詞是將來式,可能未必即時滿足,需要我哋去等待,但我們可以憑著這應許,盼望將來成就。


(和合本) 神所賜出人意外的平安、必在基督耶穌裏、保守你們的心懷意念。

(希臘文原文)

source: https://bible.fhl.net

和合本的「出人意外的平安」,在其他譯本有不同的譯法。和合修訂本譯做「超越人所能理解的平安」,新漢語譯本跟和合修訂本差不多一樣,新普及譯本也類近,譯做「這平安超越了我們能理解的任何事物」,而原文則是「高過一切心思」,「超越」原文是05242,包含有「優越較好」的意思,即是好過人所有心思,我個人覺得可以有兩種解釋:(1)是神的平安是超過我們所能理解,可能是指神的平安很奇妙,往往非人所能明白;(2)另一可能的解釋是神的平安比我們自己的心思更好,類似於以賽亞書 55:9「天怎樣高過地,照樣,我的道路高過你們的道路;我的意念高過你們的意念。」有時候,我們對將來發生的事情有很多思想上的準備,例如想像最差的情況可以如何應對,但係神話祂賜的平安比這些思想準備更好,我們可以倚靠神的平安安息,當我們思考將來發生種種的可能性時,往往會有很多負面情緒,很多壞的情況是人不能面對的,於是產生很多憂慮恐懼,但係這節聖經話比我哋知,神的平安比這些思想準備更好,更能保守保護我們的心和意念,即係我哋嘅內心和思想,當我們想返神的恩典,神過去所保守自己的平安,集中這些真實正面的思想,就能去除那些還未發生的負面思想。


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

(希臘文原文)

source: https://bible.fhl.net

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