Skip to content

Instantly share code, notes, and snippets.

@evanaze
Created August 23, 2020 22:42
Show Gist options
  • Save evanaze/70a68b58dea0c954b9c8c28f991d48cd to your computer and use it in GitHub Desktop.
Save evanaze/70a68b58dea0c954b9c8c28f991d48cd to your computer and use it in GitHub Desktop.
Collecting all instances of large pending transactions, and group transactions close together as a single instance
i = 0 # initializing i
win_size = 7 # the window size after a large txn
windows = [] # an array for saving our windows
# iterate through the ohlcv data
while i <= len(ohlcv):
# if the transaction is a large transaction
if ohlcv.iloc[i, -1] == True:
# save the txn and the minutes after
windows.append(ohlcv.iloc[i:i+win_size])
# increment the window to move past the current frame
i += win_size - 1
# increment the window normally
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment