股票價格是如何確定的?
我試圖了解如何確定資產的程式碼價格,在這種情況下,我專門查看來自 GDAX 的 BTC 數據。問題源於從 GDAX 下載歷史 BTC 數據並看到以下內容(截斷):
1516099829,11921.070000000000,0.008100000000 1516099829,11921.070000000000,0.037873260000 1516099829,11921.070000000000,0.031519050000 1516099829,11921.060000000000,0.037464080000 1516099829,11920.000000000000,0.001000000000 1516099829,11912.530000000000,0.001678900000 1516099829,11909.000000000000,0.000100990000 1516099829,11908.360000000000,0.001000000000 1516099829,11908.360000000000,0.001000000000 1516099829,11900.630000000000,0.001680580000 1516099829,11900.000000000000,1.293924550000 1516099829,11900.000000000000,0.132108480000 1516099829,11895.000000000000,0.000300000000 1516099829,11891.170000000000,0.000727720000 1516099829,11890.190000000000,1.400000000000 1516099829,11890.160000000000,0.000838510000 1516099829,11890.000000000000,0.058736000000 1516099829,11888.740000000000,0.001682260000 1516099829,11885.310000000000,0.252173310000 1516099829,11882.920000000000,0.841910000000 1516099829,11876.860000000000,0.001683950000 1516099829,11876.310000000000,0.000728620000 1516099829,11871.000000000000,0.000100990000 1516099829,11871.000000000000,0.000100990000 1516099829,11869.590000000000,0.010000000000 1516099829,11868.000000000000,0.000100990000 1516099829,11865.630000000000,0.010000000000 1516099829,11865.000000000000,0.001685630000 1516099829,11864.490000000000,0.900000000000 1516099829,11864.480000000000,1.113098000000010000000000 1516099829,11865.000000000000,0.001685630000 1516099829,11864.490000000000,0.900000000000 1516099829,11864.480000000000,1.113098000000010000000000 1516099829,11865.000000000000,0.001685630000 1516099829,11864.490000000000,0.900000000000 1516099829,11864.480000000000,1.113098000000
如您所見,價格在一秒鐘內波動很大。我知道這個數據是準確的,並顯示了第二個執行的所有訂單,但我不明白這一秒的程式碼價值是如何確定的。
我放棄了(可能是不正確的)假設,即一遍又一遍地從他們的 REST API 中獲取程式碼值不會在一秒鐘內顯示出這些劇烈的波動。我得出這個結論是因為我已經執行了一個循環,該循環僅以 300 毫秒的延遲反复獲取行情數據,而且價格從未在同一秒內發生變化。事實上,它顯示相同的時間戳,直到價格發生變化,在這種情況下,它顯示新的時間戳。這讓我相信,幕後有一些東西根據那一秒發生的所有交易來確定每秒的股票價格。
如果有幫助,我問這個是因為我想為我編寫的程序回測 GDAX 數據。在我的程序中,我每兩秒獲取目前時間點的程式碼數據,並返回一個值(程式碼價格)。現在,當回測和 1516099829 出現時,我不知道該使用哪個價格。根據我使用的數據點,我的程序會表現得非常不同,因為價格差異很大。
您訂閱了 wss 提要,您可以看到大多數亞秒級的東西正在打開和取消不影響票價的限價單。只有市場訂單代表比特幣的交換。市價單是流動性接受者,所以要收費。它們代表實際的市場運動。限價單通常永遠不會被匹配。我經常在正常的交易氣氛下,每分鐘到五分鐘才有市場訂單。所以股票價格更恆定。希望這有幫助。