A Node.js script to parse, format, and enhance the readability of raw json log files and png images generated by a trading bot's activity.
Trading bots can produce large volumes of log data that are difficult to parse manually. This script provides a simple and effective way to process those raw logs and transform them into a structured, human-readable format. It can extract key decisions like trade entry, zone cancellation, and status updates, making it easier to analyze the bot's performance and troubleshoot issues to optimize performance.
- Log Parsing: Ingests raw text-based json log files and png files outputted by a trading bot.
- Data Extraction: Pulls out important information such as timestamps, trade details (buy/sell orders, price, volume), errors, and performance metrics.
- Visual Outputs: Formats the extracted data into clean, organized png files that combine json log data and trading chart images into one organized visual for analysis.
- Flexible Input: Process log files from multiple folders at once.
- Date Range Filtering: Generate reports for a specific period by providing start and end dates.
- Clone this repository or download the source code.
- Navigate to the project directory:
cd "Trading Bot Log Formatting Script"
- Install the dependencies:
npm install
Note: This project uses the
sharp
library for image processing. Thenpm install
command will attempt to download a pre-compiled binary for your platform. If this fails, you may need to install additional system-level dependencies. Please see the sharp installation documentation for troubleshooting.
You can run the script from your terminal by first navigating to the project's main directory where the script is present, then execute the following commands:
# Example: Process a log file and print formatted output to the console
node process_logs.js <START DATE> <END DATE> <DATA FOLDER TO PROCESS 1> <DATA FOLDER TO PROCESS 2> ...
(Note: The command-line arguments above are examples. You may need to adjust them based on the actual implementation.)
Configuration options, such as log parsing rules or output formats, can be adjusted within the script files. See the source code for more details on customization.
Contributions are welcome! If you have ideas for new features or improvements, feel free to open an issue to discuss it or submit a pull request.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
This project is unlicensed. Please choose a license if you plan to share it.