p123api 2.1.0__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {p123api-2.1.0 → p123api-2.2.0}/PKG-INFO +1 -1
- {p123api-2.1.0 → p123api-2.2.0}/p123api/client.py +75 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api.egg-info/PKG-INFO +1 -1
- {p123api-2.1.0 → p123api-2.2.0}/setup.py +1 -1
- {p123api-2.1.0 → p123api-2.2.0}/LICENSE +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/README.md +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api/__init__.py +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api.egg-info/SOURCES.txt +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api.egg-info/dependency_links.txt +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api.egg-info/requires.txt +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/p123api.egg-info/top_level.txt +0 -0
- {p123api-2.1.0 → p123api-2.2.0}/setup.cfg +0 -0
|
@@ -21,6 +21,10 @@ DATA_UNIVERSE_PATH = "/data/universe"
|
|
|
21
21
|
DATA_PRICES_PATH = Template("/data/prices/$identifier")
|
|
22
22
|
STRATEGY_DETAILS_PATH = Template("/strategy/$id")
|
|
23
23
|
STRATEGY_HOLDINGS_PATH = Template("/strategy/$id/holdings")
|
|
24
|
+
STRATEGY_TRADING_SYSTEM_PATH = Template("/strategy/$id/trading-system")
|
|
25
|
+
BOOK_TRADING_SYSTEM_PATH = Template("/strategy/$id/book-trading-system")
|
|
26
|
+
SIM_RERUN_PATH = Template("/strategy/$id/rerun")
|
|
27
|
+
BOOK_SIM_RERUN_PATH = Template("/strategy/$id/book-rerun")
|
|
24
28
|
STRATEGY_REBALANCE_PATH = Template("/strategy/$id/rebalance")
|
|
25
29
|
STRATEGY_REBALANCE_COMMIT_PATH = Template("/strategy/$id/rebalance/commit")
|
|
26
30
|
STRATEGY_TRANS_PATH = Template("/strategy/$id/transactions")
|
|
@@ -625,6 +629,77 @@ class Client:
|
|
|
625
629
|
).json()
|
|
626
630
|
|
|
627
631
|
return pandas.DataFrame(ret["holdings"]) if to_pandas else ret
|
|
632
|
+
|
|
633
|
+
def strategy_trading_system(
|
|
634
|
+
self, strategy_id: int
|
|
635
|
+
):
|
|
636
|
+
"""
|
|
637
|
+
Strategy trading system
|
|
638
|
+
:param strategy_id:
|
|
639
|
+
:return:
|
|
640
|
+
"""
|
|
641
|
+
|
|
642
|
+
return self._req_with_auth_fallback(
|
|
643
|
+
name="strategy trading system",
|
|
644
|
+
method="GET",
|
|
645
|
+
url=self._endpoint + STRATEGY_TRADING_SYSTEM_PATH.substitute(id=strategy_id)
|
|
646
|
+
).json()
|
|
647
|
+
|
|
648
|
+
def strategy_trading_system_update(self, strategy_id: int, params: dict):
|
|
649
|
+
"""
|
|
650
|
+
Live strategy trading system update
|
|
651
|
+
:param strategy_id:
|
|
652
|
+
:param params:
|
|
653
|
+
:return:
|
|
654
|
+
"""
|
|
655
|
+
|
|
656
|
+
return self._req_with_auth_fallback(
|
|
657
|
+
name="live strategy trading system update",
|
|
658
|
+
url=self._endpoint + STRATEGY_TRADING_SYSTEM_PATH.substitute(id=strategy_id),
|
|
659
|
+
json=params,
|
|
660
|
+
).json()
|
|
661
|
+
|
|
662
|
+
def book_trading_system_update(self, strategy_id: int, params: dict):
|
|
663
|
+
"""
|
|
664
|
+
Live book trading system update
|
|
665
|
+
:param strategy_id:
|
|
666
|
+
:param params:
|
|
667
|
+
:return:
|
|
668
|
+
"""
|
|
669
|
+
|
|
670
|
+
return self._req_with_auth_fallback(
|
|
671
|
+
name="live book trading system update",
|
|
672
|
+
url=self._endpoint + BOOK_TRADING_SYSTEM_PATH.substitute(id=strategy_id),
|
|
673
|
+
json=params,
|
|
674
|
+
).json()
|
|
675
|
+
|
|
676
|
+
def strategy_rerun(self, strategy_id: int, params: dict):
|
|
677
|
+
"""
|
|
678
|
+
Simulated strategy rerun
|
|
679
|
+
:param strategy_id:
|
|
680
|
+
:param params:
|
|
681
|
+
:return:
|
|
682
|
+
"""
|
|
683
|
+
|
|
684
|
+
return self._req_with_auth_fallback(
|
|
685
|
+
name="simulated strategy rerun",
|
|
686
|
+
url=self._endpoint + SIM_RERUN_PATH.substitute(id=strategy_id),
|
|
687
|
+
json=params,
|
|
688
|
+
).json()
|
|
689
|
+
|
|
690
|
+
def book_rerun(self, strategy_id: int, params: dict):
|
|
691
|
+
"""
|
|
692
|
+
Simulated book rerun
|
|
693
|
+
:param strategy_id:
|
|
694
|
+
:param params:
|
|
695
|
+
:return:
|
|
696
|
+
"""
|
|
697
|
+
|
|
698
|
+
return self._req_with_auth_fallback(
|
|
699
|
+
name="simulated book rerun",
|
|
700
|
+
url=self._endpoint + BOOK_SIM_RERUN_PATH.substitute(id=strategy_id),
|
|
701
|
+
json=params,
|
|
702
|
+
).json()
|
|
628
703
|
|
|
629
704
|
def strategy_rebalance(self, strategy_id: int, params: dict):
|
|
630
705
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|