Giter Club home page Giter Club logo

momentum_trading_bot's Introduction

Momentum Trading Bot

License

Table Of Content

GitHub repo size

GitHub top language

Description

The Momentum Trading Bot is a Python-based bot that identifies and trades assets with strong price momentum. It uses Pandas and NumPy for data analysis, the Interactive Brokers API for trading, and Yahoo Finance for historical data. API keys are securely stored in a .env file.

Momentum Trading Bot
Momentum Trading Bot

Installation

  1. Clone the Repository

git clone https://github.com/blockchaincyberpunk1/momentum_trading_bot.git cd momentum_trading_bot

  1. Create a Virtual Environment (Optional but recommended)

python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate

  1. Install Required Libraries

pip install -r requirements.txt

  1. Secure Your API Keys

Create a .env file in the project directory and add your API keys as follows:

IB_API_KEY=your_ib_api_key YAHOO_FINANCE_API_KEY=your_yahoo_finance_api_key

  1. Fetch Historical Data

Create a function to fetch historical data using Yahoo Finance and save it to data/historical_data.csv. Adapt and include this function in your code.

  1. Implement Momentum Strategy

Create and implement a momentum trading strategy in strategies/momentum_strategy.py.

  1. Interactive Brokers Integration

Use the ib_insync library to interact with the Interactive Brokers API. Include this functionality in utils/ib_api_utils.py.

  1. Run the Bot

In main.py, include the main logic for your trading bot. Fetch historical data, apply the momentum strategy, and execute trades.

python main.py

Momentum Trading Bot is built with the following tools and libraries:

  • Interactive Brokers API: Allows for real-time trading and interaction with financial markets.
  • Yahoo Finance API: Used to fetch historical price data for various assets.
  • Python-decouple: Used to securely store and retrieve API keys from a .env file.
  • ib-insync: A Python library for interactive trading with Interactive Brokers.

Usage

Run the bot using the provided instructions. It will identify assets with strong price momentum and execute trades accordingly.

Contribution

Contributions to this project are welcome! If you would like to contribute, feel free to open issues, submit pull requests, or make suggestions for improvements.

Tests

Test the bot's functionality by running it with historical data and verifying that it correctly identifies and trades assets with strong momentum.

GitHub

blockchaincyberpunk1

Visit my website: The Polyglot

Contact

Feel free to reach out to me on my email: [email protected]

License

License

momentum_trading_bot's People

Contributors

blockchaincyberpunk1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.