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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p123api
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Portfolio123 API wrapper
5
5
  Home-page: https://github.com/portfolio-123/p123api-py
6
6
  Author: Portfolio123
@@ -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
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p123api
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Portfolio123 API wrapper
5
5
  Home-page: https://github.com/portfolio-123/p123api-py
6
6
  Author: Portfolio123
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="p123api",
8
- version="2.1.0",
8
+ version="2.2.0",
9
9
  author="Portfolio123",
10
10
  author_email="info@portfolio123.com",
11
11
  description="Portfolio123 API wrapper",
File without changes
File without changes
File without changes
File without changes