Something Interesting in Financial Video - page 28

 

Caltech's Machine Learning Course - CS 156. Lecture 18 - Epilogue

Forum on trading, automated trading systems and testing trading strategies

Machine Learning and Neural Networks

MetaQuotes, 2023.04.07 12:37

Caltech's Machine Learning Course - CS 156 by Professor Yaser Abu-Mostafa




Caltech's Machine Learning Course - CS 156. Lecture 18 - Epilogue

In this final lecture of the course, the Professor Yaser Abu-Mostafa summarizes the diverse field of machine learning, covering theories, techniques, and paradigms. He discusses important models and methods such as linear models, neural networks, support vector machines, kernel methods, and Bayesian learning. The speaker explains the advantages and disadvantages of Bayesian learning, cautioning that prior assumptions must be valid or irrelevant for the approach to be valuable. He also discusses aggregation methods, including "after the fact" and "before the fact" aggregation, and specifically covers the AdaBoost algorithm. Finally, the speaker acknowledges those who have contributed to the course and encourages his students to continue learning and exploring the diverse field of machine learning.

The second part discusses the potential benefits of negative weights in a machine learning algorithm's solution and shares a practical problem he faced in measuring the value of a hypothesis in a competition. He also expresses gratitude towards his colleagues and the course staff, particularly Carlos Gonzalez, and acknowledges the supporters who made the course possible and free for anyone to take. Abu-Mostafa dedicates the course to his best friend and hopes that it has been a valuable learning experience for all participants.

  • 00:00:00 In this section, Abu-Mostafa talks about the big picture of machine learning and how it is a diverse field with a variety of theories, techniques, and practical applications. He acknowledges that reading two books on machine learning could make it seem like you are reading about two completely different subjects. He also briefly discusses two important topics in machine learning, but not in technical detail, to give his students a head start if they decide to pursue those topics. Finally, he takes the time to acknowledge the people who have contributed greatly to the course.

  • 00:05:00 In this section, the speaker reflects on the fundamentals of machine learning covered in the course, and acknowledges that being complete is fatal. He covers the three key areas: theories, techniques and paradigms. Theory is mathematical modeling of reality to arrive at results not otherwise obvious. The biggest pitfall of theory is making assumptions which divorced from practice, so he chose a theory relevant to practice. Techniques are the bulk of ML and are categorized into two sets: supervised learning, which is the most popular and useful, and unsupervised learning, which uses clustering, and has a number of variations including semi-supervised. Reinforcement learning is only briefly described as it doesn’t have the target value found in supervised learning which provides too much uncertainty. Finally, paradigms, which are different assumptions that deal with different learning situations like supervised learning versus reinforcement learning, are covered. Supervised learning is the most popular and useful so covering that will put you ahead.

  • 00:10:00 In this section, the speaker covers different paradigms in machine learning, including reinforcement learning, active learning, and online learning. He also discusses the Vapnik-Chervonenkis theory and bias-variance. The speaker notes that while there are other substantial theories, he only discusses those that are relevant to practice. When looking at techniques, he separates models and algorithms from high-level methods like regularization. Linear models are emphasized, as they are not typically covered in regular machine learning courses.

  • 00:15:00 In this section, the professor summarizes the various models and methods he covered throughout the course. He starts with polynomial regression, which he believes is underrepresented in machine learning despite being a low-cost, important model. He then briefly discusses neural networks, support vector machines, kernel methods, and Gaussian processes. Next, he describes singular value decomposition (SVD) and graphical models as important models, particularly useful when modeling joint probability distributions with computational considerations. He also discusses various methods, such as regularization and validation, and highlights input processing as a practical matter best taught when teaching a practical course. Finally, he introduces the two topics he covers in this lecture: Bayesian and aggregation.

  • 00:20:00 In this section of the lecture, the professor introduces the topic of Bayesian learning and its foundations as well as its drawbacks. The goal of Bayesian learning is to approach learning from a probabilistic perspective, and the approach involves building a joint probability distribution of all involved notions. The professor then explains how the likelihood approach that was covered earlier in the course is a probabilistic approach, but Bayesian learning takes the approach further and attempts to estimate the probability that a given hypothesis is correct given the data.

  • 00:25:00 In this section, we learn about the Bayesian approach to statistics, which involves choosing the most probable hypothesis to determine the target function. However, there is controversy in the field because Bayesian analysis depends on the prior, a probability distribution that reflects the probability of a hypothesis being the target function before any data is collected. This prior is the source of the ongoing struggle between those who love and those who hate Bayesian analysis. Despite this, a full probability distribution over the entire hypothesis set can give a full view of the relative probability of different hypotheses being the correct target function, allowing answer to any question to be derived.

  • 00:30:00 In this section, the speaker discusses the idea that prior is an assumption in Bayes' theorem. He uses the example of a perceptron model to illustrate how the prior can be used to create a probability distribution over all the weights and how it's important to reduce the level of crime when making assumptions. The speaker compares the unknown parameter x not in a probabilistic sense to the uniform probability distribution from -1 to +1 and explains how it seems that the meaning of x is captured. However, the main point here is that the prior is indeed an assumption and one needs to be careful when making assumptions.

  • 00:35:00 In this section, the speaker discusses how adding a prior when modeling a probability is a big assumption that can lead to false premises. He explains that if you know the prior, you can compute the posterior for every point in the hypothesis set and get a bunch of useful information. For example, you can pick the most probable hypothesis or derive the expected value of h for every hypothesis in your set. He suggests that instead of just picking the highest probability, you should get the benefit of the entire probability distribution to get a better estimate of the target function at any point x and even an estimate for the error bar.

  • 00:40:00 In this section, the speaker discusses the advantages and disadvantages of Bayesian learning. On one hand, Bayesian learning allows for the derivation of any desired events by plugging in specific quantities and generating the probability for that event. Additionally, the error bar can be used to assess whether a particular outcome is worth betting on. However, the speaker cautions that prior assumptions must be either valid or irrelevant for the approach to be valuable. While Bayesian techniques can be computationally expensive, the speaker concludes by acknowledging that they may be worth the effort for certain applications.

  • 00:45:00 In this section, the speaker discusses aggregation methods as a way to combine different solutions and obtain a better final hypothesis. Aggregation is a method that applies to all models and the idea is to combine different hypotheses into one solution. For instance, in computer vision, one can use simple feature detections that are related to being a face and then combine them to obtain a reliable result. Combining is simple and you can use an average or a vote depending on whether it's a regression problem or a classification problem. However, the speaker emphasizes that aggregation is different from doing a two-layer learning where the units learn independently, and each one learns as if it was the only unit, allowing for better learning of the function before combining.

  • 00:50:00 In this section, the lecturer discusses two different types of aggregation - "after the fact" and "before the fact". "After the fact" aggregation involves combining pre-existing solutions, such as in the case of crowd-sourcing for Netflix. "Before the fact" aggregation involves developing solutions with the intention of blending them later on, as seen in boosting algorithms where hypotheses are built sequentially and made sure to be independent from previous hypotheses. The lecturer explains how de-correlation is enforced in boosting algorithms, where hypotheses are developed independently but are still based on previous hypotheses to create a more interesting mix. One way to enforce this de-correlation is to adjust the weight of examples in training to create a more random distribution.

  • 00:55:00 In this section of the lecture, the AdaBoost algorithm is discussed as a specific prescription for emphasis and weighting in the context of the computer vision example. This algorithm defines a cost function that is centered on violation of a margin and aims to maximize that margin with the emphasis on both examples and hypotheses. The lecture also discusses the idea of combining solutions with coefficients to get a better performance. Using a principled choice of alphas and a clean set, the alpha coefficients can be optimized for the best possible output. Finally, a puzzle is presented about blending after the fact, where the best possible outcome can be obtained by subtracting an individual's solution rather than adding it.
  • 01:00:00 In this section, Yaser Abu-Mostafa discusses how negative weights in a machine learning algorithm's solution may not necessarily be a bad thing, as it could be contributing to the mix and improving the overall performance. Abu-Mostafa also shares a practical problem he faced when trying to determine an objective criterion for measuring the value of a hypothesis in a competition, which led him to evaluate a solution's contribution to the total. He also acknowledges the contributions of his colleagues and the course staff, particularly Carlos Gonzalez, who served as head TA and helped to design and manage the course.

  • 01:05:00 In this section, the speaker acknowledges the staff and supporters who made the course possible and free for anyone who wants to take it. He thanks the AMT staff, computing support staff, and the sources of the money that made the course available for free. He also thanks the Caltech alumni, colleagues, and his students for their support and contribution to making the course a positive learning experience for everyone. The speaker dedicates the course to his best friend and hopes that it has been a valuable learning experience for all who took it.

