Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть MQL5 Tutorial - Simple Sell Position Close explained (in 4 min)

  • MQL5 Tutorial
  • 2024-07-01
  • 761
MQL5 Tutorial - Simple Sell Position Close explained (in 4 min)
yt:cc=onmql5mql5 tutorialsell positionposition close
  • ok logo

Скачать MQL5 Tutorial - Simple Sell Position Close explained (in 4 min) бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно MQL5 Tutorial - Simple Sell Position Close explained (in 4 min) или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку MQL5 Tutorial - Simple Sell Position Close explained (in 4 min) бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео MQL5 Tutorial - Simple Sell Position Close explained (in 4 min)

https://mql5tutorial.com/?s=sell+posi...

In this video, we are going to create an Expert Advisor that opens and closes sell positions based on certain conditions. Let's see how we can do that.

First, we start Metaeditor by clicking the little icon or pressing F4.

We begin by including the Trade.mqh library, which provides functions for trading operations. We then create an instance of the CTrade class named trade.

In the OnTick function, which is called on every tick, we first get the current Bid price and normalize it to the number of digits specified for the symbol.

Next, we check if the total number of positions is less than 10. If this condition is met, we open a sell position of 0.10 lots, which is equivalent to 10 micro lots. The trade.Sell function takes several parameters: the lot size (0.10), the symbol (NULL for the current symbol), the price (Bid), the stop loss (Bid + 1000 * _Point), the take profit (Bid - 150 * _Point), and a comment (NULL).

If the total number of positions is exactly 10, we call the CloseAllSellPositions function to close all open sell positions.

The CloseAllSellPositions function iterates through all open positions in reverse order. For each position, it retrieves the ticket number and the position type. If the position type is a sell position, it closes the position using the trade.PositionClose function.

At the end, we press F7 to compile the code.

If this was too fast for you or if you don't understand what all the code is doing, you may want to check out the Premium course on our website or watch one of the basic videos first.

If the compilation works, we go back to MetaTrader by pressing F4 or clicking on the icon.

Back in MetaTrader, we press Control and R to start the strategy tester, pick the Expert Advisor that we have just created, enable the visual mode, and start a strategy test.

We should then see the Expert Advisor on the chart.

If you are already a Premium course member and have an idea for a video like this one, you can send us an email.

In this video, we have learned how to create an Expert Advisor that opens and closes sell positions based on the number of open positions. We have coded this Expert Advisor ourselves with a few lines of MQL code.

Thanks for watching, and I will see you in the next video.

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]