-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathPKG-INFO
More file actions
153 lines (117 loc) · 5.29 KB
/
PKG-INFO
File metadata and controls
153 lines (117 loc) · 5.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Metadata-Version: 2.4
Name: openalgo
Version: 1.0.49
Summary: A Python library for interacting with OpenAlgo's trading APIs with high-performance technical indicators
Home-page: https://openalgo.in
Author: Rajandran R
Author-email: rajandran@openalgo.in
Project-URL: Documentation, https://docs.openalgo.in
Project-URL: Source, https://github.com/marketcalls/openalgo-python-library
Project-URL: Tracker, https://github.com/marketcalls/openalgo-python-library/issues
Keywords: trading,algorithmic-trading,finance,websocket,market-data,real-time,stock-market,api-wrapper,openalgo,market-data,trading-api,stock-trading,technical-analysis,indicators,rsi,macd,sma,ema,bollinger-bands,supertrend,atr,volume-analysis
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: pandas>=2.2.0
Requires-Dist: websocket-client>=1.8.0
Requires-Dist: numpy>=2.0.0
Provides-Extra: indicators
Requires-Dist: numba>=0.63.0; extra == "indicators"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary
# OpenAlgo Python Library
A Python library for algorithmic trading using OpenAlgo's REST APIs and WebSocket feeds, with **100+ high-performance JIT-accelerated technical indicators**.
- Python Library Docs: https://docs.openalgo.in/trading-platform/python
- Technical Indicators (100+): https://docs.openalgo.in/trading-platform/python/indicators
- WebSocket & Verbose Control: https://docs.openalgo.in/trading-platform/python/websockets-verbose-control
- API Reference: https://docs.openalgo.in/api-documentation/v1
- General Documentation: https://docs.openalgo.in
- Source: https://github.com/marketcalls/openalgo-python-library
## Installation
To install the OpenAlgo Python library, use pip:
```bash
# Trading API only
pip install openalgo
# JIT-accelerated indicators
pip install openalgo[indicators]
```
Requires **Python 3.12, 3.13, or 3.14**.
## Get the OpenAlgo apikey
Make sure that your OpenAlgo Application is running. Login to OpenAlgo Application with valid credentials and get the OpenAlgo apikey.
For detailed function parameters refer to the [API Documentation](https://docs.openalgo.in/api-documentation/v1).
## Getting Started with OpenAlgo
First, import the `api` class from the OpenAlgo library and initialize it with your API key:
```python
from openalgo import api
# Replace 'your_api_key_here' with your actual API key
# Specify the host URL with your hosted domain or ngrok domain.
# If running locally in windows then use the default host value.
client = api(api_key='your_api_key_here', host='http://127.0.0.1:5000')
```
## Check OpenAlgo Version
```python
import openalgo
openalgo.__version__
```
## Technical Indicators (100+)
OpenAlgo ships **100+ JIT-accelerated technical indicators** powered by Numba — including trend, momentum, volatility, volume, oscillators, statistics, and hybrid indicators. Install the optional extra to enable them:
```bash
pip install openalgo[indicators]
```
Quick example:
```python
import numpy as np
from openalgo import ta
close = np.array([100, 101, 102, 103, 104, 105, 106, 107, 108, 109], dtype=float)
high = close + 0.5
low = close - 0.5
# Trend
sma = ta.sma(close, period=5)
ema = ta.ema(close, period=5)
supertrend, direction = ta.supertrend(high, low, close, period=7, multiplier=3.0)
# Momentum
rsi = ta.rsi(close, period=14)
macd_line, signal_line, hist = ta.macd(close, fast=12, slow=26, signal=9)
# Volatility
atr = ta.atr(high, low, close, period=14)
upper, middle, lower = ta.bbands(close, period=20, std=2.0)
```
Full indicator catalog and parameter reference: https://docs.openalgo.in/trading-platform/python/indicators
## WebSocket Verbose Control
The streaming feed supports verbosity levels (`0` silent, `1` connection/auth/subscription info, `2` full debug with every tick):
```python
client = api(
api_key="your_api_key",
host="http://127.0.0.1:5000",
ws_url="ws://127.0.0.1:8765",
verbose=1, # 0 / 1 / True / 2
)
```
Details: https://docs.openalgo.in/trading-platform/python/websockets-verbose-control
## Examples
Please refer to the documentation on [order constants](https://docs.openalgo.in/api-documentation/v1/order-constants), and consult the API reference for details on optional parameters.
For runnable scripts covering orders, market data, options, telegram, and WebSocket feeds, see the `examples/` directory in the source repository: https://github.com/marketcalls/openalgo-python-library/tree/master/examples
## License
MIT — see the [LICENSE](LICENSE) file for details.