daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 16th, 2018 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     i1 = elist.index(e1)
  2.             i2 = elist.index(e2)
  3.             a1 = np.array([y[i1*2] for y in plain_data])
  4.             a2 = np.array([y[i2*2] for y in plain_data])
  5.             b1 = np.array([y[i1*2+1] for y in plain_data])
  6.             b2 = np.array([y[i2*2+1] for y in plain_data])
  7.  
  8.             # Fill possible taker trades
  9.             fac = 1.002**2
  10.             plt.fill_between(x_data, a1*fac, b2, where=(a1*fac)<=b2, facecolor=cmap[i1], hatch='*'*2, edgecolor=cmap[i1], step='mid', alpha=.2)
  11.             plt.fill_between(x_data, a2*fac, b1, where=(a2*fac)<=b1, facecolor=cmap[i2], hatch='*'*2, edgecolor=cmap[i2], step='mid', alpha=.2)
  12.  
  13.             fac = 0.998*0.999
  14.             # Fill possible maker trades on asks
  15.             plt.fill_between(x_data, a1, a2*fac, where=a1<=(a2*fac), facecolor=cmap[i1], hatch='\\'*4, edgecolor=cmap[i1], step='mid', alpha=.1)
  16.             plt.fill_between(x_data, a1*fac, a2, where=a2<=(a1*fac), facecolor=cmap[i2], hatch='\\'*4, edgecolor=cmap[i2], step='mid', alpha=.1)
  17.  
  18.             # # Fill possible maker trades on bids
  19.             plt.fill_between(x_data, b1/fac, b2, where=b1<=(b2*fac), facecolor=cmap[i2], hatch='/'*4, edgecolor=cmap[i2], step='mid', alpha=.1)
  20.             plt.fill_between(x_data, b1, b2/fac, where=b2<=(b1*fac), facecolor=cmap[i1], hatch='/'*4, edgecolor=cmap[i1], step='mid', alpha=.1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top