Lecture 18 - Epilogue
Lecture 18 - Epilogue
  • 2012.06.01
  • www.youtube.com
Epilogue - The map of machine learning. Brief views of Bayesian learning and aggregation methods. Lecture 18 of 18 of Caltech's Machine Learning Course - CS ...
 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 11:56

Trading with Python. Introduction & Setup



Introduction & Setup | Trading with Python

Trading with Python series is introduced in this video, which covers the basics of setting up Python and opening a trading account with a broker. The tutorial walks through the process of downloading Python and MT5 IDE, installing the MetaTrader5 library, and creating a Python script to open a trade. The speaker explains using IOC and GTC methods for filling orders and demonstrates how the script sends the order to the MT5 server. The video ends with a successful order execution and an invitation to subscribe to the channel.

  • 00:00:00 In this section, the video provides an introduction to the Trading with Python series, covering how to get started with python, how to open a trading account with a broker, and how to write Python programs in Meta Editor, which is the MT5 IDE. The video walks through downloading Python, making sure it is added to the path, installing the MetaTrader5 library, and opening the Meta Editor to create your first Python script. To demonstrate the process, the video provides an example script to open a trade, defining the symbol, lot size, price, stop loss, take profit, deviation, magic number, and comments. The script is run in the MetaTrader5 platform, resulting in the opening of a trade.

  • 00:05:00 In this section, the speaker discusses using GTC (go to cancel) and IOC (immediate or cancel) methods for filling orders, with IOC being an order type that partially fills an order and cancels the rest if it cannot be completely filled. They then explain how the script sends the order to the MT5 server and includes a print statement to confirm whether the order was successful or failed. The demonstration of the script on MT5 shows a successful order was executed. Finally, the video concludes, and the speaker thanks the viewers for watching and invites them to subscribe to the channel.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 11:56

