Skip to content

CRG9/Trading-Bot-Log-Formatting-Script

Repository files navigation

Trading Bot Log Formatting Script

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.

Description

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.

Features

  • 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.

Prerequisites

  • Node.js (version 18.x or higher recommended)
  • npm (comes with Node.js)

Installation

  1. Clone this repository or download the source code.
  2. Navigate to the project directory:
    cd "Trading Bot Log Formatting Script"
  3. Install the dependencies:
    npm install

    Note: This project uses the sharp library for image processing. The npm 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.

Usage

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

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.

Contributing

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.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

License

This project is unlicensed. Please choose a license if you plan to share it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published