MQL5 TUTORIAL - ORDER CANCELS ORDER (Simple Example)

Опубликовано: 01 Январь 1970
на канале: MQL5 Tutorial
1,806
29

Introduction to Order Cancels Order Strategy (00:00 - 00:14)

Introduction to creating an Expert Advisor for Order Cancels Order strategies, allowing the placement of two pending orders above and below the current price.
Expert Advisor Development Overview (00:14 - 00:26)

Overview of developing an Expert Advisor that opens Buy Stop and Sell Stop orders when there are no open positions or orders.
Starting with MetaEditor (00:26 - 00:39)

Instructions on opening MetaEditor to begin coding the Expert Advisor.
Setting Up the Code Structure (00:39 - 00:52)

Explanation of the initial code structure, including importing the Trade.mqh file and creating a CTrade instance.
Ontick Function and Price Calculations (00:52 - 01:05)

Details on the Ontick function and calculations for account balance, equity, bid, and ask prices.
Checking Open Positions and Orders (01:05 - 01:16)

Process of checking if there are no open positions and orders, and printing out information.
Placing Buy Stop and Sell Stop Orders (01:16 - 01:40)

Instructions on placing pending Buy and Sell orders using the Buy Stop and Sell Stop functions.
Checking for Open Positions and Cancelling Orders (01:40 - 02:06)

Method for checking if there is at least one open position and then calling the Cancel Order function.
Cancel Order Function Explanation (02:06 - 02:29)

Detailed explanation of the Cancel Order function, which deletes pending orders.
Summary of Expert Advisor's Functionality (02:29 - 02:50)

Summarizing how the Expert Advisor places and cancels orders based on open positions.
Learning Resources and Premium Course Invitation (02:50 - 03:12)

Suggestions for beginner tutorials and an invitation to the Premium Course for more resources.
Compiling and Testing the Expert Advisor (03:12 - 03:36)

Instructions for compiling the code and testing the Expert Advisor in MetaTrader.
Visual Test and Expert Advisor Functionality (03:36 - 03:47)

Demonstrating the Expert Advisor's functionality in a visual test.
Conclusion and Additional Learning Resources (03:47 - 04:20)

Conclusion of the walkthrough and suggestions for further learning through the website's courses.

https://mql5tutorial.com/?s=order+can...

In this video, we are going to create an Expert Advisor for Order Cancels Order strategies so you can place two pending orders above and below the current price, and as soon as the price reaches one of your orders, the other one is canceled. So let's see how we can do that with MQL5.

In this video, we are going to develop an Expert Advisor that opens Buy Stop and Sell Stop order when there are no positions or orders open, and cancels all pending orders when there is at least one open position. To do this, we'll be using MQL5 language. To begin, click on the small icon or press F4 on your keyboard, which will open the Metaeditor window. Now let's discuss the source code. The first part of the code is quite straightforward. We include the trade Trade.mqh file using an include statement allowing us to access the trade functions of MQL5. We then create an instance of the CTrade class which we name Trade. We move into the Ontick function, which is called every time a new tick is received for the symbol on the chart on which the expert advisor runs. Here we calculate the account balance and equity using the Account Info Double function.


Смотрите видео MQL5 TUTORIAL - ORDER CANCELS ORDER (Simple Example) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MQL5 Tutorial 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,806 раз и оно понравилось 29 людям.