Trading with Python. Jupyter Notebook & Market Data



Jupyter Notebook & Market Data | Trading with Python #1

The "Jupyter Notebook & Market Data | Trading with Python #1" video introduces viewers to Jupyter Notebook and market data. Jupyter Notebook is a popular web-based coding environment used for data visualization and analysis, strategy development, and backtesting. Viewers can access market data such as tech data and OHLC data by extracting trail symbols from Metatrader 5 and requesting market data. The narrator demonstrates how to obtain bid and ask prices with Python using the datetime library and how to request data periodically via a while loop using the time module, resulting in real-time updates.

  • 00:00:00 In this section, viewers are introduced to Jupyter Notebook and market data. Jupyter Notebook is a web-based coding environment popular among data scientists and machine specialists, and functions as Django for data visualization. Advantages of Jupyter Notebooks include data analysis, visualization, strategy development, and backtesting. Meanwhile, viewers can use certain market data, such as tech data and OHLC data by extracting trail symbols from Metatrader 5 and requesting market data. Viewers can also deploy trading strategies in MT5 environment to manage their risk and monitor their trades. The video explains how to install Jupiter Notebook using pip and how to create a directory called Trading With Python before moving to the Jupiter server. Finally, to request price data from a specific symbol viewers can use the code “empty five dot symbol info tick.”

  • 00:05:00 In this section of the video, the narrator demonstrates how to obtain bid and ask prices with Python using the datetime library. They first show how to convert a Unix timestamp into a datetime object and how to request data periodically via a while loop using the time module. The resulting output displays the updated ask and bid prices in real-time.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 11:57

