Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 5

 

thank you for the article.

 
Yedelkin:

abolk, hrenfx, what, in fact, is the argument about? Let's read carefully the title of the article: "... The article fully justifies its purpose, both in title and content. Take my word for it, beginners don't give a damn what the rounding accuracy of an expert is, the main approach is "we just need to deal with the EA spelling ". Let it be 2 digits or 7 digits. For me personally, as a beginner, the trick with "rounding" to 4 digits (though in another article) turned out to be very useful, revealing one of the programming techniques. And with experience, highly qualified specialists will be able to decide with what accuracy to perform calculations/trading, and this article will not prevent them from doing so. This article did not hinder you in any way :) So do others: "when they grow up to your level, they will figure it out for themselves".

This is a fundamentally wrong approach!

Probably in this article it is not necessary to cover the topic of 4-5 characters in detail, but you should not put in the knowledge base that may later cause a lot of questions. And it is "... for beginners" it is especially important!

It's so Russian... To create problems for oneself (and others) in order to overcome them heroically and receive orders for it.

 
VladMih:

A fundamentally flawed approach!

..This is so Russian.... To create problems for oneself (and others) in order to overcome them heroically and receive orders for it.

Are you a beginner, or are you just theorising?

VladMih:

Probably in this article you don't need to cover the topic of 4-5 characters in detail, but you shouldn't put in your knowledge base something that may cause a lot of questions later on. And it is "... for beginners" it is especially important!

All this alleged "concern for beginners" (like "the need to lay the knowledge base", etc.) is demonstrated without taking into account the content of the article itself. Look at the condition line, read the explanations. For the second time I suggest - take my word for it, beginners are not fools, they will figure it out on their own with so many hints.

We decided to store Stop Loss and Take Profit values in the previously defined variables STP and TKP. Why did we do it?

It is done because the values of the input parameters cannot be modified, they are read-only.

We need to be sure that our EA will work correctly with all brokers.

 
Yedelkin:

Are you a beginner, or are you just theorising?

All this alleged "concern for beginners" (like "the need to build a knowledge base", etc.) is demonstrated without taking into account the content of the article itself. Look at the line with the condition, read the explanations. For the second time I suggest - take my word for it, beginners are not fools, they will figure it out on their own with so many hints.

I'm not even a beginner, you can say "approaching" (starting) to study (lamer, in the sense - worse than a kettle). I.e. trying to take care of myself. ))) Once I tried to start learning MQL4, but failed.... Now I have even more need to learn the language, but I see that.....

Just today I once again wanted to open a topic with a proposal to create a separate section for beginners with the very first recommendations. If we talk about beginner programmers familiar with the "basic" language, it is easier for them, but no robot builders will help a complete beginner, because they have nothing to start from for a more or less complete understanding of what and how to build.

There is a lot of information, I agree, but somehow... the cart before the horse... There is a guidebook - well made, but it is not a helper for a beginner. There are a lot of articles, but mostly about rather complicated things, mostly about Expert Advisors, and it would be necessary to have more information about the simplest things - more information about creating simple indicators, about colouring lines, about combining indicators (combining several into one), about getting signals from these indicators, etc.

Today I saw a good order for which Integer seems to have taken up - an article on how to make your own indicator by modifying someone else's ready-made one - THIS IS WHAT A BEGINNER NEEDS, this is one of the bricks needed for the foundation, from which you can then push off in the direction of Expert Advisors.

Therefore, ideally, there should be a separate section with such bricks, a separate section to make it easier for a beginner to navigate, to have a place to practice and consult. A kind of sandbox.

Statements (above) such as: "Well, you have figured it out, so others will figure it out" - this is from underthinking. You can pull your trousers over your head if you try hard for a year or two.... But you can try to do it RIGHT and it is better to do it now, while MT5 and MQL5 are just starting to gain momentum.

I.e. in addition to the reference book and good articles, you need something like a textbook, if not a manual, then ... let's call it a METHODOLOGY, which would bring a complete beginner to a state in which he/she would be able to fully perceive the available articles and the reference book.

 

VladMih:

OK, I see. In fact, you raise (once again) the question of the need for an MQL5 textbook. - We here have already somehow accepted the absence of such a textbook.... In particular, I, probably due to "underthinking" (as you put it), do not wait for favours (textbooks) from nature, but work through what is available and expand my horizons as much as possible. I.e. I act as on the market, namely: I adapt to the available circumstances. The law of the prairie is harsh: those who cannot adapt, go to the woods. You are making claims to a separate article, which is neither a textbook nor a methodology. But it contains a lot of hints to broaden your horizons.

VladMih:

...If we talk about beginner programmers familiar with the "basic" language, it is easier for them, but no robot builders will help a complete beginner, because they have nothing to start from for more or less complete understanding of what and how to build.

A year ago, I was a typical beginner who was not familiar with "basic language" at all. "The article you criticised was one of the first bricks for immersion into the world of MQL5.
 
Great article for a beginner! i'm very excited. Thank you very much.
 

very nice article, thanks for it, helped me a lot, are you in the ATC 2011???

cheers 

 
olowsam:

Yes, it's true that the article does not dicsuss how to close positions in details, however, if you open a Sell position, once you open a Buy, the sell position is automatically closed.

Therefore, to close a Buy position, open a Sell; and to close a Sell position, open a Buy.

Thank you. 

hi olowsam, 

 could you please show me, where the code that make it like that ? "..., if you open a Sell position, once you open a Buy, the sell position is automatically closed."

'coz in your example, you only put single order(sorry, i'm a total beginner)  ;

//--- Putting all together


         //--- send order

         OrderSend(mrequest,mresult);


because i'm currently trying to make my EA like that, and i use PSAR as my indicator. i want my EA to buy and sell following the trend all along the time.

just can't figure the coding, how to make it auto close sell and then Open Buy(and also auto Close Buy and then Open Sell),  each time PSAR draws the opposite dot.

I need help actually.

Currently i can manage the EA to open position when PSAR draw Opposite using 

trade.PositionOpen(_Symbol,                                          // symbol

                               ORDER_TYPE_BUY,                                   // buy order

                               Money_M(),                                        // lots to trade

                               Ask,                                              // last ask price

                               0,//Ask - StopLoss,                                   // Stop Loss

                               buystop,//Ask + TakeProfit,                                 // Take Profit 

                               " "); 

the Problem is when i want to close my position only when the PSAR has Draw the opposite Dot.   

thanks 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
mora:

very nice article, thanks for it, helped me a lot, are you in the ATC 2011???

cheers 

Yes, he participates - https://championship.mql5.com/2011/en/users/olowsam
 

Hi everyone,

I downloaded "my_first_ea.mq5" and tried to test it.

It coudn't place any trades.

Here are the type of errors: 

 2011.11.13 23:39:58 2011.11.01 14:20:00   Alert: The Sell order request could not be completed -error:4756
 2011.11.13 23:39:58 2011.11.01 14:20:00   failed instant sell 1.00 EURUSD at 1.36833 sl: 1.37133 tp: 1.35833 [Invalid request]
 

same with buy orders

2011.11.13 23:39:56 2011.11.01 13:25:00   Alert: The Buy order request could not be completed -error:4756
2011.11.13 23:39:56 2011.11.01 13:25:00   failed instant buy 1.00 EURUSD at 1.37186 sl: 1.36886 tp: 1.38186 [Invalid request]
   

Any ideas about why is that?

You help appreciated, Thanks... 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM - Documentation on MQL5