algogtt 1.0.2__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.
algogtt-1.0.2/PKG-INFO ADDED
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: algogtt
3
+ Version: 1.0.2
4
+ Summary: Python SDK for AlgoGTT Strategy Export API
5
+ Home-page: https://github.com/vrsolankiGH/SwingTradingSystem
6
+ Author: Vipul Solanki
7
+ Author-email: vrsolanki@gmail.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Office/Business :: Financial :: Investment
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests>=2.25.0
15
+ Requires-Dist: pandas>=1.0.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: license
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # AlgoGTT Python SDK
28
+
29
+ Official Python client for the [AlgoGTT](https://algogtt.in) Strategy Export API. This SDK allows quants and developers to fetch strategy signals and compute custom signals using the AlgoGTT backend.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install algogtt
35
+ ```
36
+
37
+ ## Quick Start
38
+
39
+ ### 1. Initialize Client
40
+ Get your **STS API Key** from the Profile page on the AlgoGTT dashboard.
41
+
42
+ ```python
43
+ from algogtt import Client
44
+
45
+ client = Client(api_key="STS_your_api_key_here")
46
+ ```
47
+
48
+ ### 2. Fetch Historical Signals
49
+ Fetch signals generated on AlgoGTT's internal data.
50
+
51
+ ```python
52
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
53
+ print(df.tail())
54
+ ```
55
+
56
+ ### 3. Compute Signals on Custom Data
57
+ Inject your own OHLCV data to see how AlgoGTT strategies perform on it.
58
+
59
+ ```python
60
+ custom_data = [
61
+ {"datetime": "2024-01-01 09:15:00", "open": 21000, "high": 21050, "low": 20950, "close": 21020, "volume": 1000},
62
+ # ... more rows
63
+ ]
64
+
65
+ df = client.compute_signals(
66
+ symbol="NIFTY",
67
+ strategy="swing_breakout",
68
+ data=custom_data
69
+ )
70
+ ```
71
+
72
+ ## Integration with VectorBT
73
+
74
+ ```python
75
+ import vectorbt as vbt
76
+ from algogtt import Client
77
+
78
+ client = Client(api_key="...")
79
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
80
+
81
+ portfolio = vbt.Portfolio.from_signals(
82
+ df['Close'],
83
+ entries=df['buy_signal'],
84
+ exits=df['sell_signal'],
85
+ freq='1m'
86
+ )
87
+ print(portfolio.stats())
88
+ ```
89
+
90
+ ## Support
91
+ For API keys and support, visit [algogtt.in](https://algogtt.in).
@@ -0,0 +1,65 @@
1
+ # AlgoGTT Python SDK
2
+
3
+ Official Python client for the [AlgoGTT](https://algogtt.in) Strategy Export API. This SDK allows quants and developers to fetch strategy signals and compute custom signals using the AlgoGTT backend.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install algogtt
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### 1. Initialize Client
14
+ Get your **STS API Key** from the Profile page on the AlgoGTT dashboard.
15
+
16
+ ```python
17
+ from algogtt import Client
18
+
19
+ client = Client(api_key="STS_your_api_key_here")
20
+ ```
21
+
22
+ ### 2. Fetch Historical Signals
23
+ Fetch signals generated on AlgoGTT's internal data.
24
+
25
+ ```python
26
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
27
+ print(df.tail())
28
+ ```
29
+
30
+ ### 3. Compute Signals on Custom Data
31
+ Inject your own OHLCV data to see how AlgoGTT strategies perform on it.
32
+
33
+ ```python
34
+ custom_data = [
35
+ {"datetime": "2024-01-01 09:15:00", "open": 21000, "high": 21050, "low": 20950, "close": 21020, "volume": 1000},
36
+ # ... more rows
37
+ ]
38
+
39
+ df = client.compute_signals(
40
+ symbol="NIFTY",
41
+ strategy="swing_breakout",
42
+ data=custom_data
43
+ )
44
+ ```
45
+
46
+ ## Integration with VectorBT
47
+
48
+ ```python
49
+ import vectorbt as vbt
50
+ from algogtt import Client
51
+
52
+ client = Client(api_key="...")
53
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
54
+
55
+ portfolio = vbt.Portfolio.from_signals(
56
+ df['Close'],
57
+ entries=df['buy_signal'],
58
+ exits=df['sell_signal'],
59
+ freq='1m'
60
+ )
61
+ print(portfolio.stats())
62
+ ```
63
+
64
+ ## Support
65
+ For API keys and support, visit [algogtt.in](https://algogtt.in).
@@ -0,0 +1,85 @@
1
+ """
2
+ AlgoGTT Python SDK
3
+ ==================
4
+ A lightweight client for interacting with the AlgoGTT Strategy Export API.
5
+ """
6
+
7
+ import requests
8
+ import pandas as pd
9
+ import io
10
+ from .version import __version__
11
+
12
+ class Client:
13
+ """
14
+ Main client for AlgoGTT API.
15
+
16
+ Args:
17
+ api_key (str): Your STS API Key from the Profile page.
18
+ base_url (str): The base URL of the AlgoGTT API.
19
+ """
20
+ def __init__(self, api_key, base_url="https://api.algogtt.in/api/v1"):
21
+ self.api_key = api_key
22
+ self.base_url = base_url.rstrip('/')
23
+ self.headers = {
24
+ "X-API-KEY": api_key,
25
+ "User-Agent": f"AlgoGTT-Python-SDK/{__version__}"
26
+ }
27
+
28
+ def get_signals(self, symbol: str, strategy: str, format: str = "csv"):
29
+ """
30
+ Fetch strategy signals for a specific symbol.
31
+
32
+ Args:
33
+ symbol (str): Symbol name (e.g., NIFTY, BANKNIFTY).
34
+ strategy (str): Strategy name (e.g., swing_breakout).
35
+ format (str): 'csv' or 'json'.
36
+
37
+ Returns:
38
+ pd.DataFrame or dict: Signals data.
39
+ """
40
+ url = f"{self.base_url}/export/signals"
41
+ params = {"symbol": symbol, "strategy": strategy, "format": format}
42
+
43
+ response = requests.get(url, headers=self.headers, params=params)
44
+ response.raise_for_status()
45
+
46
+ if format == "csv":
47
+ return pd.read_csv(io.StringIO(response.text), index_col='datetime', parse_dates=True)
48
+ return response.json()
49
+
50
+ def compute_signals(self, symbol: str, strategy: str, data: list, parameters: dict = None, format: str = "csv"):
51
+ """
52
+ Send custom OHLCV data to compute signals dynamically.
53
+
54
+ Args:
55
+ symbol (str): Symbol name.
56
+ strategy (str): Strategy name.
57
+ data (list): List of dicts with OHLCV data.
58
+ parameters (dict): Optional strategy parameters to tweak.
59
+ format (str): 'csv' or 'json'.
60
+
61
+ Returns:
62
+ pd.DataFrame or dict: Signals data.
63
+ """
64
+ url = f"{self.base_url}/export/signals/compute"
65
+ payload = {
66
+ "symbol": symbol,
67
+ "strategy": strategy,
68
+ "data": data,
69
+ "parameters": parameters or {},
70
+ "format": format
71
+ }
72
+
73
+ response = requests.post(url, headers=self.headers, json=payload)
74
+ response.raise_for_status()
75
+
76
+ if format == "csv":
77
+ return pd.read_csv(io.StringIO(response.text), index_col='datetime', parse_dates=True)
78
+ return response.json()
79
+
80
+ def get_account_status(self):
81
+ """Check API key validity and license status."""
82
+ url = f"{self.base_url}/account/status"
83
+ response = requests.get(url, headers=self.headers)
84
+ response.raise_for_status()
85
+ return response.json()
@@ -0,0 +1 @@
1
+ __version__ = "1.0.2"
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: algogtt
3
+ Version: 1.0.2
4
+ Summary: Python SDK for AlgoGTT Strategy Export API
5
+ Home-page: https://github.com/vrsolankiGH/SwingTradingSystem
6
+ Author: Vipul Solanki
7
+ Author-email: vrsolanki@gmail.com
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Office/Business :: Financial :: Investment
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: requests>=2.25.0
15
+ Requires-Dist: pandas>=1.0.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: license
23
+ Dynamic: requires-dist
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # AlgoGTT Python SDK
28
+
29
+ Official Python client for the [AlgoGTT](https://algogtt.in) Strategy Export API. This SDK allows quants and developers to fetch strategy signals and compute custom signals using the AlgoGTT backend.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ pip install algogtt
35
+ ```
36
+
37
+ ## Quick Start
38
+
39
+ ### 1. Initialize Client
40
+ Get your **STS API Key** from the Profile page on the AlgoGTT dashboard.
41
+
42
+ ```python
43
+ from algogtt import Client
44
+
45
+ client = Client(api_key="STS_your_api_key_here")
46
+ ```
47
+
48
+ ### 2. Fetch Historical Signals
49
+ Fetch signals generated on AlgoGTT's internal data.
50
+
51
+ ```python
52
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
53
+ print(df.tail())
54
+ ```
55
+
56
+ ### 3. Compute Signals on Custom Data
57
+ Inject your own OHLCV data to see how AlgoGTT strategies perform on it.
58
+
59
+ ```python
60
+ custom_data = [
61
+ {"datetime": "2024-01-01 09:15:00", "open": 21000, "high": 21050, "low": 20950, "close": 21020, "volume": 1000},
62
+ # ... more rows
63
+ ]
64
+
65
+ df = client.compute_signals(
66
+ symbol="NIFTY",
67
+ strategy="swing_breakout",
68
+ data=custom_data
69
+ )
70
+ ```
71
+
72
+ ## Integration with VectorBT
73
+
74
+ ```python
75
+ import vectorbt as vbt
76
+ from algogtt import Client
77
+
78
+ client = Client(api_key="...")
79
+ df = client.get_signals(symbol="NIFTY", strategy="swing_breakout")
80
+
81
+ portfolio = vbt.Portfolio.from_signals(
82
+ df['Close'],
83
+ entries=df['buy_signal'],
84
+ exits=df['sell_signal'],
85
+ freq='1m'
86
+ )
87
+ print(portfolio.stats())
88
+ ```
89
+
90
+ ## Support
91
+ For API keys and support, visit [algogtt.in](https://algogtt.in).
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ algogtt/__init__.py
4
+ algogtt/version.py
5
+ algogtt.egg-info/PKG-INFO
6
+ algogtt.egg-info/SOURCES.txt
7
+ algogtt.egg-info/dependency_links.txt
8
+ algogtt.egg-info/requires.txt
9
+ algogtt.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ requests>=2.25.0
2
+ pandas>=1.0.0
@@ -0,0 +1 @@
1
+ algogtt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
algogtt-1.0.2/setup.py ADDED
@@ -0,0 +1,30 @@
1
+ from setuptools import setup, find_packages
2
+ import os
3
+
4
+ # Read version from version.py
5
+ version = {}
6
+ with open(os.path.join("algogtt", "version.py")) as f:
7
+ exec(f.read(), version)
8
+
9
+ setup(
10
+ name="algogtt",
11
+ version=version["__version__"],
12
+ author="Vipul Solanki",
13
+ author_email="vrsolanki@gmail.com",
14
+ description="Python SDK for AlgoGTT Strategy Export API",
15
+ long_description=open("README.md").read(),
16
+ long_description_content_type="text/markdown",
17
+ url="https://github.com/vrsolankiGH/SwingTradingSystem",
18
+ packages=find_packages(),
19
+ install_requires=[
20
+ "requests>=2.25.0",
21
+ "pandas>=1.0.0",
22
+ ],
23
+ license="MIT",
24
+ classifiers=[
25
+ "Programming Language :: Python :: 3",
26
+ "Operating System :: OS Independent",
27
+ "Topic :: Office/Business :: Financial :: Investment",
28
+ ],
29
+ python_requires=">=3.7",
30
+ )