Trading with Python. Connect Python to MetaTrader5



Connect Python to MetaTrader5

The video tutorial demonstrates how to integrate Python with the MetaTrader5 platform, including importing necessary libraries such as pandas and plotly, initializing and logging into a trading account, retrieving account information, and getting data for symbols, including current price, OHLC data, and historical ticks and transactions. The tutorial also covers how to interact with the platform through Python to view orders, send trades to open and close positions, and close positions using ticket IDs. The presenter encourages viewers to ask questions about the integration process.

  • 00:00:00 In this section, the video tutorial introduces the integration of Python in MetaTrader5 platform. The platform has its own documentation where individuals can request market data, analyze data, and execute trades using algorithmic strategy. To work with Python, the video explains the most basic commands by importing MetaTrader5, pandas, plotly, and datetime libraries. The video then walks through initializing and logging into a trade account, as well as retrieving account information such as the login number, leverage, balance, and equity. The section ends with an explanation of how to use mt.symbolstotal to get the total number of symbols offered by the broker and how to use empty.symbols get to retrieve data such as margin requirement and contract sizes for each symbol.

  • 00:05:00 In this section, the speaker discusses how to get data from a symbol using Python and MetaTrader 5. The speaker explains that by using the empty dot symbols get command, one can obtain data for all symbols, while using empty dot symbol info with the specific symbol name will return data only for that symbol. The speaker also shows how to get the current price of the symbol using symbol info tick, and how to obtain the open, high, low, and close (OHLC) data or candlestick data using empty dot copy rates range. By performing data analysis and calibrating indicators based on this data, one can develop their own trading strategies. Finally, the speaker demonstrates how to check the actual ticks and transactions of the symbol using mt dot copy ticks range to see the history of all bid and ask prices in the platform.

  • 00:10:00 In this section of the video, the focus is on how to interact with the MetaTrader5 platform using Python. Users can get the total number of current orders, check more details about orders and positions, and view historical orders and deals. Additionally, viewers can learn how to send a trade from Python to MetaTrader5 to open and close positions.

  • 00:15:00 In this section, the video explains how to open and close trades through Python using MetaTrader5. The request in MetaTrader5 needs to have parameters such as an action, symbol, volume, type, stop loss, take profit, deviation, magic, comment, order time, and type filling. The video then shows how to enable algo trading and execute the order through Python, which confirms the opening of a position through the platform. Lastly, the video explains how to close a position by specifying the position number and volume and demonstrates through Python that it is possible to close a position with a specific ticket ID through MetaTrader5.

  • 00:20:00 In this section of the video, the presenter demonstrates how to close a position using Python with MetaTrader5. He shows that by copying the ticket ID of the position, one can replace it with the position which needs to be closed. With the successful replacement, the position is closed and the platform shows zero open positions. The presenter invites viewers to ask any questions about MetaTrader5 documentation or Python script integration into MetaTrader5 in the comments section.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 11:58

Trading with Python. Code a simple Trading Robot



Code a simple Trading Robot | Trading with Python

The video tutorial demonstrates how to code a simple trading robot in Python using the MetaTrader 5 platform. The robot uses a simple moving average crossover strategy, with buying occurring when a candle closes above the moving average and selling when the candle closes below it. The presenter explains the code written in Python for this strategy, including functions for market orders, closing orders, and getting exposure for specific symbols. The signal function generates trading signals based on the strategy, and the robot settings define the parameters for the symbol, volume, time frame, and deviation. The video also covers the logic of the trading strategy and code needed to implement it, with buy and sell signals leading to buy or sell orders, respectively. Viewers are encouraged to suggest trading ideas or strategies for potential video topics.

  • 00:00:00 In this section of the video tutorial, the creator explains how to code a simple trading robot using Python and the MetaTrader 5 (MT5) platform. The trading robot uses the simple moving average crossover strategy where buying occurs when the candle closes above the moving average and selling takes place when the candle closes below it. The creator demonstrates the code written in Python for this strategy, which includes functions developed to make coding an automated trading strategy easier. These functions include market order for placing orders, close order for closing orders, and get exposure for getting the exposure for a particular symbol. The creator also explains the signal function used to generate trading signals based on the simple moving average crossover strategy. Finally, the creator elaborates on the symbol, volume, time frame, and deviation parameters needed to define the settings of the trading strategy for the robot.

  • 00:05:00 In this section, the presenter goes through the logic of the trading strategy and the code needed to implement it. The strategy uses functions defined in previous sections to buy or sell based on a signal generated by the code. If a buy signal is given, the code checks if there are any open short positions and closes them before creating a buy order if none exist. The opposite happens with a sell signal. The code also includes print statements to provide information on the strategy and uses the sleep function to update the strategy every second. The presenter shows how to add the strategy to the MT5 platform and run it. They also encourage viewers to leave trading ideas or strategies in the comments section for potential video topics.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 11:59

Trading with Python. How to send Orders to the Market



How to send Orders to the Market | Trading with Python #3

In this video tutorial, the presenter demonstrates how to send market orders using Python and MetaTrader 5. The tutorial covers creating a request dictionary with parameters for a market order, including trade action, symbol, volume, and order type, as well as additional parameters such as stop loss, take profit, deviation, and comment. The video also covers closing open positions using the positions get method and passing the ticket number of the order. The tutorial then moves on to opening a limit or stop order with specifications for price, volume, and other parameters, and modifying and deleting orders using the mt5.trade action stop loss take profit and mt5.trade action remove commands, respectively.

  • 00:00:00 In this section, the video tutorial demonstrates how to send market orders to a trading platform using Python and MetaTrader 5. The tutorial explains that a market order is a type of order that will instantly open a buy or sell position at the current price. The presenter illustrates how to create a request dictionary with the parameters for a market order, including specifying the trade action, symbol, volume, and order type. He also covers additional parameters, such as stop-loss and take-profit, deviation, and comment, and explains how to pass the dictionary to order send. Finally, the tutorial shows how to close an open position using positions get and passing the ticket number of the order.

  • 00:05:00 In this section, the video explains how to close positions in the platform. The trading action function must specify the position and the type of order and the volume must be specified in case of a partial close. The video then moves on to explain how to open a limit order with the desired price, volume, type, and other specifications such as stop loss, take profit, and comment. The same method can be used for stop orders, and to modify orders, the existing ticket number must be grabbed and then the new specifications must be entered.
    |
  • 00:10:00 In this section, the speaker explains how to modify orders and delete them using Python on MT5. To modify an order, the trader needs to use the mt5.trade action stop loss take profit command with four parameters: stop loss, take profit, position id, and values. By specifying these inputs, the trader can update their stop loss and take profit values. For deleting orders, they need to use the mt5.trade action remove command with one parameter, the order number of the ticket, which can be found in the pending orders section. In doing so, the trader can delete any pending orders that have not been executed after a certain amount of time.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 12:01

Trading with Python.  How to close ALL positions



How to close ALL positions | Trading with Python #4

The video tutorial demonstrates how to use Python to close all positions in the MetaTrader 5 trading platform. This entails importing the MetaTrader5 library and using the mt5.positions.get method to retrieve the current list of open positions. A 'close_position' function is then defined, utilizing the mt5.symbol_info_tick method to get the current price and a request dictionary to communicate with the trading platform. The program loops through the open position list, passing each position to the 'close_position' function to close every trade. The narrator provides a link to the code and tutorial playlist for further Python training.


 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 12:02

Trading with Python. Extract and Visualize Data



Extract and Visualize Data | Trading with Python #5

