跳到主要內容

三種資料

 

成交前:

    OrderBook 上有交易所所有的掛單資料

    理論上最好的成交價格 midPrice = (bestAsk + BestBid) / 2

成交時:

    Trade Price, Volume ... (Tick Level)

    Trade Price 是實際上的成交價格

    用法:trade.price

成交後:

    根據 interval,累積一段時間的 Trade 資料,有兩種:

        1. onClosed() 

        2. 即時 Stream

    用法:kline.close


資料來源可能是 stream 也可能是 web api  , 看各交易所實作的情況

(註記:理論上所謂的成交前狀態應該不存在,那是薛丁格的狀態)


更新:Tick period = average time between changes in the mid-price.

Tick 事件有三種可能的發生原因:

    1. "BID" (one side is LO)

    2. "ASK" (one side is LO)

    3. "TRADE" (one side is MO, both sides are MO, two LO at the same price)

當 mid price 發生改變的狀態,一定會 emit tick event


更新:這邊的 tick 是 mid price 的話,那要 best bid/ask 改價格才會變動。

撤單下單在 best bid/ask 範圍區間內都會影響!

trade 把best bid/ask taken away 那也會影響!

但是假如 trade 不夠多,tick還是不變的!


留言

這個網誌中的熱門文章

All-in Summit

判斷人類發展的趨勢,找出人類下一步最缺乏的東西,然後用科學、工程的方式提出解法,只要不被物理定律限制什麼方法都有可能。

Papers on Quant Research

  The Cross-Section of Expected Stock Returns   Source  https://www.ivey.uwo.ca/media/3775518/the_cross-section_of_expected_stock_returns.pdf Comment  This is the famous Fama-French paper, which proposed the Fama-French factor model, and the basics of cross-sectional equity research methods. Value and Momentum Everywhere   Source   https://pages.stern.nyu.edu/~lpederse/papers/ValMomEverywhere.pdf Comment  A good introduction to value and momentum; they can generate abnormal returns for individual stocks within several countries, across country equity indices, government bonds, currencies, and commodities. Mean Reversion in Stock Prices: Evidence and Implications   Source   http://papers.ssrn.com/sol3/papers.cfm?abstract_id=227278 Comment  One of the earliest papers reflecting the mean-reversion nature of stock prices. Price Momentum and Trading Volume   Source   http://technicalanalysis.org.uk/volume/LeSw00.pdf Comment  Gi...
You’re not stuck at home. You’re sitting on homeground advantage. Create. Iterate. Let adversity shape the best of you. Focus. Focus. Focus. The world will restart, and when it does, don’t just come back as you were. Come back stronger.