Giter VIP home page Giter VIP logo

Comments (15)

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024 1

It worked. it was indeed the CCXT update! Many thanks for your assistance!
I opened indeed the position manually from the website to see if the positions where read ok.

It really works great. Really great job!!!

from whook.

germangar avatar germangar commented on September 24, 2024 1

I'm afraid only a few exchanges offer that possibility from the API. I checked Bybit documentation and I don't see how to do it.

If you use limit orders you will be a maker, but I think if the order is instantly triggered (the price was already in the range) it's not considered a maker, and that's where postOnly would make a difference.

I had the plan to make a special market order that would place the order as limit order checking the most recent price and using it, but it's a risky thing to use if the price is trending hard. I imagine only a percentage of orders would enter as maker, but it's better than nothing.

from whook.

a202037 avatar a202037 commented on September 24, 2024

Hi, thanks for the development and it's a very nice repo. Is that possible to add support to krakenfutues ?

from whook.

germangar avatar germangar commented on September 24, 2024

Kraken futures added.

It has a couple of weaknesses compared to all the other exchanges, tho. Kraken doesn't offer a way to modify the margin mode from the API, so Whook won't set the margin to isolated as it does for every other exchange. The trades will happen in the margin mode the user has in the website.

Kraken doesn't either report the maximum leverage accepted for each symbol, so you have to careful not to exceed it or the order won't go through generating a bunch of spam in the console until the order times out.

Neither of these should be a big deal for algo trading. Other than these it's working fine. Both market and limit orders. It's perfectly usable.

PS: I only tested it in the testnet server trading with USD pairs. Kraken (as Binance) has futures blocked in my country.

from whook.

maddrid avatar maddrid commented on September 24, 2024

hi @germangar i can provide some bingx subaccount api
could you send me some details how to contact you

from whook.

germangar avatar germangar commented on September 24, 2024

Hey, thank you! You can send me an email to germangarciaart(AT)gmail.com

from whook.

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024

First off all thanks!!! Got it to work on kucoin, but on bybit it gives an error. So it seems to reocognize two open posititions
but trading doesn't work. Have you had this problem before and do you know how to solve it?

23:13:29 Initializing account: [ BYBIT__AlexW_G_main ] in [ bybit ]

2 positions found.

  • W: refreshPositions: Could not get marginMode for ARB/USDT:USDT
  • W: refreshPositions: Could not get marginMode for ETC/USDT:USDT
    Account creation failed: can only concatenate str (not "NoneType") to str <class 'TypeError'>

Warm regards,

Alexander

from whook.

germangar avatar germangar commented on September 24, 2024

Hello. I haven't used Bybit in quite a while. Probably something has changed in either ccxt or the exchange that has triggered a bug. I'll take a look into it in the next few days.

from whook.

germangar avatar germangar commented on September 24, 2024

@AlexanderWatersOxygen I committed a quick fix. Update and it should work fine.

from whook.

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024

@AlexanderWatersOxygen I committed a quick fix. Update and it should work fine.

that is amazing!! Thanks

from whook.

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024

the error is above is resolved, but i encountered a one with placing orders.
So the first part; reading the account info works

19:26:31 Initializing account: [ BYBIT__AlexW_G_main ] in [ bybit ]

1 positions found.
BTC/USDT:USDT * cross:10x * short * 0.012 * 84.7642[$] * -0.08[$] * -0.09%

but when placing an order it says (i tried a few ways of webhook styles):

19:15:02 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main btc/USDT:USDT 10$ buy 10x
19:30:44 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etc/USDT:USDT 100$ short 10x
19:31:21 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etc/USDT 100$ short 10x
19:35:46 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etcUSDT 100$ short 10x

ps feel a little bit bad to ask you again, but to get to your level of understanding the matter will take me few more years haha

from whook.

germangar avatar germangar commented on September 24, 2024

No, no. Don't feel bad. Please report these things. I don't use Bybit anymore and, while I try to check from time to time in a demo account, things in ccxt and the exchange always keep changing and my code may get a little outdated.

However, I tried placing and closing an order when I did the other fix and it was working for me. Is your ccxt version current?

I'll try to reproduce it and fix it when I have a moment.

Edit: I did a quick test and it works for me. So I don't think the problem is with the order itself. If it's not an issue with the ccxt version maybe there's something with the account name. I'll check that

21:21:27 [bybitdemo/bybit]
21:21:27 [bybitdemo/bybit]  ALERT: BTCUSDT bybitdemo 10$ buy 10x
21:21:27 [bybitdemo/bybit] ----------------------------
21:21:44 [bybitdemo/bybit]  * Order succesful: BTC/USDT:USDT buy 0.001 10x at price 74363.1 id 0e7b2910-44f3-4b65-b3a1-b290ae2f1c83
------------------------------
  1 positions found.
  BTC/USDT:USDT * isolated:10x * long * 0.001 * 7.0830[$] * -0.03[$] * -0.40%
