hyperquant 0.31__tar.gz → 0.32__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.
Files changed (29) hide show
  1. {hyperquant-0.31 → hyperquant-0.32}/PKG-INFO +1 -1
  2. {hyperquant-0.31 → hyperquant-0.32}/pyproject.toml +1 -1
  3. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/ourbit.py +45 -1
  4. {hyperquant-0.31 → hyperquant-0.32}/uv.lock +1 -1
  5. {hyperquant-0.31 → hyperquant-0.32}/.gitignore +0 -0
  6. {hyperquant-0.31 → hyperquant-0.32}/.python-version +0 -0
  7. {hyperquant-0.31 → hyperquant-0.32}/README.md +0 -0
  8. {hyperquant-0.31 → hyperquant-0.32}/data/logs/notikit.log +0 -0
  9. {hyperquant-0.31 → hyperquant-0.32}/pub.sh +0 -0
  10. {hyperquant-0.31 → hyperquant-0.32}/requirements-dev.lock +0 -0
  11. {hyperquant-0.31 → hyperquant-0.32}/requirements.lock +0 -0
  12. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/__init__.py +0 -0
  13. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/auth.py +0 -0
  14. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/hyperliquid.py +0 -0
  15. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/lib/hpstore.py +0 -0
  16. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/lib/hyper_types.py +0 -0
  17. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/models/hyperliquid.py +0 -0
  18. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/models/ourbit.py +0 -0
  19. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/broker/ws.py +0 -0
  20. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/core.py +0 -0
  21. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/datavison/_util.py +0 -0
  22. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/datavison/binance.py +0 -0
  23. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/datavison/coinglass.py +0 -0
  24. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/datavison/okx.py +0 -0
  25. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/db.py +0 -0
  26. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/draw.py +0 -0
  27. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/logkit.py +0 -0
  28. {hyperquant-0.31 → hyperquant-0.32}/src/hyperquant/notikit.py +0 -0
  29. {hyperquant-0.31 → hyperquant-0.32}/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperquant
3
- Version: 0.31
3
+ Version: 0.32
4
4
  Summary: A minimal yet hyper-efficient backtesting framework for quantitative trading
5
5
  Project-URL: Homepage, https://github.com/yourusername/hyperquant
6
6
  Project-URL: Issues, https://github.com/yourusername/hyperquant/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hyperquant"
3
- version = "0.31"
3
+ version = "0.32"
4
4
  description = "A minimal yet hyper-efficient backtesting framework for quantitative trading"
5
5
  authors = [
6
6
  { name = "MissinA", email = "1421329142@qq.com" }
@@ -150,7 +150,7 @@ class OurbitSwap:
150
150
  data["side"] = 4
151
151
  elif side == 'close_sell':
152
152
  data["side"] = 2
153
- data["type"] = 5
153
+
154
154
  if position_id is None:
155
155
  raise ValueError("position_id is required for closing position")
156
156
  data["positionId"] = position_id
@@ -160,6 +160,50 @@ class OurbitSwap:
160
160
  "POST", f"{self.api_url}/api/v1/private/order/create", data=data
161
161
  )
162
162
  return self.ret_content(res)
163
+
164
+ async def place_tpsl(self,
165
+ position_id: int,
166
+ take_profit: Optional[float] = None,
167
+ stop_loss: Optional[float] = None,
168
+ ):
169
+ """
170
+ position_id 持仓ID
171
+
172
+ .. code:: json
173
+
174
+ {
175
+ "success": true,
176
+ "code": 0,
177
+ "data": 2280508
178
+ }
179
+ """
180
+ if (take_profit is None) and (stop_loss is None):
181
+ raise ValueError("params err")
182
+
183
+ data = {
184
+ "positionId": position_id,
185
+ "profitTrend": "1",
186
+ "lossTrend": "1",
187
+ "profitLossVolType": "SAME",
188
+ "volType": 2,
189
+ "takeProfitReverse": 2,
190
+ "stopLossReverse": 2,
191
+ "priceProtect": "0",
192
+ }
193
+
194
+ if take_profit is not None:
195
+ data["takeProfitPrice"] = take_profit
196
+ if stop_loss is not None:
197
+ data["stopLossPrice"] = stop_loss
198
+
199
+
200
+ res = await self.client.fetch(
201
+ "POST",
202
+ f"{self.api_url}/api/v1/private/stoporder/place",
203
+ data=data
204
+ )
205
+
206
+ return self.ret_content(res)
163
207
 
164
208
  async def cancel_orders(self, order_ids: list[str]):
165
209
  res = await self.client.fetch(
@@ -530,7 +530,7 @@ wheels = [
530
530
 
531
531
  [[package]]
532
532
  name = "hyperquant"
533
- version = "0.3"
533
+ version = "0.31"
534
534
  source = { editable = "." }
535
535
  dependencies = [
536
536
  { name = "aiohttp" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes