hi Daniel, my name is Roberta, how do I activate this EA in metatrader, can you help me?
You need to compile it and then it will appear among the other Expert Advisors that the platform has by default, then you play it on the chart in the same way as you would any other programme.
One detail: Algo Trading must be enabled on the platform for it to work:
<< Algo Trading disabled ;
<< Algo Trading enabled;
Dani, I don't know how to compile, I don't know much about programming, I've just started this metatrader system, can you help me?
You need to compile it and then it will appear among the other Experts Advisors that the platform has by default, then you play it on the chart in the same way as you would any other programme.
One detail: Algo Trading must be enabled on the platform for it to work:
<< Algo Trading disabled ;
<< Algo Trading enabled;
Dani, I don't know how to compile, I don't know much about programming, I've just started this metatrader system, can you help me?
In this case, I can suggest a playlist that I'm putting together on YOUTUBE. It's very basic, but aimed precisely at people who are just starting out. The videos will be short and focused on a specific subject, but always aimed at the MetaTrader beginner. Have a look later, it might help you take your first steps. But be careful what you actually put on the platform, since you'll be working with your brokerage account and using real money... I'm just saying CAUTION ...
The link to the playlist is: https: //www.youtube.com/watch?v=Q5rgggKuUY4& list=PLpkiMqQzUzgA3fgPE1D-ZcjnEKVwgEg8z

