Spaces:
Sleeping
Sleeping
anaucoin commited on
Commit ·
56a3af7
1
Parent(s): 1710398
update for internal data struct changes
Browse files
app.py
CHANGED
|
@@ -185,9 +185,12 @@ def drop_frac_cents(d):
|
|
| 185 |
D = np.floor(100*d)/100
|
| 186 |
return D
|
| 187 |
def load_data(filename, account, exchange, otimeheader, fmat):
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
| 191 |
df = pd.concat([old_df, df], ignore_index=True)
|
| 192 |
|
| 193 |
filtdf = df[(df.exchange == exchange) & (df.subaccount == account)].dropna()
|
|
|
|
| 185 |
D = np.floor(100*d)/100
|
| 186 |
return D
|
| 187 |
def load_data(filename, account, exchange, otimeheader, fmat):
|
| 188 |
+
cols1 = ['id','datetime', 'exchange', 'subaccount', 'pair', 'side', 'action', 'amount', 'price', 'errors']
|
| 189 |
+
cols2 = ['id','datetime', 'exchange', 'subaccount', 'pair', 'side', 'action', 'amount', 'price', 'errors', 'P/L', 'P/L %','exit price', 'Lev']
|
| 190 |
+
old_df = pd.read_csv("history-old.csv", header = 0, names= cols1)
|
| 191 |
+
df = pd.read_csv(filename, header = 0, names= cols2)
|
| 192 |
+
df.loc[df['exit price'] > 0, 'price'] = df.loc[df['exit price'] > 0, 'exit price']
|
| 193 |
+
|
| 194 |
df = pd.concat([old_df, df], ignore_index=True)
|
| 195 |
|
| 196 |
filtdf = df[(df.exchange == exchange) & (df.subaccount == account)].dropna()
|