GithubHelp home page GithubHelp logo

ogunjobifx / mt4-mt5-forex-signal-copier-telegram-bot Goto Github PK

View Code? Open in Web Editor NEW
100.0 7.0 96.0 23 KB

Telegram bot used for copying and entering signals from signal provider directly to MT4 and MT5 trading accounts with calculated lot sizes and profit/loss display

License: MIT License

Procfile 0.09% Python 99.91%
bot copytrade forex forex-trading forex-trading-bot metaapi metaapi-cloud python render telegram

mt4-mt5-forex-signal-copier-telegram-bot's Introduction

MT4/MT5 FX Signal Copier Telegram Bot ๐Ÿ’ป๐Ÿ’ธ

This Telegram bot allows users to enter trades directly from Telegram and get a detailed look at the risk-to-reward ratio with profit, loss, and calculated lot size. You can change specific settings such as allowed symbols, risk factor, and more from your personalized Python script and environment variables.

The FX Signal Copier Telegram Bot makes use of the MetaAPI cloud forex trading API for MetaTrader 4 or MetaTrader 5 to create a connection to a user's MetaTrader account to gather information such as account balance, open positions, and permissions to enter and close trades. The API works for both live and demo accounts.

Official REST and WebSocket API documentation for MetaAPI: https://metaapi.cloud/docs/client/

This bot is deployed using Render.

Features ๐Ÿ’ก

  • Copy trades directly from Signal providers or personal analysis
  • Interact with MetaAPI to retrieve MT4/MT5 account information (Balance, Equity, Open Positions, etc.)
  • Place all 6 order type trades from Telegram bot (Market Buy/Sell, Limit Buy/Sell, Buy/Sell Stop)
  • Calculate risk-to-reward using stop loss and take profit and display size in pips and profit/loss (USD)
  • Place up to two take profits and use half position size for each to maintain the risk-to-reward ratio
  • Future Features: Trailing stop loss

Demonstration ๐ŸŽฅ

ezgif-4-a2f4e1b1a1

Installation โš’๏ธ

Prerequisites:

I have created a YouTube video where you can view me showcasing how to install and run this bot for your own use.

YouTube Demonstration: (https://youtu.be/oMsuAA9N3U4)

1. Create a Telegram Bot

Start a conversation with @BotFather on Telegram and create a new bot with a unique name. Save the given API token.

2. Navigate to Your Render Dashboard

3. Create a new web service application

4. Scroll down to 'Public Git repository' and paste the following URL

https://github.com/ogunjobiFX/MT4-MT5-Forex-Signal-Copier-Telegram-Bot

5. Set up Render Application

1. Create a unique name for your application, e.g: mt4tradingbot
2. Ensure build command is pip install -r requirements.txt
3. Change start command to: python run.py
4. Select create web service

6. Set Up Application Environment Variables

After creating your web service, navigate to enviornment tab and set the following:

Key Value
PYTHON_VERSION 3.8.2
TOKEN "INSERT TELEGRAM BOT API TOKEN HERE"
APP_URL "https://[INSERT NAME OF APP HERE].onrender.com/"
TELEGRAM_USER "INSERT TELEGRAM USERNAME HERE"
API_KEY "INSERT META API TOKEN HERE" (https://app.metaapi.cloud/token)
ACCOUNT_ID "INSERT META API ACCOUNT ID HERE" (https://app.metaapi.cloud/accounts)
RISK_FACTOR "INSERT PERCENTAGE OF RISK PER TRADE HERE IN DECIMAL FORM, ex: 5% = 0.05"

6. Ensure That App Has Been Deployed

Navigate to events tab and view logs for deployment. Assuming there, are no errors with any of the enviornment variables that you have set, your bot should now be running.

If at any point you decide to make a change to any of the environment variables, all you have to do is navigate to the Render web app and edit the value. After making the change and saving, the application will automatically deploy with the new changes.

Congratulations! ๐Ÿฅณ If you followed these steps correctly, you should now be able to open a conversation with your bot on Telegram and calculate trade risk-to-reward along with placing trades. For help on how to use the bot, send the /help command for bot instructions and example trades.

License ๐Ÿ“

ยฉ 2023 Tosin Ogunjobi. All rights reserved.

Licensed under the MIT license.

mt4-mt5-forex-signal-copier-telegram-bot's People

Contributors

ogunjobifx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mt4-mt5-forex-signal-copier-telegram-bot's Issues

youtube video

The youtube video is private? Can you open it or is not for public anymore

can you add feature to parse signal message by openai api like gpt or chatgpt

because sometime signal provider have different formatting, by using ai parsing should be able solve this,

this is kind of response from chatgpt :

Yes, I can help you parse these trading signals and generate instructions for automated trading using MetaApi.

Firstly, it is important to note that trading signals should be used with caution, as they may not always be accurate or suitable for your trading strategy. It is important to do your own research and analysis before making any trades.

Now, let's parse the examples you provided:

    USD/JPY signal:

    Symbol: USD/JPY
    Action: Buy
    Entry Price: Current market price (not specified)
    Take Profit: 138.8 pips (1.388 - current market price)
    Stop Loss: 120 pips (1.200 - current market price)

Based on this signal, we can generate the following instructions for MetaApi:

can you make the bot parse these signals

XAUUSD BUY 1915
TP 1920
TP 1930
SL 1907

GBPUSD BUY 1.24900
TP 1.25000
TP 1.25300
TP 1.25500
SL 1.24000

US30 BUY 34440
TP 34480
TP 34540
TP 34600
SL 34200

NAS100 BUY 15350
TP 15400
TP 15450
TP 15500
SL 15100

GER30 BUY 15730
TP 15760
TP 15800
TP 15850
TP 16000
SL 15400

XAUUSD BUY 1916
TP 1920
SL OPEN

HELP

There was an issue ๐Ÿ˜•

Error Message:
Trade is disabled

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.