Skip to content

Instantly share code, notes, and snippets.

@traderpro446
Last active August 26, 2018 03:14
Show Gist options
  • Select an option

  • Save traderpro446/8214b5135d1a1a8f7e1e0fcddb85e1ef to your computer and use it in GitHub Desktop.

Select an option

Save traderpro446/8214b5135d1a1a8f7e1e0fcddb85e1ef to your computer and use it in GitHub Desktop.
sine wave
import numpy as np
import matplotlib.pylab as plt
def sine_wave(numOfPointsPerCycle=60,numOfCycls=24,A=0.25,display=False):
x = np.linspace(0, 2*np.pi*numOfCycls, numOfCycls*numOfPointsPerCycle)
y= 1+A*np.sin(x)
if display is False:
return y
x=range(len(y))
plt.figure(figsize=(15,5))
plt.plot(x,y)
plt.xlabel('time')
plt.ylabel('price')
plt.axis('tight')
plt.show()
return y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment