Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_tinkoff-trading-bot-develop/app/strategies/interval/models.py
5938 views
1
from pydantic import BaseModel, Field
2
3
4
class IntervalStrategyConfig(BaseModel):
5
"""
6
Interval Strategy Configuration
7
8
interval_size: The percent of the prices to include into interval
9
days_back_to_consider: The number of days back to consider in interval calculation
10
check_interval: The interval in seconds to check for a new prices and for interval recalculation
11
stop_loss_percent: The percent from the price to trigger a stop loss
12
quantity_limit: The maximum quantity of the instrument to have in the portfolio
13
"""
14
15
interval_size: float = Field(0.8, ge=0.0, le=1.0)
16
days_back_to_consider: int = Field(30, g=0)
17
check_interval: int = Field(60, g=0)
18
stop_loss_percentage: float = Field(0.1, ge=0.0, le=1.0)
19
quantity_limit: int = Field(0, ge=0)
20
21
22
class Corridor(BaseModel):
23
top: float
24
bottom: float
25
26