- 2022.12.24
- www.youtube.com
Good afternoon Daniel,
Firstly, thank you for sharing your knowledge, it's helping me a lot!
I have a question about how the trading server understands stop and take profit orders, are they considered separate orders or are they part of a single "structured position"? In other words, when the position is closed, will the trading server always remove the SL and TP or should I worry about orphaned orders?
This question arose when in your article you comment on the risk of the "lame leg" and also when you comment that in order to activate the trailing stop in a hedging account we need to allow 2 open positions.
Cheers
This question arose when in your article you comment on the risk of the "lame leg" and also when you comment that in order to activate the trailing stop in a hedging account we need to allow 2 open positions.
Cheers
Doubts are part of it. There's no shame in asking. It's shameful to maintain doubts and spread information without knowledge.
But let's go in parts. Let's first understand one situation and then the other.
->When you place an order on the server, or open a position, you can do this in two ways: When you send the order with the stop and take already set on the order or position to be opened. In this case you only send a request to the server. If you haven't put the stop or take in the order, you can do this later by adjusting things. In any case, you will only have one order or position on the server. This is what many people call an OCO order. In other words, when the stop or take is executed, the position will be closed and everything will be as you probably already know when it comes to OCO orders. I don't think you have any doubts about this.
->Now we have a problem, which I've addressed in this same series of articles. An OCO order or position does not indicate that your Take or Stop will not be skipped. They will only be executed if a trade occurs at that specific price. To prevent the order from being skipped, some programmers don't use OCO orders, they do something a little different. It's this something different that tends to generate those lame legs, i.e. you have an order listed in the book, but it's not covered by any other order. In this case, we are using at least two orders to control the position. By doing this, we avoid the skipped stop, because even if the price skips the OCO order, it won't skip the order in the book, which is there precisely to close the open position in MARRA ... However, this doesn't work on the HEDGING type of account, because such accounts allow you to hold a buy and a sell position at the same time, on the same asset. It's almost like a BINARY OPTION ... but when this technique of using two orders is carried out on a NETTING account, the position is closed. But you have to be careful to avoid keeping a loose order in the book.
To understand this, you really need to read all 15 articles in the series and try out the automatic system I demonstrate. But do this on demo accounts, both on FOREX and on the stock market. Then you'll really understand what I'm talking about. Don't try to understand it just by imagining how it should or could work. Test the system on demo accounts, both on FOREX, which uses HEDGING accounts, and on BOLSA, which uses NETTING accounts ... 😁👍
Doubts are part of it. There's no shame in asking. It's shameful to maintain doubt and spread information without knowledge.😁
But let's go in parts. Let's first understand one situation and then the other.
->When you place an order on the server, or open a position, you can do this in two ways: When you send the request with the stop and take already set on the order or position to be opened. In this case you only send a request to the server. If you haven't put the stop or take in the order, you can do this later by adjusting things. In any case, you will only have one order or position on the server. This is what many people call an OCO order. In other words, when the stop or take is executed, the position will be closed and everything will be as you probably already know when it comes to OCO orders. I don't think you have any doubts about this.
->Now we have a problem, which I've addressed in this same series of articles. An OCO order or position does not indicate that your Take or Stop will not be skipped. They will only be executed if a trade occurs at that specific price. To prevent the order from being skipped, some programmers don't use OCO orders, they do something a little different. It's this something different that tends to generate those lame legs, i.e. you have an order listed in the book, but it's not covered by any other order. In this case, we are using at least two orders to control the position. By doing this, we avoid the skipped stop, because even if the price skips the OCO order, it won't skip the order in the book, which is there precisely to close the open position in MARRA ... However, this doesn't work on the HEDGING type of account, because such accounts allow you to hold a buy and a sell position at the same time, on the same asset. It's almost like a BINARY OPTION ... but when this technique of using two orders is carried out on a NETTING account, the position is closed. But you have to be careful to avoid keeping a loose order in the book.
To understand this, you really need to read all 15 articles in the series and try out the automatic system I demonstrate. But do this on demo accounts, both on FOREX and on the stock market. Then you'll really understand what I'm talking about. Don't try to understand it just by imagining how it should or could work. Test the system on demo accounts, both on FOREX, which uses HEDGING accounts, and on BOLSA, which uses NETTING accounts ... 😁👍
Thank you very much for your explanation. I've understood it well now.
Yes, I've just finished reading all the articles and I'll start testing soon.
Cheers
Hello, I've been following along and implementing your EA but ive run into an error I cannot get to the bottom of. Can you assist with the errors. The errors are:
'C_ManagerAce.mqh' C_ManagerAce.mqh
'C_Orders.mqh' C_Orders.mqh
'C_Terminal.mqh' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
'C_Terminal::FinanceToPoints' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::FinanceToPoints' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
'C_Terminal::FinanceToPoints' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::FinanceToPoints' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
I used the same exact code as you becuase im learning programming once again. I have a bachelors in computer science. I dont understand why I get these errors when I compile my code and I have the code as you and yours compile. Help Please
Hello, I've been following along and implementing your EA but ive run into an error I cannot get to the bottom of. Can you assist with the errors. The errors are:
'C_ManagerAce.mqh' C_ManagerAce.mqh
'C_Orders.mqh' C_Orders.mqh
'C_Terminal.mqh' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
'C_Terminal::FinanceToPoints' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::FinanceToPoints' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
'C_Terminal::FinanceToPoints' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::FinanceToPoints' C_Terminal.mqh
'C_Terminal::GetTerminalInfos' - cannot access private member function C_ManagerAce.mqh
see declaration of function 'C_Terminal::GetTerminalInfos' C_Terminal.mqh
I used the same exact code as you becuase im learning programming once again. I have a bachelors in computer science. I dont understand why I get these errors when I compile my code and I have the code as you and yours compile. Help Please
The errors you are reporting are due to the attempt to access something private to the class, outside the body of the class. I suggest you start with something a little simpler first. For this, first try to understand what private clauses and public clauses are. But mainly, why use one or the other.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Creating an EA that works automatically (Part 09): Automation (I) has been published:
Although the creation of an automated EA is not a very difficult task, however, many mistakes can be made without the necessary knowledge. In this article, we will look at how to build the first level of automation, which consists in creating a trigger to activate breakeven and a trailing stop level.
The video below demonstrates this system in operation. For those who imagine that this is something different or non-functional, watch the video and draw your own conclusions. Although the best thing to do in order to understand what's going on is to compile the EA and do your own tests on a DEMO account. In this way, the understanding of the entire system will be more solid and clear.
Video 01. Demonstration of the Stop system via pending order.
Author: Daniel Jose