diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index c280f453c..b0ffeee7e 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -1,4 +1,5 @@ from datetime import date, datetime +from pandas import isnull from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel @@ -355,7 +356,9 @@ class PairHistory(BaseModel): class Config: json_encoders = { - datetime: lambda v: v.strftime(DATETIME_PRINT_FORMAT), + datetime: lambda v: v.strftime(DATETIME_PRINT_FORMAT) + # needed for aslong NaT doesn't work with strftime + if not isnull(v) else "", }