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

Reference Error -> minimum is undefined (trader crashes) #2083

Closed
H256 opened this issue Apr 4, 2018 · 9 comments
Closed

Reference Error -> minimum is undefined (trader crashes) #2083

H256 opened this issue Apr 4, 2018 · 9 comments

Comments

@H256
Copy link
Contributor

H256 commented Apr 4, 2018

I'm submitting a ...
[x ] bug report
[ ] question about the decisions made in the repository

Action taken (what you did)
From command-line
Start live trading @Bitstamp using current develop version (incl. new Trade-Class)

Expected result (what you hoped would happen)
It trades...

Actual result (unexpected outcome)
Errormessage and process crashes.

C:\gekko\plugins\trader\trade.js:310
      return minimum = this.minimalOrder.amount / price;
                     ^

ReferenceError: minimum is not defined
    at Trade.getMinimum (C:\gekko\plugins\trader\trade.js:310:22)
    at Trade.buy (C:\gekko\plugins\trader\trade.js:140:22)
    at act (C:\gekko\plugins\trader\trade.js:83:18)
    at C:\gekko\node_modules\async\dist\async.js:3853:9
    at C:\gekko\node_modules\async\dist\async.js:484:16
    at replenish (C:\gekko\node_modules\async\dist\async.js:1025:25)
    at iterateeCallback (C:\gekko\node_modules\async\dist\async.js:1015:17)
    at C:\gekko\node_modules\async\dist\async.js:988:16
    at C:\gekko\node_modules\async\dist\async.js:3850:13
    at apply (C:\gekko\node_modules\async\dist\async.js:41:25)

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
This seems to happen on the first advice, the trader gets (regardless of being a short/long).
It happened only at BitStamp so far, I have other instances running where no crash occured.

I have also tried it with a fresh clone of the repo - the result is the same.

@askmike
Copy link
Owner

askmike commented Apr 4, 2018

ah nice catch! ping @ansonphong

@dmuzizian
Copy link

Error. How to FIX? i'm using BITTREX ... BTC-DOGE
screenshot_1

@H256
Copy link
Contributor Author

H256 commented Apr 13, 2018

@dmuzizian I have just temporarily altered the line to this:
return this.minimalOrder.amount
This seems to work.

@dmuzizian
Copy link

where i can find this line ? @H256

@H256
Copy link
Contributor Author

H256 commented Apr 13, 2018

The first line of the error states the path, which in your case would be /root/gekko/plugins/trader/. in the file, the line number to change in the file trade.js would be line 312 ;)

@dmuzizian
Copy link

like this ?

getMinimum(price) {
if(this.minimalOrder.unit === 'currency')
return minimum = this.minimalOrder.amount / price;
else
return minimum = return this.minimalOrder.amount;
}

@H256
Copy link
Contributor Author

H256 commented Apr 13, 2018

getMinimum(price) {
if(this.minimalOrder.unit === 'currency')
return  this.minimalOrder.amount / price;
else
return this.minimalOrder.amount;
}

should do ;)

@wizmanza
Copy link

wizmanza commented May 6, 2018

workaround worked for me....Thanks!

@askmike
Copy link
Owner

askmike commented May 22, 2018

Please download the latest develop, this has been fixed on that branch already.

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

4 participants