Value | Meaning |
---|---|
DB-statistic << 2 | positive serial correlation |
DB-statistic ~ 2 | no first-order correlation |
DB-statistic >> 2 | negative serial correlation |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# expects a numpy array with trades | |
# each trade is composed of: [time, price, quantity] | |
def generate_tickbars(ticks, frequency=1000): | |
times = ticks[:,0] | |
prices = ticks[:,1] | |
volumes = ticks[:,2] | |
res = np.zeros(shape=(len(range(frequency, len(prices), frequency)), 6)) | |
it = 0 | |
for i in range(frequency, len(prices), frequency): | |
res[it][0] = times[i-1] # time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def returns(candles_close_prices): | |
return np.diff(np.log(candles_close_prices)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# expects a numpy array with trades | |
# each trade is composed of: [time, price, quantity] | |
def generate_dollarbars(trades, frequency=1000): | |
times = trades[:,0] | |
prices = trades[:,1] | |
volumes = trades[:,2] | |
ans = np.zeros(shape=(len(prices), 6)) | |
candle_counter = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# expects a numpy array with trades | |
# each trade is composed of: [time, price, quantity] | |
def generate_volumebars(trades, frequency=10): | |
times = trades[:,0] | |
prices = trades[:,1] | |
volumes = trades[:,2] | |
ans = np.zeros(shape=(len(prices), 6)) | |
candle_counter = 0 |
OlderNewer