Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#248 Order was not been recorded on grid feature #252

Closed
elvishp2006 opened this issue Jul 30, 2021 · 8 comments
Closed

#248 Order was not been recorded on grid feature #252

elvishp2006 opened this issue Jul 30, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@elvishp2006
Copy link

Version

v0.0.73
(1f01589)

Description

The bot executed two buy grids at binance, but it's showing that was executed only the first one

To Reproduce

Expected Behaviours

Record the executed grids

Screenshots

image
image

Additional context

@elvishp2006 elvishp2006 added the bug Something isn't working label Jul 30, 2021
@elvishp2006 elvishp2006 changed the title [#248] Order was not been recorded on grid feature #248 Order was not been recorded on grid feature Jul 30, 2021
@chrisleekr
Copy link
Owner

I assume you have slack integration. Can you go through and find messages for the order filled at 2021-07-30 06:29:29

What I expect to see is

MATICUSDT Buy Action Grid Trade #2 (xxxx): STOP_LOSS_LIMIT
MATICUSDT Buy Action Grid Trade #2 Result (xxxx): STOP_LOSS_LIMIT
MATICUSDT Action (xxxxx): Confirmed buy order

MATICUSDT BUY Grid Trade #2 Order Filled (xxxx): STOP_LOSS_LIMIT
or
MATICUSDT BUY Grid Trade #2 Order Removed (xxxx): STOP_LOSS_LIMIT




@chrisleekr
Copy link
Owner

Oh wait, your git SHA is different. Were you build from the PR?

Running Version:
v0.0.73
(a7d650b)

@elvishp2006
Copy link
Author

@chrisleekr I have been build the image from master after you release the new version

@elvishp2006
Copy link
Author

MATICUSDT Action (09:28:09.359): Removed last buy price

  • Message: Balance is less than the last buy price remove threshold. Delete last buy price.
    {
     "lastBuyPrice": 1.0183,
     "baseAssetQuantity": 9.9,
     "currentPrice": 1,
     "minNotional": "10.00000000",
     "openOrders": []
    }
  • Current API Usage: 93

MATICUSDT Buy Action Grid Trade #1 (09:28:11.215): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10,
       "stopPrice": 1.00463,
       "price": 1.00473,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 93

MATICUSDT Buy Action Grid Trade #1 Result (09:28:11.711): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891234918,
     "orderListId": -1,
     "clientOrderId": "7SlmGkuemrDkCxKRvrAkjD",
     "transactTime": 1627637291319
    }
  • Current API Usage: 119

MATICUSDT Action (09:28:12.386): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891234918,
       "orderListId": -1,
       "clientOrderId": "7SlmGkuemrDkCxKRvrAkjD",
       "transactTime": 1627637291319
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891234918,
         "orderListId": -1,
         "clientOrderId": "7SlmGkuemrDkCxKRvrAkjD",
         "price": "1.00473000",
         "origQty": "10.00000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00463000",
         "icebergQty": "0.00000000",
         "time": 1627637291319,
         "updateTime": 1627637291319,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 135

MATICUSDT Buy Action Grid Trade #1 (09:28:13.778): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10,
       "stopPrice": 1.00188,
       "price": 1.00198,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 146

MATICUSDT Buy Action Grid Trade #1 Result (09:28:14.256): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891235850,
     "orderListId": -1,
     "clientOrderId": "38B7vEgZ3iR1DuJ4ZtOiUS",
     "transactTime": 1627637293861
    }
  • Current API Usage: 170

MATICUSDT Action (09:28:15.400): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891235850,
       "orderListId": -1,
       "clientOrderId": "38B7vEgZ3iR1DuJ4ZtOiUS",
       "transactTime": 1627637293861
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891235850,
         "orderListId": -1,
         "clientOrderId": "38B7vEgZ3iR1DuJ4ZtOiUS",
         "price": "1.00198000",
         "origQty": "10.00000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00188000",
         "icebergQty": "0.00000000",
         "time": 1627637293861,
         "updateTime": 1627637293861,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 188

MATICUSDT Buy Action Grid Trade #1 (09:28:17.492): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10,
       "stopPrice": 1.00138,
       "price": 1.00148,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 199

MATICUSDT Buy Action Grid Trade #1 Result (09:28:17.972): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891236443,
     "orderListId": -1,
     "clientOrderId": "e89h8UFU4GdtE1uzUiaTYL",
     "transactTime": 1627637297576
    }
  • Current API Usage: 213

MATICUSDT Action (09:28:18.398): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891236443,
       "orderListId": -1,
       "clientOrderId": "e89h8UFU4GdtE1uzUiaTYL",
       "transactTime": 1627637297576
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891236443,
         "orderListId": -1,
         "clientOrderId": "e89h8UFU4GdtE1uzUiaTYL",
         "price": "1.00148000",
         "origQty": "10.00000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00138000",
         "icebergQty": "0.00000000",
         "time": 1627637297576,
         "updateTime": 1627637297576,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 226

MATICUSDT Buy Action Grid Trade #1 (09:29:15.493): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10,
       "stopPrice": 1.001,
       "price": 1.00109,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 146

MATICUSDT Buy Action Grid Trade #1 Result (09:29:15.975): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891241913,
     "orderListId": -1,
     "clientOrderId": "YCXHO7rtZ3U4FmbzNsPZNm",
     "transactTime": 1627637355584
    }
  • Current API Usage: 164

