Skip to content

vishnugovind10/emacrossover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

VWAP and EMA-based Crypto Trading Bot

Introduction

Welcome to the VWAP and EMA-based Crypto Trading Bot repository! This bot combines the power of the Volume Weighted Average Price (VWAP) indicator and Exponential Moving Averages (EMA) crossovers to help traders make informed trading decisions in the cryptocurrency markets.

Features

  • EMA Crossovers: Identify potential trend changes and generate buy/sell signals based on EMA crossovers.
  • VWAP Indicator: Leverage the VWAP indicator to determine entry and exit points in shorter time frames.
  • Risk Management: Implement stop loss, take profit, and trailing stop loss strategies for risk mitigation.
  • Customizable Parameters: Adjust various parameters to suit your trading strategy.

Key Concepts

Exponential Moving Averages (EMA)

  • Short and Long EMAs: Calculate EMAs with different look-back periods to capture short-term and long-term trends.
  • Crossovers: EMA crossovers signal potential trend reversals, guiding buy and sell decisions.

Volume Weighted Average Price (VWAP)

  • Entry and Exit Points: Utilize VWAP for accurate entry and exit timing, particularly in shorter time frames.
  • Overbought and Oversold Conditions: Identify market conditions using VWAP to determine overbought and oversold levels.

Risk Management

  • Stop Loss: Set up automatic sell orders at a specified percentage below the entry price to limit potential losses.
  • Take Profit: Automate selling at a percentage above the entry price to secure profits.
  • Trailing Stop Loss: Dynamically adjust the sell price upward as the price increases, protecting gains.

How the Algorithm Works

Buy Signals

  1. Fetch historical price data for the selected cryptocurrency.
  2. Calculate short and long EMAs for trend analysis.
  3. Compute VWAP to analyze volume-weighted price trends.
  4. Generate a buy signal if short EMA crosses above long EMA and current price is below VWAP.
  5. Place a market buy order with a user-defined buy amount.
  6. Implement stop loss and take profit orders for risk management.

Sell Signals

  1. Fetch recent price data and calculate relevant indicators.
  2. Generate a sell signal if short EMA crosses below long EMA and current price is above VWAP.
  3. Cancel any open sell orders to ensure risk management.
  4. If the cryptocurrency is owned, execute a market sell order to close the position.

Usage and Configuration

  1. Clone this repository to your local machine.
  2. Install required dependencies using pip install ccxt numpy pandas.
  3. Set your Binance API credentials in the provided code.
  4. Customize trading parameters based on your strategy.
  5. Run the script.

Disclaimer

  • This trading bot is for educational purposes only and should not be considered financial advice.
  • Use this code at your own risk. Cryptocurrency trading involves substantial risk, and potential losses can exceed deposits.

Contribution

Contributions, improvements, and bug fixes are welcome! Feel free to open pull requests.

About

EMA-VWAP crossover trading strategy in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages