Closed spiritix closed 3 years ago
I have the same problem
I get the same Error with creating new Smart Trades or Updating Smart Trades
I managed to solve the problem by using POST body (JSON) instead of GET parameters. Seems like the 3commas API isn't able to properly parse GET parameters, even though stated so in the docs.
arrays in get requests is a very tricky part, better to use JSON body always
having same problem when tring to send api call through node js, cant find how to solve. But iam using POST
"take_profit": { "enabled": "true", "steps": [ { "order_type": "limit", "price": { "value": takeProfit, "type": "last", "percent": "0.1" }, "volume": "100", "trailing": { "enabled": "true", "percent": "0.1" } } ] },
I am also experiencing this, using https://github.com/kirosc/3commas-typescript/blob/master/src/index.ts. It is using a POST.
Anyone solved this?
Anyone solve this ? Trying to take_profit with 3commas-api-node. Thanks
Yeah, don't use arrays guys, use JSON instead.
Yeah, don't use arrays guys, use JSON instead.
Actually I'm not using array, I'm doing it the same way @dmitriy-ganin is doing
And the most weird is I get differents results with the same code (template from official doc)
error: 'record_invalid', error_description: 'Invalid parameters', error_attributes: { 'take_profit[steps]': [ 'is invalid' ], 'take_profit[steps][price][type]': [ 'is missing' ], 'take_profit[steps][price][value],take_profit[steps][price][percent]': [ 'are missing, exactly one parameter must be provided' ] } } [nodemon] restarting due to changes... [nodemon] starting
node serve app.js { error: 'record_invalid', error_description: 'Invalid parameters', error_attributes: { 'take_profit[steps]': [ 'is invalid' ], 'take_profit[steps][2][price][type]': [ 'is missing' ], 'take_profit[steps][2][price][value],take_profit[steps][2][price][percent]': [ 'are missing, exactly one parameter must be provided' ]
@mattguetta I had the same problem. I ended up bashing my head for awhile and somehow copying and pasting directly from https://github.com/3commas-io/3commas-official-api-docs/blob/master/smart_trades_v2_api.md and then modifying worked. It was a lot of trial and error, and I still don't know why it ended up working.
Good luck
@lukelove Thanks for help, yeah that's what I'm trying, but still get those errors, drives me crazy ^^ This output looks the same on your side ?
account_id=XXX&pair=USDT_BTC&position[type]=buy&position[units][value]=0.01&position[order_type]=market&take_profit[enabled]=true&take_profit[steps][0][order_type]=limit&take_profit[steps][0][price][value]=10000&take_profit[steps][0][price][type]=bid&take_profit[steps][0][volume]=10&take_profit[steps][1][order_type]=limit&take_profit[steps][1][price][value]=10500&take_profit[steps][1][price][type]=bid&take_profit[steps][1][volume]=20&take_profit[steps][2][order_type]=limit&take_profit[steps][2][price][value]=11000&take_profit[steps][2][price][type]=bid&take_profit[steps][2][volume]=30&take_profit[steps][3][order_type]=market&take_profit[steps][3][price][value]=11500&take_profit[steps][3][price][type]=bid&take_profit[steps][3][volume]=40&take_profit[steps][3][trailing][enabled]=true&take_profit[steps][3][trailing][percent]=10.5&stop_loss[enabled]=false
ya that's what I remember seeing @mattguetta
Have you seen https://github.com/sgerodes/3commas-postman, this might help test
Did anyone ever find a solution for this issue?
Yep got one, I’ll do my best to post it tomorrow
www.mattguetta.com // @mattguetta
Le 23 mai 2022 à 21:41, J. Brandon Johnson @.***> a écrit :
Did anyone ever find a solution for this issue?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
@mattguetta any luck on finding a solution?
Yep got one, I’ll do my best to post it tomorrow www.mattguetta.com // @mattguetta … Le 23 mai 2022 à 21:41, J. Brandon Johnson @.***> a écrit : Did anyone ever find a solution for this issue? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
Hi, sorry for delay, holydays there ^^ Can't push it on github, please update package with this file: https://www.dropbox.com/t/myGD1DytlXwt2PKR
Your Dropbox upload has expired, what was the solution to this issue @mattguetta?
Hi guys, here is the link to the patched index.js that includes the fix provided by Matt: https://gist.github.com/swizzmagik/44e76af6e006a3b3d8e0864a9ebf197e
I'm trying to place an order using the
/public/api/v2/smart_trades
endpoint with the following parameters:The request results in the following error response:
{"error":"record_invalid","error_description":"Invalid parameters","error_attributes":{"take_profit[steps]":["is invalid"],"take_profit[steps][price][type]":["is missing"],"value,percent":["are missing, exactly one parameter must be provided"]}}
However, as you can see above,
take_profit[steps][price][type]
is actually set. When I settake_profit[enabled]
to false it works but of course the take profit isn't being applied. Is this a bug or am I doing something wrong?