------------------------------
21:22:49 [bybitdemo/bybit]
21:22:49 [bybitdemo/bybit]  ALERT: BTCUSDT bybitdemo pos 0$ 10x
21:22:49 [bybitdemo/bybit] ----------------------------
21:23:05 [bybitdemo/bybit]  * Order succesful: BTC/USDT:USDT sell 0.001 0x at price 67491.7 id e126cacf-4d12-4d72-adf4-5399d3ea342c
  0 positions found.
------------------------------

Oh. One thing. The symbol name must be all caps (That's one thing I can improve in the code)

21:26:54 [bybitdemo/bybit]
21:26:54 [bybitdemo/bybit]  ALERT: btc/USDT:USDT bybitdemo pos 10$ 10x
21:26:54 [bybitdemo/bybit] ----------------------------
21:26:54 [bybitdemo/bybit]  * E: Couldn't find symbol

But I don't think that's the reason for your issue since I only get a normal healthy syntax error.

I tried using the same account name as you to discard posibilities. It worked as expected

21:36:52 [BYBIT__AlexW_G_main/bybit]
21:36:52 [BYBIT__AlexW_G_main/bybit]  ALERT: btc/USDT:USDT BYBIT__AlexW_G_main buy 10$ 10x
21:36:52 [BYBIT__AlexW_G_main/bybit] ----------------------------
21:36:52 [BYBIT__AlexW_G_main/bybit]  * E: Couldn't find symbol
21:37:25 [BYBIT__AlexW_G_main/bybit]
21:37:25 [BYBIT__AlexW_G_main/bybit]  ALERT: BTC/USDT:USDT BYBIT__AlexW_G_main buy 10$ 10x
21:37:25 [BYBIT__AlexW_G_main/bybit] ----------------------------
21:37:35 [BYBIT__AlexW_G_main/bybit]  * Order succesful: BTC/USDT:USDT buy 0.001 10x at price 74355.8 id 2a954cd7-b503-4c6f-b9af-e3537a6e02c8
------------------------------
  1 positions found.
  BTC/USDT:USDT * isolated:10x * long * 0.001 * 7.0815[$] * 0.00[$] * 0.00%

from whook.

germangar avatar germangar commented on September 24, 2024

19:26:31 Initializing account: [ BYBIT__AlexW_G_main ] in [ bybit ]

1 positions found. BTC/USDT:USDT * cross:10x * short * 0.012 * 84.7642[$] * -0.08[$] * -0.09%

but when placing an order it says (i tried a few ways of webhook styles):

19:15:02 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main btc/USDT:USDT 10$ buy 10x 19:30:44 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etc/USDT:USDT 100$ short 10x 19:31:21 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etc/USDT 100$ short 10x 19:35:46 * E: Account ID not found. ALERT: BYBIT__AlexW_G_main etcUSDT 100$ short 10x

Hold on. I notice your position is in cross margin mode. Did you open that position from the website or is your account setup for cross margin?
Can you check if the position in the website/app is showing as cross margin too?

Also. Can you paste here the lines when it initializates the account? It sounds like there was still an error at initialization.

from whook.

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024

After your last message I will take the liberty to request/ ask you something:

When placing a limit order is; is it possible to make it a 'Post Only' (or is that already the case?) because with a _maker order _ you could get super low fees :) of course with the risk orders don't get filled. :)

btw (as a side note. When you place a long order that balances out a short order and vise versa, you don't pay funding fees on a few exchanges i tested).
anyway the less fees the more likely a bot is profitable (if orders get filled of course :P) !!!!

from whook.

AlexanderWatersOxygen avatar AlexanderWatersOxygen commented on September 24, 2024

I'm afraid only a few exchanges offer that possibility from the API. I checked Bybit documentation and I don't see how to do it.

If you use limit orders you will be a maker, but I think if the order is instantly triggered (the price was already in the range) it's not considered a maker, and that's where postOnly would make a difference.

I had the plan to make a special market order that would place the order as limit order checking the most recent price and using it, but it's a risky thing to use if the price is trending hard. I imagine only a percentage of orders would enter as maker, but it's better than nothing.

Ok thanks for looking into it, and your answer!
I didn't know that distinction of the price being in the range... but makes sense.

Yeah I reckoned that the might be problematic with trending markets and or ad hoc orders (that many bots have).

Already get an headache thinking about the complexity of programming, when having for example, a check if orders were filled, so that when you would place a opposite order (to avoid the funding fees), you don't end up shorting or longing a position that you wanted neutralized/ paid out, because a order was not (or not completely) filled. Anyways, a close order would always work :D

And contemplating on it, I guess that placing postOnly orders makes most sense when let's say you want to make predetermined exits or entries at for example support and resistance levels. But then you still would have to put in a trigger price and actual limit order price to be most sure they get filled right?

from whook.

Related Issues (15)

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.