stav / kingbot

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

Order analysis tool #19

Open stav opened 2 years ago

stav commented 2 years ago

Use the log files to figure out what happened to a particular order.

Example

Say we have this message in the logs:

2022-04-20 13:34:52 UTC ERROR { "customTag":"0.6548979425131982", "errorCode":"Invalid price" }

We would like to know what order this message applied to and what events took place for it.

Looking at the main log file kingbot.log for that customTag:

2022-04-20 13:34:52 UTC INFO Sending {...order: 377725515,... customTag: "0.6548979425131982" }
2022-04-20 13:34:52 UTC ERROR {...,"customTag":"0.6548979425131982",..."errorDescr":"Invalid price"}
2022-04-20 13:34:52 UTC INFO setFamilyStoploss: response {errorDescr: "Invalid price"}

We can see from the last line above our error has something to do with setFamilyStoploss.

Tool

We need a tool that can look thru this (and other corresponding) log files to determine the life cycle and event list of what happened to order 377725515 so we can figure out what caused the error.

stav commented 2 years ago

Order tool being written in Rust 4372f73c310bdddec3226454e5431c1efdc193a9

Examples here

stav commented 2 years ago

Previous example of analysis of an order: #12

stav commented 2 years ago

The Rust tool is getting amazing!

https://github.com/stav/kingbot/tree/rust/tools