The video demonstrates how to extract and visualize daily OHLC data for the EURUSD symbol from MetaTrader 5 using Python. The process involves importing libraries like MetaTrader 5, pandas, and Plotly.graph_objects for data visualization. The extracted data is converted into a Pandas dataframe and visualized using Plotly's OHLC function. The presenter also shows how to hide the range slider on the plot and provides links to download the code and more Trading with Python videos.


 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 12:04

Trading with Python. Code a Trailing Stoploss



Code a Trailing Stoploss | Trading with Python #6

The video showcases how to create a trailing stop loss robot, utilizing Python. The presenter explains how a trailing stop loss can benefit traders by limiting losses and maximizing profits. The video covers the configuration of necessary variables and connections to the drive platform, in addition to retrieving data and defining maximum distances between the current price and stop loss. The presenter also demonstrates how the stop-loss function follows profit, updates to break even in the event of a breakout, and is capable of updating based on the current price. Overall, the video serves as a helpful demonstration of how Python can be used to trail positions.

  • 00:00:00 In this section, the video demonstrates how to code a trailing stop loss robot using Python. The video starts by explaining how a trailing stop loss can help traders limit losses and maximize profits. The presenter then shows how to set up the necessary configuration variables and connect Python to the drive platform before getting the necessary data from the open position. Next, the video shows how to calculate the distance between the current price and stop loss and define the maximum distance between them. Finally, the presenter demonstrates how to use the coded function to apply a stop loss on open positions using the MetaTrader 5 platform.

  • 00:05:00 In this section, the video shows the configuration for the maximum stop loss, fill amount, and default stop loss. The script allows for the stop loss to be updated based on the current price, with a limit of six pips away from the stop loss, and a trading stop loss by three pips when it exceeds the maximum stop loss. The script also applies a stop loss of 3 pips below the buying price if there is no stop loss for the position. The video demonstrates how the stop loss follows the profit, as well as how it updates to break even in the event of a breakout. Despite the uneventful trading position in the video, the demonstration shows how Python can be used to trail positions.

 

Forum on trading, automated trading systems and testing trading strategies

Python in algorithmic trading

MetaQuotes, 2023.04.13 12:05

Trading with Python. Manage your positions with Tkinter



Manage your positions with Tkinter | Trading with Python #7

In this section of the video, the presenter demonstrates how to use Tkinter to create a Python application that can manage and close open positions remotely in the MetaTrader 5 platform. The application allows users to monitor real-time updates and close positions with deviations in place to limit slippage. It uses a list box to display open positions and has a close button that is linked to a close position command with a deviation element defined using a label and entry. The code for the application is available for free download on the presenter's website, and the video provides a step-by-step explanation of how to create the GUI, initialize the MetaTrader 5 platform, and use functions to monitor and close positions.

  • 00:00:00 In this section of the video, the presenter explains how to use Tkinter and the MetaTrader 5 platform to create a Python application that can monitor and close open positions remotely. The application connects to the MetaTrader 5 library to monitor real-time updates, with deviations in place to limit slippage. The code for the application can be downloaded for free on the presenter's website, and the video provides a step-by-step explanation of how to create the GUI, initialize the MetaTrader 5 platform, and use functions to monitor and close positions. The video also includes a demonstration of the application in action.

  • 00:05:00 In this section of the video, the creator discusses the more advanced feature of managing open positions using Tkinter. The open positions are saved in a string variable and obtained using the "get open positions" function, which is linked to the user's driver platform. These positions are displayed using a Tkinter list box that allows for selecting and closing multiple positions simultaneously. The close button is linked to a close position command that refers to a deviation element defined using a label and entry. Finally, the program is set up to update positions in real time and can be run using root dot main loop. The code is available on the creator's website.

  • 00:10:00 I'm sorry, there appears to be no transcript excerpt provided for me to summarize. The text you provided is the end-of-video call-to-action from the creator. If you have any specific transcript excerpts, I will be happy to provide a summary.