Skip to content

Instantly share code, notes, and snippets.

@selva86
Created June 18, 2021 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selva86/44a0a6554cb355f26afbaed5c1fff758 to your computer and use it in GitHub Desktop.
Save selva86/44a0a6554cb355f26afbaed5c1fff758 to your computer and use it in GitHub Desktop.
# Calc Profit
def calc_profit(open, high, low, close):
buy = open * 0.999
# daily range
if low < buy < high:
return (close - buy)/buy
else:
return 0
# Read Data
arr = np.genfromtxt("Datasets/apple_stock_price.csv", delimiter=",", skip_header=1)
arr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment