Skip to content

Commit

Permalink
Removing all TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
idiom-bytes committed Dec 14, 2023
1 parent addf921 commit 6874ead
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
3 changes: 0 additions & 3 deletions pdr_backend/data_eng/plutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def save_rawohlcv_file(filename: str, df: pl.DataFrame):
df = df.select(columns)

if os.path.exists(filename): # append existing file
# TO DO: Implement parquet-append with pyarrow
cur_df = pl.read_parquet(filename)
df = pl.concat([cur_df, df])
df.write_parquet(filename)
Expand Down Expand Up @@ -109,7 +108,6 @@ def load_rawohlcv_file(filename: str, cols=None, st=None, fin=None) -> pl.DataFr
Polars does not have an index. "timestamp" is a regular col and required for "datetime"
(1) Don't specify "datetime" as a column, as that'll get calc'd from timestamp
TO DO: Fix (1), save_rawohlcv_file already saves out dataframe.
Either don't save datetime, or save it and load it so it doesn't have to be re-computed.
"""
# handle cols
Expand Down Expand Up @@ -138,7 +136,6 @@ def load_rawohlcv_file(filename: str, cols=None, st=None, fin=None) -> pl.DataFr
df = transform_df(df)

# postconditions, return
# TO DO: Helper to go from np<->pl schema/dtypes
assert "timestamp" in df.columns and df["timestamp"].dtype == pl.Int64
assert "datetime" in df.columns and df["datetime"].dtype == pl.Datetime

Expand Down
1 change: 0 additions & 1 deletion pdr_backend/trader/approach1/trader_agent1.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async def do_trade(self, feed: Feed, prediction: Tuple[float, float]):
print(f" [Previous Order] {self.order}")
print(f" [Closing Order] {order}")

# TO DO - Calculate PNL (self.order - order)
self.order = None

### Create new order if prediction meets our criteria
Expand Down
4 changes: 0 additions & 4 deletions pdr_backend/trader/approach2/portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ class Position:
"""
@description
Has an open and and a close order minimum
TO DO - Support many buy/sell orders, balance, etc...
"""

def __init__(self, order: Order):
# TO DO - Have N open_orders, have N close_orders
# TO DO - Move from __init__(order) to open(order)
self.open_order: Order = order
self.close_order: Optional[Order] = None
self.state: OrderState = OrderState.OPEN
Expand All @@ -79,7 +76,6 @@ def __init__(self, order: Order):
def __str__(self):
return f"<{self.open_order}, {self.close_order}, {self.__class__}>"

# TO DO - Only callable by portfolio
def close(self, order: Order):
self.close_order = order
self.state = OrderState.CLOSED
Expand Down

0 comments on commit 6874ead

Please sign in to comment.