Skip to content

Instantly share code, notes, and snippets.

@coreyauger
Created May 9, 2018 06:22
Show Gist options
  • Save coreyauger/2ceffe888b8e93ade0623b096f122c0d to your computer and use it in GitHub Desktop.
Save coreyauger/2ceffe888b8e93ade0623b096f122c0d to your computer and use it in GitHub Desktop.
daytrader data centering
def centerAroundEntry(data):
# extract the price at 20 min after entry
labels = data[:,-1]
# remove the last 20 min of history from our data..
data = data[:,0:-20]
# normalise data to the ENTRY point
for i in range(data.shape[0]):
labels[i] = (labels[i]/data[i,-1]) - 1.0
data[i,] = (data[i,]/data[i,-1]) - 1.0
return (data, labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment