![]() |
Need help with trading bot functionality - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Technical Support (https://forum.gekko.wizb.it/forum-19.html) +--- Thread: Need help with trading bot functionality (/thread-1459.html) |
Need help with trading bot functionality - BitPerson - 02-09-2018 Hey there! I developed my working strategy and I like how it works good sometimes. Here there are some problems with my usage of Gekko (trading bot with API from exchanges): 1) I save the last price I bought/sold like: Code: this.lastprice = candle.close; This is a big problem when you buy/sell at a price xx% (where xx is big) higher/lower from the price that triggered the advice. Example: Advice: buy @0.00015 -> lastprice = 0.00015 but then it buys @0.00019 -> sell @0.00017 -> I expect +0.00002 but I'm like -0.00002. Is there a solution? Is there the possibility to get the last price traded instead of the way I use? 2) I also would like to stop orders repetition (for example: if there's a long advice when price is 0.00015 and then price goes to 0.00030 while the order is not yet satisfied, I would like to cancel the order, not changing it to buy @0.00030). Is it possible? 3) Am I right to use advices (this.advice("long"); / this.advice("short") ![]() 3.a) Is it possible to suggest prices instead of using the best to buy/sell? 3.b) Is it possible to force some (or any, but I would prefer just some) order to "taker" instead of "maker" (market price usage) in Gdax? Sorry for my bad english, hope everything is clear! ![]() Sorry if there is an obvious solution but I'm not a developer ![]() Thank you for your software and your time, you already made a fantastic work! RE: Need help with trading bot functionality - BitPerson - 02-12-2018 Hello, can someone help me please? ![]() RE: Need help with trading bot functionality - askmike - 02-13-2018 I thought I replied to this, not sure where the reply went... > Is there a solution? Is there the possibility to get the last price traded instead of the way I use? This is in the works, if you use the develop branch you can use this: https://github.com/askmike/gekko/pull/1810 > 2) I also would like to stop orders repetition (for example: if there's a long advice when price is 0.00015 and then price goes to 0.00030 while the order is not yet satisfied, I would like to cancel the order, not changing it to buy @0.00030). Is it possible? > 3.a) Is it possible to suggest prices instead of using the best to buy/sell? > 3.b) Is it possible to force some (or any, but I would prefer just some) order to "taker" instead of "maker" (market price usage) in Gdax? Not yet, but all these features (except for 3a) are being worked on right now. > 3) Am I right to use advices (this.advice("long"); / this.advice("short")Wink even if I'm using trading bot and not paper trader? Or is it possible to use something more useful? For example: Yes: the only thing your strategy can do is advice. Whether there will be a real trader (tradebot) or simulated trader (paper trader) depends on how you configured Gekko. Your strategy is completely unaware of this. RE: Need help with trading bot functionality - tommiehansen - 02-13-2018 For a really simple stoploss you could do something like below: Code: // req's Note that this is just an example. It could ofc be improved upon e.g. we could skip X amount of candles for the stoploss check etc or begin doing stuff such as having 5 min candles but doing long/short on 2x candles (which would equal 10 minutes) in order to have a stoploss that checks each 5 min candle and a strategy that works on 10 min candles. Do note that this isn't a 'true' stoploss since candle resolution (time e.g. 10 minutes) will affect the stoploss since the strategy will not be aware of anything that happens in-between candles. In order for it to know such things you would need to use the minimum resolution available (which would be 1 minute in Gekko) and then use some other value for the strategy itself like i write about above. Actually that's pretty interesting so might write something that does it but does it inline (so it doesn't require 1 billion dependencies). Your ability to write code is the limit. RE: Need help with trading bot functionality - BitPerson - 02-13-2018 (02-13-2018, 06:04 AM)askmike Wrote: [...] Hi @askmike, thank you for your reply. I'm not a developer, so it's hard for me to understand everything from that thread. Can you help me just understanding how I can: - get the last price traded: Code: this.lastprice = ??? - get the buy/sell information: Code: // If I bought = 1; if I sold = 2 Not least, if I place a manual order on the exchange (so not made by Gekko), will this ontrade function get the information too? Thank you! |