Skip to content

SoorajR-ai/Algo_Trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Algo Trader Bot

This project implements an Exponential Moving Average (EMA) crossover trading strategy using Python. The bot fetches historical stock data, calculates EMA crossovers, and logs trades into an Excel file.

Features

  • Retrieves historical stock data using the Yahoo Finance API.
  • Calculates short-term and long-term EMAs.
  • Identifies EMA crossovers for trade signals.
  • Logs trade details to an Excel file without overwriting previous data.

Prerequisites

  • Python 3.7 or higher
  • yfinance library
  • pandas library
  • numpy library

Installation

  1. Clone the repository:
    git clone https://github.com/SoorajR-ai/Algo_Trader.git
  2. Install the required dependencies:
    pip install yfinance pandas numpy

Usage

Run the trading bot script:

python trading_bot.py

The bot will fetch stock data, calculate EMA crossovers, and log trades to trading_log.xlsx.

Code Overview

The main script, trading_bot.py, contains the following key functions:

  • calculate_ema_angle(ema_series): Calculates the angle of an EMA line.
  • main(): Main loop for running the strategy.
  • EMA_cross_scanner(stock, index): Scans for EMA crossovers and logs trades.
  • write_to_excel(): Writes the trade log to an Excel file.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or issues, please open an issue in the GitHub repository>your.email@example.com.

About

Just a python program to test simple trading statergies in realtime market

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages