Coder Social home page Coder Social logo

open-api-sdk-v5's Introduction

Open-API-SDK-V5

open-api-sdk-v5's People

Contributors

bigxia avatar jane-cloud avatar qinglin-919 avatar shangguanwangmumu avatar ttc-tt avatar ttc0425 avatar wangyongguiokcoin avatar y-super-y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open-api-sdk-v5's Issues

存在多线程导致程序执行完毕后无法正常退出

image
由此可见,我仅仅是调用了余额的方法,随后返回了数据,但是我发现程序并未停止,随后经过查询,除了我调用的方法外,另外还有7个线程依然在执行,我不知道这是在做什么?这是java版本的sdk,有人有相同的情况吗

Python版本API名称错误

# Get Account Configuration
def get_position_mode(self, posMode):
    params = {'posMode': posMode}
    return self._request_with_params(POST, POSITION_MODE, params)

经测试,这里是Set,并不是Get

Not acctual issue but need help!

Hi, How do i grab a single value from a function that returns multiple? Like if im using the get_ticker function for example and i only want to grab the 24H price and store it as an variable to do something with how do i do that without getting all of this returned?

{'code': '0', 'msg': '', 'data': [{'instType': 'SPOT', 'instId': 'ETH-BTC', 'last': '0.075', 'lastSz': '0.086', 'askPx': '0.075', 'askSz': '132971196.739574', 'bidPx': '0.0721', 'bidSz': '23.652', 'open24h': '0.062', 'high24h': '0.07615', 'low24h': '0.0609', 'volCcy24h': '524334416.762623', 'vol24h': '8436393910.5933', 'ts': '1630925573714', 'sodUtc0': '0.062', 'sodUtc8': '0.06199'}]}

文档注释

okex和okex_http2不能整合吗?init.py文件直接复制的v3版本的还没改过来。

api在国内访问受限

你好,请问下,okex的api好像在**大陆访问受限。请问您是用什么方式,才能够访问到api,得到api的返回结果呢?

JAVA的sdk怎么处理消息呢?

比如我使用ws获取到了 我当前的订单被平仓了 我想反向开仓,但是 我尝试修改onMessage方法,执行的时候 客户端会断开连接,请问有提供处理消息的接口或者方法吗?

帮我看下50101是什么问题?开始以为www.okex.win不行,换成www.okex.com也还是一样。

KEY,PASSPHRASE,SIGN做了脱敏处理,都是自家账号申请的数据。
Request(2021-04-19 21:49:10:346):
Url: https://www.okex.com/api/v5/asset/deposit-history?ccy=USDT&state=&after=&before=&limit=
Method: GET
Headers:
Accept: application/json
Content-Type: application/json; charset=UTF-8
Cookie: locale=en_US
OK-ACCESS-KEY: 641e5ce6---****-23cb7740ffe8
OK-ACCESS-PASSPHRASE: *****
OK-ACCESS-SIGN: **************************
OK-ACCESS-TIMESTAMP: 2021-04-19T13:49:10.342Z
x-simulated-trading: 1
request body:
preHash: 2021-04-19T13:49:10.342ZGET/api/v5/asset/deposit-history?ccy=USDT&state=&after=&before=&limit=
2021-04-19 21:49:11.158 [MyScheduler_Worker-1] INFO com.okex.open.api.client.APIClient:157 -
Response(2021-04-19 21:49:11:158):
Status: 401
Message:
2021-04-19 21:49:11.188 [MyScheduler_Worker-1] ERROR org.quartz.core.JobRunShell:211 - Job DEFAULT.org.jeecg.modules.quartz.job.PushQueryJob threw an unhandled Exception:
com.okex.open.api.exception.APIException: 50101 : Broker id of APIKey does not match current environment.

Latencyt problem

I get latency problem with below code. Do you have any idea how to fix that?

error_o = 1
while error_o <= 1:
    try:
        wso = create_connection("wss://wsaws.okex.com:8443/ws/v5/public")
        error_o = 2
        continue
    except:
        print('connect ws error,retry...')
        error_o = 0
        time.sleep(5)

trade_okex ="""
    {
      "op": "subscribe",
      "args": [
        {
          "channel": "trades",
          "instId": "BTC-USDT"
        }
      ]
    }
    """
wso.send(trade_okex)

db_one_o = []
db2_o =[]

dif = dt.datetime.now()

while True :
try:
    db_one_o.append(json.loads(wso.recv()))

    for i in range(1,len(db_one_o)):
        if db_one_o[i]['data'][0]['side'] == 'buy':
            drct = 1 
        else:
            drct = -1     
            
        db2_o.append({'datetime' : datetime.fromtimestamp(float(db_one_o[i]['data'][0]['ts'])/1000),
                    'date_time' : datetime.fromtimestamp(float(db_one_o[i]['data'][0]['ts'])/1000).strftime('%Y-%m-%d %H:%M'),
                    'price': float(db_one_o[i]['data'][0]['px']),
                    'qty': float(db_one_o[i]['data'][0]['sz'])*drct, 
                    'Volume' : float(db_one_o[i]['data'][0]['px'])*float(db_one_o[i]['data'][0]['sz'])*drct})
except:
    continue

        
def send(msg, chat_id, token=token):
    bot = telegram.Bot(token=token)
    bot.sendMessage(chat_id=chat_id, text= str(msg))  
    
try:
    db3_o = pd.DataFrame(db2_o)
    db3_o.drop_duplicates(keep='first',inplace=True)
    db3_o.reset_index(drop=True)
    db4_o = db3_o.groupby('date_time').agg({'qty':['sum'],'price':['mean'],'Volume':['sum']}).reset_index()
    db5_o = pd.DataFrame({'Time':db4_o['date_time'], 'qty':db4_o['qty']['sum'], 'price':db4_o['price']['mean'], 'Volume':db4_o['Volume']['sum']})  
except:
    continue`

用java版本请求交易类数据报 50102错误

报错如下:
20:04:49.639 [main] INFO com.okex.open.api.client.APIHttpClient -
Request(2023-07-04 20:04:49:637):
Url: https://aws.okx.com/api/v5/account/balance?ccy=USDT
Method: GET
Headers:
Accept: application/json
Content-Type: application/json; charset=UTF-8
Cookie: locale=en_US
OK-ACCESS-KEY: e6de4122-97cd-484a-91c0-1fda26b6ca01
OK-ACCESS-PASSPHRASE: Songbo@123
OK-ACCESS-SIGN: MuKYoZHZvQKbzTU5/4ktT7zow2p4XHiT5zSjg+/SZZ4=
OK-ACCESS-TIMESTAMP: 2023-07-04T12:04:49.584Z
x-simulated-trading: 1
request body:
preHash: 2023-07-04T12:04:49.584ZGET/api/v5/account/balance?ccy=USDT
20:04:50.280 [main] INFO com.okex.open.api.client.APIClient -
Response(2023-07-04 20:04:50:280):
Status: 401
Message:
Response Body:{"code":"50102","data":[],"msg":"Timestamp request expired"}

com.okex.open.api.exception.APIException: 50102 : Timestamp request expired

这个时间戳应该怎么设置啊?大侠教我

怎么在UbuntuKylin 22.04上运行python-API-SDK-V5?

我想在ubuntuKylin 22.04运行python-API-SDK-V5, ubuntuKylin里自带的python版本是3.10.4。运行该代码时,提示"the loop parameter was removed from Lock() since it is no longer necessary。可以让它支持3.10吗?应该怎么修改代码?

国内可用的URL

python的consts.py文件中的 www.okex.com 在国内无法访问。请问有能在国内访问的URL吗?我每次应该如何获到最新的可用的URL ?

Authentication example for bash

Hello,
Can you please put an example for the authentication part for bash/shell script ?

I wrote my tools in bash while I was on another exchange and now I intend to move to OKX

So any help please ? thank you .

{"code":"51000","data":[],"msg":"Parameter tpTriggerPx error"}

Dear friends i using the okx-python-sdk-api-v5 to place an positions and using algo order for set sl and tp . in some situations i just need stop lost and no needs for take profit so i just fill the slTriggerPx and slOrdPx parameter for place algo order and i get this error {"code":"51000","data":[],"msg":"Parameter tpTriggerPx error"}
can you tell me why the both of sl and tp parametes are required ? and how can i just set sl parameter?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.