dev progress
This commit is contained in:
parent
002f797751
commit
6dd0f97d74
@ -133,7 +133,7 @@ class PairsTrader(NamedObject):
|
|||||||
await self.live_strategy_.on_mkt_data_hist_snapshot(hist_aggr=history)
|
await self.live_strategy_.on_mkt_data_hist_snapshot(hist_aggr=history)
|
||||||
|
|
||||||
async def _on_api_request(self, request: web.Request) -> web.Response:
|
async def _on_api_request(self, request: web.Request) -> web.Response:
|
||||||
return web.Response() # TODO add API request handler implementation
|
return web.Response() # TODO API request handler implementation
|
||||||
|
|
||||||
async def run(self) -> None:
|
async def run(self) -> None:
|
||||||
Log.info(f"{self.fname()} ...")
|
Log.info(f"{self.fname()} ...")
|
||||||
|
|||||||
@ -118,7 +118,6 @@ class PtLiveStrategy(NamedObject):
|
|||||||
async def on_mkt_data_hist_snapshot(
|
async def on_mkt_data_hist_snapshot(
|
||||||
self, hist_aggr: List[MdTradesAggregate]
|
self, hist_aggr: List[MdTradesAggregate]
|
||||||
) -> None:
|
) -> None:
|
||||||
# Log.info(f"on_mkt_data_hist_snapshot: {aggr}")
|
|
||||||
if not self._is_md_actual(hist_aggr=hist_aggr):
|
if not self._is_md_actual(hist_aggr=hist_aggr):
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -160,7 +159,7 @@ class PtLiveStrategy(NamedObject):
|
|||||||
self, trading_instructions: TradingInstructions
|
self, trading_instructions: TradingInstructions
|
||||||
) -> None:
|
) -> None:
|
||||||
await self.pairs_trader_.ti_sender_.send_trading_instructions(trading_instructions)
|
await self.pairs_trader_.ti_sender_.send_trading_instructions(trading_instructions)
|
||||||
pass # URGENT implement _send_trading_instructions
|
pass # URGENT _send_trading_instructions
|
||||||
|
|
||||||
def _create_trading_instructions(
|
def _create_trading_instructions(
|
||||||
self, prediction: Prediction, last_row: pd.Series
|
self, prediction: Prediction, last_row: pd.Series
|
||||||
@ -193,6 +192,7 @@ class PtLiveStrategy(NamedObject):
|
|||||||
) -> Optional[TradingInstructions]:
|
) -> Optional[TradingInstructions]:
|
||||||
ti: Optional[TradingInstructions] = None
|
ti: Optional[TradingInstructions] = None
|
||||||
scaled_disequilibrium = prediction.scaled_disequilibrium_
|
scaled_disequilibrium = prediction.scaled_disequilibrium_
|
||||||
|
# URGENT _create_open_trade_instructions
|
||||||
|
|
||||||
# if scaled_disequilibrium > 0:
|
# if scaled_disequilibrium > 0:
|
||||||
# side_a = "SELL"
|
# side_a = "SELL"
|
||||||
@ -258,7 +258,7 @@ class PtLiveStrategy(NamedObject):
|
|||||||
self, pair: TradingPair, row: pd.Series # , prediction: Prediction
|
self, pair: TradingPair, row: pd.Series # , prediction: Prediction
|
||||||
) -> Optional[TradingInstructions]:
|
) -> Optional[TradingInstructions]:
|
||||||
ti: Optional[TradingInstructions] = None
|
ti: Optional[TradingInstructions] = None
|
||||||
# URGENT implement _create_close_trade_instructions
|
# URGENT _create_close_trade_instructions
|
||||||
return ti
|
return ti
|
||||||
|
|
||||||
def _handle_outstanding_positions(self) -> Optional[pd.DataFrame]:
|
def _handle_outstanding_positions(self) -> Optional[pd.DataFrame]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user