Git Product home page Git Product logo

how_to_build_a_metatrader5_trading_bot_expert_advisor's Introduction

How to Build a MetaTrader 5 Python Trading Bot (Expert Advisor) Series

This is the code for my series How to Build a MetaTrader 5 Python Trading Bot found on Medium @appnologyjames

The five part series covers all you need to get started building your very own Python Trading Bot. Each episode in the series contains working code samples to help you build your own.

Requirements

  • Windows 10 or above endpoint (for whatever reason, MetaTrader doesn't support their Python API on macOS or Linux)
  • MetaTrader 5 (note MetaTrader 4 doesn't have a Python API)
  • A basic knowledge of Python, such as functions and variables
  • Python 3 installed (my build version is 3.10)
  • An IDE (I used JetBrains Pycharm Community Edition)

Episodes

This episode covers everything you need to get started building your Python Trading Bot, including:

  • How to set up your files
  • How to securely import your settings, including username/password
  • How to initialize your project through ___main___
  • Where to find the MetaTrader 5 Python API

This episode shows you how to make and modify trades on MetaTrader 5. It covers:

  • How to enable a trade symbol on MetaTrader 5
  • Placing Trades
  • Canceling an Order
  • Modifying an open position

This episode demonstrates how to break down a strategy into a series of codified steps. By the end of the episode, you can take an untested strategy and implement it in your code. It covers:

  • Setting up a program structure
  • Design considerations
  • Algorithmic decision making
  • Initiating trades based on decisions Note: The algorithm used in this episode is simplistic and not recommended. It is for demonstration purposes only!

Demonstrates how to close the loop on your automated strategy, including:

  • Design considerations for parallel processing, polling method for data
  • Managing order queue
  • Some further improvements to consider

This episode shows you how to implement one of the most requested features I get: a trailing stop. It includes:

  • An overview of a trailing stop
  • Ways to take this code and improve it
  • How to use the modify_position() function to trail a price
  • How update an existing position

how_to_build_a_metatrader5_trading_bot_expert_advisor's People

Contributors

jimtin 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.