Manually place limit orders that stay ontop - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: General Discussion (https://forum.gekko.wizb.it/forum-14.html) +--- Thread: Manually place limit orders that stay ontop (/thread-57457.html) |
Manually place limit orders that stay ontop - Automatica - 07-28-2018 Hello, I am trying to figure out how I can use gekko to manually place buy limit orders that stay ontop of the orderbook when it starts moving. Stopping at a defined limit if the order is not filled. I haven't been able to find a strategy that I want to use so i'm still trying to do manual trades. Thanks! PS: If this is in the wrong section, I am sorry please move it RE: Manually place limit orders that stay ontop - askmike - 07-29-2018 Quote:PS: If this is in the wrong section I need to restructure the sections, it's a bit messy at the moment. Quote:I am trying to figure out how I can use gekko to manually place buy limit orders that stay ontop of the orderbook I'm not fully understanding your question, but as of right now you have 2 tools available: Use Gekko You can use Gekko to create use/create a strategy that won't just trade, but also figure out when to trade (using TA indicators or any other math you put in your strategies). Read more about Gekko Strategies here: https://gekko.wizb.it/docs/strategies/introduction.html If you want to trade yourself (you want to decide when to buy or sell) this is not the way to go. Use Gekko Broker If you don't want to use a Gekko strategy to determine when to buy or sell, but if you want to buy or sell yourself: you can use the sticky order from Gekko Broker. But note: this is a technical tool with a low level interface (to be used within your own nodejs trading system). I might wrap this into a tiny dashboard at some point, but I hope other people will do that. An example of you how you can use Gekko Broker in your own trading app: Code: // from NPM If you put that into a file and run the file it will: - create an order to buy 1 BTC by placing orders at the top of the book (bid side, does not cross). - update the order (cancel/create new one) if the best bid moves up. - log whenever a) it moved an order and b) there was a (partial) fill. - when it's completed (when the 1 btc was bought) it will print a summary. I just ran it (buying 1 BNB) and this was my output: Code: root@foxtail:~/gb/nusadua# node b Quote:Stopping at a defined limit if the order is not filled. I'm not 100% sure what you mean, but you can pas a limit flag to createOrder. In the above example replace: Quote:const order = binance.createOrder(type, side, amount); with: Quote:const order = binance.createOrder(type, side, amount, { limit: 100 }); Where limit the maximum price you are willing to pay (when buying) or the minimum price you are willing to get (when selling). However this still never crosses, this simply allows you to stay below the BBO. After the order is created you are able to change this limit by calling: Code: order.moveLimit(120) There is also an outbid flag you can pass in that object, but it's NOT stable yet. RE: Manually place limit orders that stay ontop - askmike - 07-29-2018 I saw you had another question in your other thread, I'll answer it here: Quote:Is there a way to run this from the command line and specify the buy price? So above I talked about the sticky order, see here: https://gekko.wizb.it/docs/gekko-broker/sticky_order.html Which is kind of like an "advanced" order that tries to get the fastest order execution without crossing (meaning: you pay less fees on some exchanges - maker fees, and you get a better price since you don't cross the spread). It's meant for situations where you know you want to buy or sell for a good price, but you don't care about other details (like at what price exactly you want to buy at). Where as if you want to specify price, you basically want to do a limit order. There is no stable limit order (as Gekko itself only uses sticky orders) as of right now. |