Skip to content

Commit

Permalink
- Fix: replace 'TOTTRDVAL' with 'TOTTRDQTY'. Resolves issue #62
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThadikaran committed Nov 1, 2023
1 parent 8bf8508 commit d22e1ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/defs/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,19 @@ def toAmiBrokerFormat(file: Path):
'Converts and saves bhavcopy into amibroker format'

cols = ['SYMBOL', 'TIMESTAMP', 'OPEN', 'HIGH',
'LOW', 'CLOSE', 'TOTTRDVAL', 'ISIN']
'LOW', 'CLOSE', 'TOTTRDQTY', 'ISIN']

rcols = list(cols)
rcols[1] = 'DATE'
rcols[-2] = 'VOLUME'

df = read_csv(file, parse_dates=['TIMESTAMP'])

df = df[(df['SERIES'] == 'EQ') | (
df['SERIES'] == 'BE') | (df['SERIES'] == 'BZ')]
df = df[(df['SERIES'] == 'EQ') |
(df['SERIES'] == 'BE') |
(df['SERIES'] == 'BZ') |
(df['SERIES'] == 'SM') |
(df['SERIES'] == 'ST')]

df = df[cols]
df.columns = rcols
Expand Down

0 comments on commit d22e1ba

Please sign in to comment.