-
This commit is contained in:
30
strategy/strategy.py
Normal file
30
strategy/strategy.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from internal_types.types import Position, Quote
|
||||
|
||||
|
||||
# todo:
|
||||
# handle strategy that trades multiple instruments
|
||||
# fractional position/volume for crypto
|
||||
# callback for async order
|
||||
class Strategy(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def curr_position(self) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def desired_position(self) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def order_filled(self, new_pos: Position):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def process_quote(self, quote: Quote):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def net_liquid_value(self, closing_price: float) -> float:
|
||||
pass
|
||||
Reference in New Issue
Block a user