Comments (7)
It used to work good with me but for now it has same error
from bybit-market-maker.
I first get a fill, then moments later I get this error:
2021-07-03 01:28:11.796893 - INFO - Awaiting position.
Traceback (most recent call last):
File "mm.py", line 191, in
s.set_trading_stop(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pybit/init.py", line 909, in set_trading_stop
return self._submit_request(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pybit/init.py", line 1497, in _submit_request
raise InvalidRequestError(
pybit.exceptions.InvalidRequestError: Not modified (ErrCode: 34040) (ErrTime: 01:28:14).
Request → POST https://api.bybit.com/v2/private/position/trading-stop: {'api_key': '', 'recv_window': 5000, 'stop_loss': 2194, 'symbol': 'ETHUSD', 'timestamp': 1625275694488, 'sign': ''}.
This suggests that you've already placed a stop and are trying to modify your trading stop, but the stop loss hasn't changed. For example, if you place a limit order with a stop of 2194, then after filling try to modify the trading stop to the same price (2194), you will get this error. Is this your situation?
from bybit-market-maker.
This suggests that you've already placed a stop and are trying to modify your trading stop, but the stop loss hasn't changed. For example, if you place a limit order with a stop of 2194, then after filling try to modify the trading stop to the same price (2194), you will get this error. Is this your situation?
No I had actually not placed any stops at all.
from bybit-market-maker.
Oh No!!!
It used to work good with me but for now it has same error now!
Besides, it is ignored by the bybit support.
Dose anyone know a solution ErrCode: 34040?
from bybit-market-maker.
Hi guys here's a solution.
Let's say you opened a 'Buy' position (the position must be already open),
here's a simple function to add then a SL.
from pybit import HTTP # version: pybit==1.3.6 USE THIS VERSION
def STOP_LOSS_for_LONG_POSITION():
session = HTTP('https://api-testnet.bybit.com', api_key=KEY, api_secret=SECRET)
session.set_trading_stop(
symbol="SOLUSDT",
side="Buy", # I opened a position at 38.70
stop_loss = 38.00) # I set the stop at 38.00
STOP_LOSS_for_LONG_POSITION() # Execute it.
from bybit-market-maker.
@Jessika-Art thank you for your response but it doesn't work.
Any another idea?
from bybit-market-maker.
@Kamkuczpol my friend, I just created a simple repo just for you so you can copy the code that works.
To make easier your research the functions you need are in lines 163 and 177 for stop loss for buy and sell and both are called in lines 199 for buy and 210 for sell.
I make them easy to read and highly customizable.
from bybit-market-maker.
Related Issues (13)
- Error code 10012 HOT 6
- got error with API keys HOT 1
- Error Code: 30031
- (ErrCode: 10004) (ErrTime: 07:45:20).
- Error When trying to modify SL
- Error on Run
- xrpusd HOT 3
- Can you make this market maker to have option for long only or short only HOT 1
- pybit.exceptions.InvalidRequestError: ... (ErrCode: 30031) HOT 2
- Can you make this script to go only long or only short
- Does not opens take profit and stop loss orders
- Does this bot only work on Inverse perpetual? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bybit-market-maker.