Skip to content

Aten2004/Trading-Journal

Repository files navigation

📈 Trading Journal Web Application

เว็บแอปพลิเคชันสำหรับบันทึกและวิเคราะห์การเทรด (Trading Journal) พัฒนาด้วย Next.js โดยเน้นความเรียบง่ายและใช้งานฟรีด้วยการใช้ Google Sheets เป็นฐานข้อมูล (Database)

✨ ฟีเจอร์หลัก (Features)

  • 📝 บันทึกการเทรด (Trade Recording):

    • รองรับการกรอกข้อมูลอย่าง สินทรัพย์ (Symbol), ราคาเข้า/ออก (Entry/Exit), SL/TP, ขนาดสัญญา (Position Size)
    • คำนวณกำไร/ขาดทุน (PnL), % การเติบโต, Risk:Reward (R:R), และระยะเวลาถือออเดอร์ให้อัตโนมัติ
    • บันทึกด้านจิตวิทยา (Emotion) และข้อผิดพลาด (Mistake) เพื่อนำมาวิเคราะห์ทีหลัง
  • 📊 แดชบอร์ดวิเคราะห์ผลงาน (Dashboard Analytics):

    • สรุปสถิติสำคัญ: Win Rate, Profit Factor, Max Drawdown, Average R:R
    • กราฟเส้นแสดงผลประกอบการและช่วงเวลาทำกำไร (Time Analysis Chart)
    • ตารางสรุปผลงานแยกตามกลยุทธ์ (Strategy Breakdown) เพื่อหาท่าไม้ตายที่ดีที่สุด
  • 🧠 Trading Insights (ระบบวิเคราะห์พฤติกรรม):

    • วิเคราะห์จุดแข็ง/จุดอ่อน และแจ้งเตือนพฤติกรรมเสี่ยง (Red Flags) เช่น การเทรดแก้แค้น (Revenge Trading), การไม่ตั้ง SL, หรือการเปลี่ยนกลยุทธ์บ่อยเกินไป
  • 💾 Database & Export:

    • เชื่อมต่อข้อมูลกับ Google Sheets โดยตรง ทำให้ข้อมูลปลอดภัยและเข้าถึงได้ง่าย
    • รองรับการ Export ข้อมูลประวัติการเทรดออกมาเป็นไฟล์ Excel (.xlsx)
  • 🌐 ระบบอื่นๆ:

    • รองรับ 2 ภาษา (ไทย / อังกฤษ)
    • ระบบสมาชิก (Login/Register) เก็บข้อมูลแยกราย User

🛠️ เทคโนโลยีที่ใช้ (Tech Stack)

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Database: Google Sheets (ผ่าน google-spreadsheet API)
  • Charts: Recharts
  • Authentication: Custom Auth (bcryptjs + JWT logic)

⚙️ การติดตั้งและใช้งาน (Installation)

  1. Clone โปรเจกต์:

    git clone [https://github.com/your-username/trading-journal.git](https://github.com/your-username/trading-journal.git)
    cd trading-journal
  2. ติดตั้ง Dependencies:

    npm install
  3. ตั้งค่า Environment Variables: สร้างไฟล์ .env.local ที่ root directory และใส่ค่า Config ของ Google Service Account ดังนี้:

    GOOGLE_SERVICE_ACCOUNT_EMAIL=your-service-account-email
    GOOGLE_PRIVATE_KEY="your-private-key"
    GOOGLE_SHEETS_ID=your-google-sheet-id

    (ต้องเปิดสิทธิ์ Google Sheet ให้ Service Account Email สามารถ Editor ได้)

  4. รันโปรเจกต์:

    npm run dev

    เปิด Browser ไปที่ http://localhost:3000


พัฒนาโดย ภูริต เฟื่องฟู


📈 Trading Journal Web Application

A web application for recording and analyzing trades (Trading Journal) developed with Next.js, focusing on simplicity and free usage by utilizing Google Sheets as a database.

✨ Key Features

  • 📝 Trade Recording:

    • Supports comprehensive data entry including Symbol, Entry/Exit Price, SL/TP, and Position Size.
    • Automatically calculates Profit/Loss (PnL), Growth %, Risk:Reward (R:R), and Holding Time.
    • Records Psychology (Emotion) and Mistakes for later analysis.
  • 📊 Dashboard Analytics:

    • Summarizes key statistics: Win Rate, Profit Factor, Max Drawdown, and Average R:R.
    • Line chart showing performance and profitability over time (Time Analysis Chart).
    • Performance summary table broken down by strategy (Strategy Breakdown) to identify your best-performing strategies.
  • 🧠 Trading Insights (Behavioral Analysis):

    • Analyzes strengths/weaknesses and alerts on risky behaviors (Red Flags) such as Revenge Trading, missing Stop Loss, or frequent strategy hopping.
  • 💾 Database & Export:

    • Connects directly to Google Sheets, ensuring data safety and easy accessibility.
    • Supports exporting trade history as an Excel file (.xlsx).
  • 🌐 Other Systems:

    • Supports 2 languages (Thai / English).
    • User Authentication system (Login/Register) to manage data separately for each user.

🛠️ Tech Stack

  • Framework: Next.js 16 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Database: Google Sheets (via google-spreadsheet API)
  • Charts: Recharts
  • Authentication: Custom Auth (bcryptjs + JWT logic)

⚙️ Installation and Usage

  1. Clone the project:

    git clone [https://github.com/your-username/trading-journal.git](https://github.com/your-username/trading-journal.git)
    cd trading-journal
  2. Install Dependencies:

    npm install
  3. Setup Environment Variables: Create a .env.local file at the root directory and add your Google Service Account Config as follows:

    GOOGLE_SERVICE_ACCOUNT_EMAIL=your-service-account-email
    GOOGLE_PRIVATE_KEY="your-private-key"
    GOOGLE_SHEETS_ID=your-google-sheet-id

    (Note: You must grant Editor access to the Service Account Email on your Google Sheet)

  4. Run the project:

    npm run dev

    Open your browser and navigate to http://localhost:3000


Developed by Phurit Fuengfu

Releases

No releases published

Packages

 
 
 

Contributors

Languages