draft nove classis strategie

This commit is contained in:
David Brazda
2023-08-24 21:12:45 +02:00
parent 2c7d279303
commit 88bd8c30c2
27 changed files with 1395 additions and 47 deletions

View File

@ -0,0 +1,27 @@
from enum import Enum
from datetime import datetime
from pydantic import BaseModel
from typing import Any, Optional, List, Union
class TradeStatus(str, Enum):
READY = "ready"
ACTIVATED = "activated"
#FINISHED = "finished"
class TradeDirection(str, Enum):
LONG = "long"
SHORT = "short"
class TradeStoplossType(str, Enum):
FIXED = "fixed"
TRAILING = "trailing"
class Trade(BaseModel):
validfrom: datetime
status: TradeStatus
direction: TradeDirection
entry_price: Optional[float] = None
# stoploss_type: TradeStoplossType
stoploss_value: Optional[float] = None
profit: Optional[float] = None

View File

@ -18,13 +18,12 @@ from alpaca.data.enums import Exchange
# if user_update.first_name is not None:
# user.first_name = user_update.first_name
# if user_update.last_name is not None:
# user.last_name = user_update.last_name
# userbase.last_name = user_update.last_name
# if user_update.roles is not None:
# user.roles = user_update.roles
# return user.id
# raise HTTPException(status_code=404, detail=f"Could not find user with id: {id}")
class Intervals(BaseModel):
start: str
end: str