Can you recommend some guides for simple EAs with best practices?

 

Hi,

I'm familiar with C++ and have done a few projects with it. I want to learn how to write a simple script that places and order (O1) with a take profit and stop loss, and then, based on the what happens to O1 to place an O2 also with a take profit and a stop loss.

Thank you.

 
  • Usually people who can't code in MQL don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.
 
Thank you for replying.  I apologize for not being clear in my question. I know how to program. I was just wondering if there were articles that summarize how to place the main market and limit orders. I've found the documentation to be thorough but to, at the same, lose the forest for the trees.
 
absconditus87 #Thank you for replying.  I apologize for not being clear in my question. I know how to program. I was just wondering if there were articles that summarize how to place the main market and limit orders. I've found the documentation to be thorough but to, at the same, lose the forest for the trees.

You may know how to program in C/C++, but you don't know how to do it in MQL, hence my post and suggestion that you study the "available Articles on the subject, or examples in the Codebase".

Here are some starting points ...

... and ...

Articles

Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners

Samuel Olowoyo, 2010.06.09 11:37

The Expert Advisors programming in MQL5 is simple, and you can learn it easy. In this step by step guide, you will see the basic steps required in writing a simple Expert Advisor based on a developed trading strategy. The structure of an Expert Advisor, the use of built-in technical indicators and trading functions, the details of the Debug mode and use of the Strategy Tester are presented.

Articles

Orders, Positions and Deals in MetaTrader 5

MetaQuotes, 2011.02.01 16:13

Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.


 
Really appreciate the help. Thank you. Will have a look at all the articles.
Reason: