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

As #2222 is closed : [binance.js] Error -1100: Illegal characters found in parameter 'price' #2287

Closed
Tralala44 opened this issue Jul 7, 2018 · 19 comments

Comments

@Tralala44
Copy link

Note: this is the technical bug tracker, please use other platforms for getting support and starting a (non technical) discussion. See the getting help page for details.

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

Action taken (what you did)
Fresh install and same output.

Expected result (what you hoped would happen)
working trade.

Actual result (unexpected outcome)
buying BTC @ 5.8e-7
<-- POST /api/getCandles
--> POST /api/getCandles 200 495ms 1.47kb
handleCreate [binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(.[0-9]{1,20})?$'.
RECEIVED ERROR IN GEKKO INSTANCE 2018-07-08-00-14-tradebot-266139359109518
{ name: 'AbortError',
message: '[binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'.' }

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
I know it's Sunday :)
But from what i can imagine may it could be "just" the price format to change (eg 5.8e-7 by 0.00000058)

Thank You

@askmike
Copy link
Owner

askmike commented Jul 8, 2018

Thanks for the report!

But from what i can imagine may it could be "just" the price format to change (eg 5.8e-7 by 0.00000058)

Just to be sure, on what market where you trading?

@Tralala44
Copy link
Author

Tralala44 commented Jul 8, 2018 via email

@askmike
Copy link
Owner

askmike commented Jul 8, 2018

Just pushed a fix to the develop branch, please download that one and try again!

@askmike askmike closed this as completed in 5215772 Jul 8, 2018
@Tralala44
Copy link
Author

Arf as i'm new also to git i struggle on how to do that.
nonetheless i took the new lines of the binance.js and removed the old ones but still :

buying BTC @ 6.1e-7
<-- POST /api/getCandles
--> POST /api/getCandles 200 440ms 1.94kb
handleCreate [binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(.[0-9]{1,20})?$'.
RECEIVED ERROR IN GEKKO INSTANCE 2018-07-08-15-12-tradebot-177197138346324
{ name: 'AbortError',
message: '[binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'.' }

Can you help me with the correct way to get this specific commit ?

@Tralala44
Copy link
Author

nevermind, i've added the price var with this.scientificToDecimal and it works.

@askmike
Copy link
Owner

askmike commented Jul 8, 2018

Cool, you can also download a new release I just published: https://github.com/askmike/gekko/releases

If you do make sure to read the update doc: https://gekko.wizb.it/docs/installation/updating_gekko.html

@six101
Copy link

six101 commented Jul 8, 2018

I have the same problem, maybe you can help me.
The new 6.2 update doesn't work for me either.
In which file and where did you change price var "this.scientificToDecimal"?
thx

@askmike
Copy link
Owner

askmike commented Jul 9, 2018

The new 6.2 update doesn't work for me either.

What do you mean?

In which file and where did you change price var "this.scientificToDecimal"?

inside exchange/wrappers/binance.js

@six101
Copy link

six101 commented Jul 9, 2018

I have made a fresh installation of the 0.6.2 patch but I still have the same "[binance.js] Error -1100: Illegal characters found in parameter 'price'" error.
Markets I have tested are BCN, NPXS and KEY.
To exclude that it is not a windows bash error, I did 2 test installations with the new patch. One windows 10 bash ubuntu and one native windows 10 installation. Both show the error.

In an older develop branch installation I tried to change var price in binance.js but without luck. Haven't found a var price in binance.js. My programming skills are rather limited, so I asked where exactly.

@askmike
Copy link
Owner

askmike commented Jul 9, 2018

Very strange, are you able to share more logs?

@askmike askmike reopened this Jul 9, 2018
@six101
Copy link

six101 commented Jul 9, 2018

strangely enough, the logs don't show any errors. It just stops.
here the last lines of the tradebot log:
2018-07-09 13:23:37 (DEBUG): calculated RSI properties for candle:
2018-07-09 13:23:37 (DEBUG): rsi: 26.31573632
2018-07-09 13:23:37 (DEBUG): price: 0.00000045
2018-07-09 13:23:37 (DEBUG): In low since 1 candle(s)
2018-07-09 13:23:37 (INFO): Trader Received advice to go long. Buying BCN
2018-07-09 13:23:43 (DEBUG): [ORDER] statusChange: SUBMITTED

console window:
handleCreate [binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(.[0-9]{1,20})?$'.
RECEIVED ERROR IN GEKKO INSTANCE 2018-07-09-13-19-tradebot-928605191674484
{ name: 'AbortError',
message: '[binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'.' }

browser:
In the browser window an orange message popps up with:
This is an archived Gekko, it is currently not running anymore.
This is Gekko crashed with the following error: { "name": "AbortError", "message": "[binance.js] Error -1100: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'." }

BTC-NPXS only issues an empty error message:
console:
RECEIVED ERROR IN GEKKO INSTANCE 2018-07-09-13-17-tradebot-829084883261726
{}

Except for the error message and the tradebot stop, gekko continues to run normally.

@askmike
Copy link
Owner

askmike commented Jul 9, 2018

I think I found the problem! Here are my trade logs:

2018-07-09 21:08:43 (INFO):         [EVENT advice]
 { id: 'advice-1',
  recommendation: 'short',
  date: moment.utc("2018-07-09T13:08:00.000+00:00") }
2018-07-09 21:08:43 (INFO):         [EVENT portfolioValueChange]
 { balance: 0.004157699999999999 }
2018-07-09 21:08:43 (INFO):         [EVENT tradeInitiated]
 { id: 'trade-1',
  adviceId: 'advice-1',
  action: 'sell',
  portfolio: { currency: 0.000272, asset: 6370 },
  balance: 0.004157699999999999 }
2018-07-09 21:10:44 (INFO):         [EVENT tradeCompleted]
 { id: 'trade-1',
  adviceId: 'advice-1',
  action: 'sell',
  cost: 0.000001845555,
  amount: 6051,
  price: 6.1e-7,
  portfolio: { currency: 0.00396311, asset: 319 },
  balance: 0.004157699999999999,
  date: moment("2018-07-09T21:09:18.040"),
  feePercent: 0.05,
  effectivePrice: 6.09695e-7 }

@askmike askmike closed this as completed in e7bb477 Jul 9, 2018
@askmike
Copy link
Owner

askmike commented Jul 9, 2018

I am quite positive this is fixed now in the latest develop branch, please update and try again :)

@six101
Copy link

six101 commented Jul 9, 2018

Unfortunately it still doesn't work for me. I'm on the latest dev branch.
Now gekko crashes with an empty error message.

RECEIVED ERROR IN GEKKO INSTANCE 2018-07-09-16-23-tradebot-7025096271114903
{}

I tested with bcn and npxs.

tradebotlog:
2018-07-09 16:33:11 (DEBUG): calculated RSI properties for candle:
2018-07-09 16:33:11 (DEBUG): rsi: 6.03650177
2018-07-09 16:33:11 (DEBUG): price: 0.00000046
2018-07-09 16:33:11 (DEBUG): In low since 1 candle(s)
2018-07-09 16:33:11 (INFO): Trader Received advice to go long. Buying BCN
2018-07-09 16:33:11 (DEBUG): Creating order to buy 259.18478260869557 BCN
2018-07-09 16:33:16 (DEBUG): [ORDER] statusChange: SUBMITTED

edit:
The order was transmitted to binance and also executed. After that the tradebot crashed.
bcn can only be bought on binance in whole units. Maybe that has something to do with it?

@Tralala44
Copy link
Author

Hello six101 and askmike
i didn't try the latest update but from the commit i have i've added that line :


Trader.prototype.addOrder = function(tradeType, amount, price, callback) {
const setOrder = (err, data) => {
if (err) return callback(err);

 const txid = data.orderId;

 callback(undefined, txid);

};

price = this.scientificToDecimal(price);

const reqData = {
symbol: this.pair,
side: tradeType.toUpperCase(),
type: 'LIMIT',
timeInForce: 'GTC',
quantity: amount,
price: price,
timestamp: new Date().getTime()
};


I doubt that it was the best place to add it but it did the job.

Although now i have another problem, the buy order is correctly sent to binance but my strategy on the next candle send a legitimate sell order whereas the buy order is not completed and so cancelled it...But i don't want to pollute this issue.

@askmike
Copy link
Owner

askmike commented Jul 9, 2018 via email

@Tralala44
Copy link
Author

So Six, have you made it ?
Reality seams way different of backtesting bcn or npxs for me :)

@six101
Copy link

six101 commented Jul 12, 2018

Sorry I'm just checking in, I'm in the middle of a move. I didn't have much time to test. I think sunday I can take a little time to re-test. . Then I will test bcn and npxs again.

@six101 can you provide logs?

previous tests showed only an empty error message:
RECEIVED ERROR IN GEKKO INSTANCE 2018-07-09-16-16-tradebot-745727029157132
{}
No entries in tradebotlog.
Is it somehow possible to enable a higher log level?

But I can also report something positive.
I tested a little with BTC-DENT and the bot went without any errors. But I hadn't tested DENT before and I have no idea if DENT caused errors before.

@askmike
Copy link
Owner

askmike commented Jul 13, 2018 via email

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

3 participants