Programming in Metatrader 5 Newbies - page 2

 
jordiqqq:

Hi all,

 I have been doing trading for a while and I am pretty sure I got a good technique. I used to trade with another platform. With no robots capabality.

Recently I discovered MT5 and I am interested to make a robot which can apply my knowledge.

 Therefore, I have a clear idea how to trade, but no idea about MT5 programming. I would like to know if there is any way to learn programming quickly. I have seen all the MT5 material here, but it looks it would take months. How long do you think it coult take?

 Anyone who faced the same problem? Learning material used? 

 Many thanks in advance.

 

Jordi  

One of the way is to study programs in CodeBase and read articles, e.g. like this one Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator.
 

Hi,

I am having an issue by programming a simple pattern in Metatrader 5. Always when I am trying to put Ask or Bid into the pattern in, it gives me an error: "Ask" - undeclared indentifier

This is the whole pattern:

int start()

{

   Alert("Actuall ask for symbol ", Symbol(), " is ", Ask);   


   return(0);

Does anybody know how to fix this error please?

Thank you very much, M. H. 

 
burgie:

There is a book out there called Expert Advisor Programming by Andrew Young. Although it isn't great, it is decent if you're a beginner. I've spotted one or two errors in the book (constants for order types are wrong for instance) but most of it is good enough. It gives you an idea what you need and you can then find all the details in the online documentation.

The downside is that it is written for MT4. But if you're a real beginner then I think first learning MT4 and then "upgrading" to MT5 is the faster route. Or do any of the MT5 programmers disagree?

I think it is a case of "half a dozen of one opinion" vs "six of the other". I say this because MQL5 has such a different approach, when compared to MQL4, that for many new users it may be more beneficial to start with MQL5 directly instead of learning MQL4 and then having to relearn a totally new approach again.

I know there is much more info out there on MQL4, but even that is outdated and does not even use the newer MQL4+ style. Given the reasonable long learning time that may be required and that MT4 and MQL4 may be on the way out soon (although nothing confirmed yet), it may be better to start with MQL5.

 
Martin Hoch:

Hi,

I am having an issue by programming a simple pattern in Metatrader 5. Always when I am trying to put Ask or Bid into the pattern in, it gives me an error: "Ask" - undeclared indentifier

This is the whole pattern:

int start()

{

   Alert("Actuall ask for symbol ", Symbol(), " is ", Ask);   


   return(0);

Does anybody know how to fix this error please?

Thank you very much, M. H. 

I don't have much knowledge of MQL5, but I'm fairly sure that the predefined variables of Bid and Ask don't exist.

I think you must either:

   MqlTick last_tick;
   SymbolInfoTick(_Symbol,last_tick);
   double Bid=last_tick.bid;

Or: 

double Bid=SymbolInfoDouble(_Symbol,SYMBOL_BID);
 
Martin Hoch: I am having an issue by programming a simple pattern in Metatrader 5. Always when I am trying to put Ask or Bid into the pattern in, it gives me an error: "Ask" - undeclared indentifier. Does anybody know how to fix this error please?
There are no predefined/internal variables "Ask" or "Bid" in MQL5 (as there are in MQL4). However, your request is off topic, so it might be more appropriate for you to start a new thread or better still, to first do a search on the forum for similar threads.
 

If you are looking for a systematic and organized introduction to MQL 5, then the only option on the market today is: https://www.amazon.com/Expert-Advisor-Programming-MetaTrader-automated/dp/0982645929/ref=sr_1_2?ie=UTF8&qid=1480940912&sr=8-2&keywords=expert+advisor

In my opinion, it is a very good book for beginners ... especially if you have some programming background, but it is not necessary.

I studied it ... and then now filling the gaps by reading the documentation from a to z, articles and codes on this site.

 
Sergey Golubev:

Yes, that's right.
But I am talking about the people who was learning mql4 by themselves, and they want to be turned to mql5 for now.
 

I've studied MQL5, then I will realize that MQL5 is much more engaging and much more powerful, and much more than I can imagine in MQL4. b0212-smile.gif
 

Well, I read that MLQ5 is merely "SQL".  But it looks like "C" programming to me.

SQL is relatively EASY TO TEACH YOURSELF.  I would suggest purchasing technical books from http://www.opamp.com/ .  When I worked in the industry, I found everything I need there, includes awesome OLD OLD TUTORIAL books.

Thus far, the tutorials I have seen pretty much suck.  

Youtube has a few that are providing tutorials, but they can't TEACH.

Good Luck to all of us (laughs)

Reason: