Hi there,
I got this error msg:
Coinbase Pro: order create error: ["HTTP 400 Error: Invalid order_type stop
As I read in the api doc, there ist no stop order in CB Pro. See: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
Furthermore there are stop-loss and stop-entry flags, which are not included in the submittet order-post.
I'm wondering if the marked part in the coinbase_pro.js could easily be redirected to to another type....
let orderType;
switch (ordType) {
case 'limit':
orderType = ExchangeOrder.TYPE_LIMIT;
break;
case 'stop':
orderType = ExchangeOrder.TYPE_STOP;
break;
case 'market':
orderType = ExchangeOrder.TYPE_MARKET;
break;
case 'stoplimit':
orderType = ExchangeOrder.TYPE_STOP_LIMIT;
break;
default:
orderType = ExchangeOrder.TYPE_UNKNOWN;
break;
}
... or if it's just necessary to cut out this marked part, as there are just no stop orders in CB Pro:
let orderType;
const originOrderType = order.getType();
if (!originOrderType || originOrderType === 'limit') {
orderType = 'limit';
} else if (originOrderType === 'stop') {
orderType = 'stop';
} else if (originOrderType === 'market') {
orderType = 'market';
}
But on the other hand, there is a reason for the bot to choose the stop-order-type. If there are no stop-orders, the possibility of choosing stop-orders should be deleted from the choosing-type-process in the code, as simple manipulation as mentioned above would lead to a possible WIN or LOSS which would be connected to the chosen stop-order afterwards.
I am not quite sure how to handle this, maybe I am mistaking my problem from the very beginning.
I'm appreaciating any answer. Thanks!
Cheerio
Robin
Hi there,
I got this error msg:
Coinbase Pro: order create error: ["HTTP 400 Error: Invalid order_type stop
As I read in the api doc, there ist no stop order in CB Pro. See: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
Furthermore there are stop-loss and stop-entry flags, which are not included in the submittet order-post.
I'm wondering if the marked part in the coinbase_pro.js could easily be redirected to to another type....
let orderType;
switch (ordType) {
case 'limit':
orderType = ExchangeOrder.TYPE_LIMIT;
break;
case 'stop':
orderType = ExchangeOrder.TYPE_STOP;
break;
case 'market':
orderType = ExchangeOrder.TYPE_MARKET;
break;
case 'stoplimit':
orderType = ExchangeOrder.TYPE_STOP_LIMIT;
break;
default:
orderType = ExchangeOrder.TYPE_UNKNOWN;
break;
}
... or if it's just necessary to cut out this marked part, as there are just no stop orders in CB Pro:
let orderType;
const originOrderType = order.getType();
if (!originOrderType || originOrderType === 'limit') {
orderType = 'limit';
} else if (originOrderType === 'stop') {
orderType = 'stop';
} else if (originOrderType === 'market') {
orderType = 'market';
}
But on the other hand, there is a reason for the bot to choose the stop-order-type. If there are no stop-orders, the possibility of choosing stop-orders should be deleted from the choosing-type-process in the code, as simple manipulation as mentioned above would lead to a possible WIN or LOSS which would be connected to the chosen stop-order afterwards.
I am not quite sure how to handle this, maybe I am mistaking my problem from the very beginning.
I'm appreaciating any answer. Thanks!
Cheerio
Robin