stav / kingbot

Deno CLI trading robot
https://stav.github.io/kingbot/
2 stars 0 forks source link

Break-even not working #17

Closed stav closed 2 years ago

stav commented 2 years ago
2022-03-28 22:05:00 UTC INFO [default] check 8 "trades in total"
2022-03-28 22:05:00 UTC INFO [default] check 6 "family of" "US30"
2022-03-28 22:05:00 UTC INFO [default] Updating stop loss for 6 "orders"
2022-03-28 22:05:00 UTC INFO [default] STOP LOSS: 34870 "=" 34880 "+" -10.463999999999999
2022-03-28 22:05:00 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:00 UTC INFO [default] check 8 "trades in total"
2022-03-28 22:05:00 UTC INFO [default] check 6 "family of" "US30"
2022-03-28 22:05:00 UTC INFO [default] Updating stop loss for 6 "orders"
2022-03-28 22:05:00 UTC INFO [default] STOP LOSS: 34870 "=" 34880 "+" -10.463999999999999
2022-03-28 22:05:00 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:00 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.6744786141599206",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:00 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:01 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.304496235653674",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:01 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:01 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.8421582238771113",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:01 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:01 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.9899584534750738",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:01 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:01 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.2522870797833092",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:01 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:01 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.9603172876796604",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:01 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:02 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.7866592985235608",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:02 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:02 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.01855817086105871",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:02 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:02 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.4382449079167623",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:02 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:02 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.5320570453844948",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:02 UTC ERROR [default] setFamilyStoploss: transaction
2022-03-28 22:05:02 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.11285434890359203",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
2022-03-28 22:05:03 UTC DEBUG [default] setFamilyStoploss: response {
  status: false,
  customTag: "0.9905702365916691",
  errorCode: "BE4004",
  errorDescr: "Invalid price"
}
stav commented 2 years ago
2022-05-05 16:35:44 UTC INFO [default] Sending {
  command: "tradeTransaction",
  arguments: {
    tradeTransInfo: {
      price: undefined,
      cmd: 1,
      order: 383119357,
      offset: 0,
      symbol: "ETHEREUM",
      customComment: null,
      volume: 0.5,
      sl: 2799.3,
      tp: 0,
      expiration: null,
      position: 383119357,
      type: 3
    }
  },
  customTag: "0.9542951505269972"
}
{"status":false,"customTag":"0.9542951505269972","errorCode":"BE4004","errorDescr":"Invalid price"}
2022-05-05 16:36:51 UTC WARNING [default] Closing XApi Socket { id: 13372997, name: "Thomas Duna (Stav#6)", type: "demo" }
stav commented 2 years ago

So I added some random price field and now it's working:

2022-05-07 15:46:05 UTC INFO [default] check1: 27 open trades in total
2022-05-07 15:46:05 UTC INFO [default] check2: 2 in family of DOGECOIN
2022-05-07 15:46:05 UTC INFO [default] STOP LOSS: 0.12983 = 0.12979 + 0.00003893699999999999
2022-05-07 15:46:05 UTC INFO [default] Updating stop loss to 0.12983 for 2 orders
2022-05-07 15:46:05 UTC INFO [default] Sending {
  command: "tradeTransaction",
  arguments: {
    tradeTransInfo: {
      price: 0.12979,
      cmd: 0,
      order: 383713573,
      offset: 0,
      symbol: "DOGECOIN",
      volume: 1000,
      sl: 0.12983,
      tp: 0.13057,
      type: 3
    }
  },
  customTag: "0.5472523318809723"
}
2022-05-07 15:46:05 UTC INFO [default] Message '{"status":true,"returnData":{"order":383713573},"customTag":"0.5472523318809723"}'
stav commented 2 years ago

Analysis in #20

stav commented 2 years ago

Closed with 79ee50c626ad05ac0460127112e00f5d9b550250