MATICUSDT Action (09:29:16.433): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891241913,
       "orderListId": -1,
       "clientOrderId": "YCXHO7rtZ3U4FmbzNsPZNm",
       "transactTime": 1627637355584
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891241913,
         "orderListId": -1,
         "clientOrderId": "YCXHO7rtZ3U4FmbzNsPZNm",
         "price": "1.00109000",
         "origQty": "10.00000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00100000",
         "icebergQty": "0.00000000",
         "time": 1627637355584,
         "updateTime": 1627637355584,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 187

MATICUSDT Buy Action Grid Trade #1 (09:29:25.484): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10.1,
       "stopPrice": 1.00038,
       "price": 1.00048,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 303

MATICUSDT Buy Action Grid Trade #1 Result (09:29:26.283): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891242668,
     "orderListId": -1,
     "clientOrderId": "GvXpmICcjzQAaHrzuQ2UNT",
     "transactTime": 1627637365571
    }
  • Current API Usage: 322

MATICUSDT Action (09:29:27.392): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891242668,
       "orderListId": -1,
       "clientOrderId": "GvXpmICcjzQAaHrzuQ2UNT",
       "transactTime": 1627637365571
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891242668,
         "orderListId": -1,
         "clientOrderId": "GvXpmICcjzQAaHrzuQ2UNT",
         "price": "1.00048000",
         "origQty": "10.10000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00038000",
         "icebergQty": "0.00000000",
         "time": 1627637365571,
         "updateTime": 1627637365571,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 335

MATICUSDT Buy Action Grid Trade #1 (09:29:29.541): STOP_LOSS_LIMIT

  • Order Params:
    {
     "orderParams": {
       "symbol": "MATICUSDT",
       "side": "buy",
       "type": "STOP_LOSS_LIMIT",
       "quantity": 10.1,
       "stopPrice": 1.00013,
       "price": 1.00023,
       "timeInForce": "GTC"
     }
    }
  • Current API Usage: 346

MATICUSDT Buy Action Grid Trade #1 Result (09:29:30.303): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891243144,
     "orderListId": -1,
     "clientOrderId": "vxpsqeWMXmD5VC28rah9jF",
     "transactTime": 1627637369628
    }
  • Current API Usage: 370

MATICUSDT Action (09:29:31.401): Confirmed buy order

  • Message: The buy order found in the open orders.
    {
     "lastBuyOrder": {
       "symbol": "MATICUSDT",
       "orderId": 891243144,
       "orderListId": -1,
       "clientOrderId": "vxpsqeWMXmD5VC28rah9jF",
       "transactTime": 1627637369628
     },
     "openOrders": [
       {
         "symbol": "MATICUSDT",
         "orderId": 891243144,
         "orderListId": -1,
         "clientOrderId": "vxpsqeWMXmD5VC28rah9jF",
         "price": "1.00023000",
         "origQty": "10.10000000",
         "executedQty": "0.00000000",
         "cummulativeQuoteQty": "0.00000000",
         "status": "NEW",
         "timeInForce": "GTC",
         "type": "STOP_LOSS_LIMIT",
         "side": "BUY",
         "stopPrice": "1.00013000",
         "icebergQty": "0.00000000",
         "time": 1627637369628,
         "updateTime": 1627637369628,
         "isWorking": false,
         "origQuoteOrderQty": "0.00000000"
       }
     ]
    }
  • Current API Usage: 388

MATICUSDT Last buy price Updated (09:30:35.267): STOP_LOSS_LIMIT

  • Order Result:
    {
     "orgLastBuyPrice": 0,
     "orgQuantity": 0,
     "orgTotalAmount": 0,
     "newLastBuyPrice": 1.00017,
     "newQuantity": 10.1,
     "newTotalAmount": 10.101717
    }
  • Current API Usage: 213

MATICUSDT BUY Grid Trade #1 Order Filled (09:30:35.282): STOP_LOSS_LIMIT

  • Order Result:
    {
     "symbol": "MATICUSDT",
     "orderId": 891243144,
     "orderListId": -1,
     "clientOrderId": "vxpsqeWMXmD5VC28rah9jF",
     "price": "1.00023000",
     "origQty": "10.10000000",
     "executedQty": "10.10000000",
     "cummulativeQuoteQty": "10.10171700",
     "status": "FILLED",
     "timeInForce": "GTC",
     "type": "STOP_LOSS_LIMIT",
     "side": "BUY",
     "stopPrice": "1.00013000",
     "icebergQty": "0.00000000",
     "time": 1627637369628,
     "updateTime": 1627637429922,
     "isWorking": true,
     "origQuoteOrderQty": "0.00000000"
    }
  • Current API Usage: 213

@chrisleekr
Copy link
Owner

Ok from the Slack message, I can see the order filled at 06:29:29 is not grid trade #2, it was grid trade #1.

Now the question is why... ah, I got it.

MATICUSDT Action (09:28:09.359): Removed last buy price

Message: Balance is less than the last buy price remove threshold. Delete last buy price.
{
 "lastBuyPrice": 1.0183,
 "baseAssetQuantity": 9.9,
 "currentPrice": 1,
 "minNotional": "10.00000000",
 "openOrders": []
}
Current API Usage: 93

When remove the last buy price, it removes previous grid trade history.

Now, since you only trade $10 worth, the bot will remove the last buy price if it is not worth more than $10.

To prevent that, set the last buy price removal threshold to like 5

image

If you set that, even if the coin is not worth the minimum notional value, it won't remove the last buy price.

@elvishp2006
Copy link
Author

Thanks @chrisleekr, I will set a lower value for this field :)

@chrisleekr
Copy link
Owner

chrisleekr commented Jul 30, 2021

Thanks to @pedrohusky who developed this feature!

Close the issue if your issue is resolved!

@elvishp2006
Copy link
Author

Thanks also @pedrohusky :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants