MetaTrader 5 live trading with Python in 2021 (Template included)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
changing 10 lines of code you can  put your own algorithm in production hi smart traders it's lucas from control in this  video i will show you how to put your strategy in   live trading using metatrader5 and python let's  get started welcome to this channel where we help   data scientists and traders to customize their  trading strategies to increase the profitability   there is a new video each monday and each  friday so if you like our work don't hesitate   to subscribe and like the video for the next  video i think it will be great to explain   all the process of an algorithmic training project  so tell me in the comments if you also want to   or if you want another video this video  aims to give you a template and show you   how our code works to give you the possibility to  customize it depending on your name i've created   a class containing function exactly like a  library to put your strategy in live freely let me show you the first function which will  allow us to get the stock price directly from   our worker the most important function is  the initialize function for metatrader file   because it is this function that establish the  connection between the python sheet and your   metatrader5 platform it is essential to understand  that the metatrader5 python library is not an api   but just a library that can control the  metatrader5 platform from your python sheet   then we'll start the current  date using the datetime library   and we use the copyrange from function to  import the data it demands as input the   symbol for example eur usd and it's necessary  to have the symbol into your market watch   the time frame for example mt5 point  time frame d1 which is the daily interval   the date from which we will take n previous  data for example the first january 2021   it means that we take end data before the 1st  january 2021 and n which is the number of data   that we want to import for example 3500 before  returning the data it's necessary to transform   the tuple rates into a data frame then  transform the dates into a date format   and specify the format of the date  and we set the time columns as index now let me show you the order  function this function has 4 forward   open a by contract close a by contract open  a sell contract or close a sell contract   in parameters we need to specify the symbol the  volume if it is a buy or a sell position so if bar   is true it means that we will work on i contract  and if buy is false we work on a sell contract   and the id of the position if you want to close  it if id position is equal to none it means that   we open a contract and if id position is a  position id it means to close this position   this function is decomposed in three main parts  the initialization of the necessary variable   as price etc and the feeding mode i just want  to do a focus on this variable because it is   the most unknown there are three values for  a filling mod and the correct filling mode   depends on the asset so we need to extract  it for each asset send an open trade   if id position is equal to none and there are two  possibilities open a buy or a sell contract so   depending on the order we need to put the correct  stop loss and take profit and send a close order   if id position is equal to a current  position id and for each case we always   take the return of the request because it  is very informative if we have some issues now let's talk about the  resume function this function   is not really complicated but  it's probably the most useful   indeed is mandatory to have such a function  in your toolbox because it allow us to have   all the current open position even if the python  sheet shuts down for any reason it means that   this function will enable us to have access to  the position any time to close them eventually this function fits an algorithm that opens a  position with a fixed interval and does not use a   momentum strategy it means that each day we create  a signal and we verify if the previous contracts   if there is ones isn't in the same way before  opening a position because we don't want to have   item leverage there are a lot of comments  in this function because it's this function   that will return all the information about  our algorithm this function is also very   simple but so essential indeed if you have  any difficulties dopes or anything you have   the possibility to close all the positions  and eventually to automatize this process now let me show you a little template and how to  use it very easily you just need to change one   function in all the code giving us the buy and  the sell signal depending on your own strategy   you can also change the symbol that you want to  trade and the volume then you can run the code   and see your orders on the metatrader5 platform  it means that by changing 10 lines of code you   can put your own algorithm in production before  we finish this video you need to make sure that   you have a windows device to use the metatrader  5 item library if you have a mac let me show you   some possibilities to have access to a windows  device first you can install an application like   parallel desktop this application allows  you to emulate a windows desktop on your mac   you can install windows on your mac  in another session using bootcamp or   you can also use a bps but vps is more used  for live trading production not development
Info
Channel: Quantreo
Views: 1,624
Rating: undefined out of 5
Keywords: metatrader 5 live trading, metatrader 5 python integration, MetaTrader 5 live trading with Python, algorithmic trading python, metatrader 5, metatrader 5 tutorial for beginners, metatrader 5 algorithmic trading, algorithmic trading strategy, quantreo, MetaTrader 5 live trading with Python in 2021, forex trading, forex metatrader 5, crypto metatrader 5, live trading forex metatrader 5, live trading tutorial, live trading
Id: 4F5irQE5D5I
Channel Id: undefined
Length: 7min 22sec (442 seconds)
Published: Fri Nov 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.