Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

[GDAX] Canceled, not filled order #1848

Closed
ihdk opened this issue Feb 2, 2018 · 5 comments
Closed

[GDAX] Canceled, not filled order #1848

ihdk opened this issue Feb 2, 2018 · 5 comments

Comments

@ihdk
Copy link

ihdk commented Feb 2, 2018

Hello, first of all, thank you for such great tool like Gekko.
I am running gekko live with GDAX what working pretty well, although I have some questions.

Using advice('short') or advice('long'), it's correctly added to order on GDAX. But sometimes, the request is not filled and order cancelled - this cause me a problem as in my strategy I am couting automatically that it's filled and do the rest of my code.
For example, I am recognizing if sell (advice(short) ) or purchase ( advice(long) ) was done as previous action. If advice is not really filled on GDAX, my code continues the wrong way as in the code is not recognized if request was filled or not.

Is there any way to do not cancel my order and wait until it's filled, or check if for example advice('long') was really filled and purchase really processed on GDAX ?

Thank you so much for any advice.

@askmike
Copy link
Owner

askmike commented Feb 3, 2018

When your advice signals "short" Gekko will try to sell, it will do this by creating orders on your side of the book and if they don't fill cancel and recreate them. Documentation is poor but you can read a bit more about that here: https://gekko.wizb.it/docs/introduction/scope.html#Execution-strategy

If you have found Gekko only canceling but not recreating that's definitely a bug! Please post some logs so we can figure out what is happening.

Is there any way to do not cancel my order and wait until it's filled, or check if for example advice('long') was really filled and purchase really processed on GDAX ?

You are in luck! There now is a new handle called onTrade for your strategy that is called whenever the trader has successfully completed the trade. See here for details #1850 and note that you need to download the latest develop version to access it.

@askmike
Copy link
Owner

askmike commented Feb 3, 2018

I hope that answers your question, if it doesn't please comment again :)

@askmike askmike closed this as completed Feb 3, 2018
@ihdk
Copy link
Author

ihdk commented Feb 3, 2018

Hey Mike, that's perfect, thanks a lot.
inTrade is exactly what I was looking for, I am continue to use develop branch from now...

Just for your information, recreating the order after cancel worked and still working fine, I just looked for the way to disable cancelling what I finally found. But now with inTrade handle, no more needed to disable cancel of order.

Thanks again for your willingness and answer on my questions.
Have a great day.

@askmike
Copy link
Owner

askmike commented Feb 3, 2018

no problem, and if you have more questions feel free to ask :)

@ihdk
Copy link
Author

ihdk commented Feb 3, 2018

Hi again, using the develop branch I am experiencing errors more often while gekko is used live on the market.
Find please errors described below...I am not sure if it has something to do with it, but for me it looks like the problem comes after more attemts to foll my order. Order was few times cancelled and created again, but after some time of this state, errors appear...
If it would have to do something with onTrade function which I started to use, I have there nothing more than:

method.onTrade = function() {
    this.waitingInOrder = false;
    this.diffCandles = 0;
    console.log("\torder completed, can continue...");
}

Would you be so kind to check it please?
Thank you.

  1. (have not copied error), but console said that in file ./exchanges/gdax.js
    in function: Trader.prototype.checkOrder = function(order, callback)
    was not defined "data"
    It was general error that cannot call status of undefind, at line: var status = data.status;

  2. I have copied error message:
    E:\gekko\gekko-develop\plugins\performanceAnalyzer\performanceAnalyzer.js:112
    duration: this.roundTrip.exit.date.diff(this.roundTrip.entry.date)
    ^

TypeError: this.roundTrip.exit.date.diff is not a function
at PerformanceAnalyzer.handleRoundtrip (E:\gekko\gekko-develop\plugins\performanceAnalyzer\performanceAnalyzer.js:112:40)
at PerformanceAnalyzer.bound [as handleRoundtrip] (E:\gekko\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at PerformanceAnalyzer.logRoundtripPart (E:\gekko\gekko-develop\plugins\performanceAnalyzer\performanceAnalyzer.js:94:10)
at PerformanceAnalyzer.bound [as logRoundtripPart] (E:\gekko\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at PerformanceAnalyzer.processTrade (E:\gekko\gekko-develop\plugins\performanceAnalyzer\performanceAnalyzer.js:72:8)
at Trader.bound (E:\gekko\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at emitOne (events.js:121:20)
at Trader.emit (events.js:211:7)
at Trader.bound [as emit] (E:\gekko\gekko-develop\node_modules\lodash\dist\lodash.js:729:21)
at Manager.Trader.manager.on.trade (E:\gekko\gekko-develop\plugins\trader\trader.js:24:10)
RECEIVED ERROR IN GEKKO 548276238634122
Child process has died.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants