draft nove classis strategie
This commit is contained in:
27
v2realbot/common/PrescribedTradeModel.py
Normal file
27
v2realbot/common/PrescribedTradeModel.py
Normal 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
|
||||
|
||||
Binary file not shown.
@ -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
|
||||
|
||||
Reference in New Issue
Block a user