tastyware / tastytrade

An unofficial, sync/async Python SDK for Tastytrade!
https://tastyworks-api.rtfd.io
MIT License
127 stars 43 forks source link

Use timestamp in the oneshot_candle to support timezone in start_time #43

Closed pingzh closed 1 year ago

pingzh commented 1 year ago

to avoid error: TypeError: can't compare offset-naive and offset-aware datetimes when start_time has timezone

e.g.

from datetime import datetime, timezone

start_time = datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc)

datetime.fromtimestamp(1684416960000/1000) <= start_time
Graeme22 commented 1 year ago

Can you post the code that didn't work so I can confirm?

pingzh commented 1 year ago

Can you post the code that didn't work so I can confirm?

@Graeme22 updated the description