Skip to content

Commit

Permalink
use timestamp as index
Browse files Browse the repository at this point in the history
  • Loading branch information
enarjord committed Jun 23, 2021
1 parent 74de561 commit 2aba9e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def gain_conv(x):

def plot_fills(df, fdf_, side: int = 0, bkr_thr=0.1):
plt.clf()

dfc = df.loc[fdf_.index[0]:fdf_.index[-1]]
dfc = dfc.set_index('timestamp')
fdf = fdf_.set_index('timestamp')
dfc.price.iloc[::max(1, int(len(dfc) * 0.0001))].plot(style='y-')
dfc = df.iloc[::max(1, int(len(df) * 0.0001))]
dfc = dfc[(dfc.timestamp > fdf.index[0]) & (dfc.timestamp < fdf.index[-1])].set_index('timestamp')
dfc = dfc.loc[fdf.index[0]:fdf.index[-1]]
dfc.price.plot(style='y-')

if side >= 0:
longs = fdf[fdf.type.str.contains('long')]
Expand Down

0 comments on commit 2aba9e0

Please sign in to comment.