progress
This commit is contained in:
+4
-10
@@ -10,13 +10,13 @@ from cvttpy_tools.logger import Log
|
||||
from cvttpy_trading.trading.trading_instructions import TradingInstructions
|
||||
# ---
|
||||
from pairs_trading.lib.live.rest_client import RESTSender
|
||||
from pairs_trading.apps.pairs_trader import PairsTrader
|
||||
from pairs_trading.apps.pair_trader import PairTrader
|
||||
|
||||
|
||||
class TradingInstructionsSender(NamedObject):
|
||||
config_: Config
|
||||
sender_: RESTSender
|
||||
pairs_trader_: PairsTrader
|
||||
pairs_trader_: PairTrader
|
||||
|
||||
class TradingInstType(str, Enum):
|
||||
TARGET_POSITION = "TARGET_POSITION"
|
||||
@@ -24,13 +24,7 @@ class TradingInstructionsSender(NamedObject):
|
||||
MARKET_MAKING = "MARKET_MAKING"
|
||||
NONE = "NONE"
|
||||
|
||||
# config_: Config
|
||||
# ti_method_: str
|
||||
# ti_url_: str
|
||||
# health_check_method_: str
|
||||
# health_check_url_: str
|
||||
|
||||
def __init__(self, config: Config, pairs_trader: PairsTrader) -> None:
|
||||
def __init__(self, config: Config, pairs_trader: PairTrader) -> None:
|
||||
self.config_ = config
|
||||
base_url = self.config_.get_value("cvtt_base_url", default="")
|
||||
assert base_url
|
||||
@@ -45,7 +39,7 @@ class TradingInstructionsSender(NamedObject):
|
||||
|
||||
|
||||
async def send_trading_instructions(self, ti: TradingInstructions) -> None:
|
||||
|
||||
Log.info(f"{self.fname()}: sending {ti=}")
|
||||
response: requests.Response = self.sender_.send_post(
|
||||
endpoint="trading_instructions", post_body=ti.to_dict()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user