Simple question from newbie in mql. Please help.

 

Hi, I started learning mql4 two weeks ago, along the way I noticed mql5 programming is growing.

1. From your perspective : Do i rather stop learning mql4 and switch to mql5 stright away? Or, learn programming in mql4(many helpful articles=learning faster) than just learn how to convert bot to mql5? Which way will you choose? 

2. My trading system consists of pending SendOrder's, but from MA lvls. Is it possible to program bot buying and selling from MA's?

As i searched in web and so far could not find article about that. All orders are made upon closing,openning prices ,etc or from static levels, here lvl change every bar close.

But nothing like for examp. SendOrder(Bid=iMA*point)  just in short description. Or maybe use Ordermodify which will modify Bid by MA lvls refreshed every close bar....Signal will be MA's cross, than pending order from MA to sell or buy.

Is such a order from MA automaticly possible?

Please help. Thanks.

Best regards.   

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
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
 

If you just started, then you better switch to mql5.

 
FxAnomaly82: 

1.  Which way will you choose? 

2. My trading system consists of pending SendOrder's, but from MA lvls. Is it possible to program bot buying and selling from MA's?

1. Learn MQL4 (much easier). Most brokers have it. MQL5 is only for championship.

2. No pending orders. Use time series like iMA(i), close(i) in onTick() function. Read more codebase.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
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
 
FxAnomaly82:

Hi, I started learning mql4 two weeks ago, along the way I noticed mql5 programming is growing.

1. From your perspective : Do i rather stop learning mql4 and switch to mql5 stright away? Or, learn programming in mql4(many helpful articles=learning faster) than just learn how to convert bot to mql5? Which way will you choose? 

There is also a lot of articles for MQL5 -> https://www.mql5.com/en/articles

 

divenetz: 

1. Learn MQL4 (much easier). Most brokers have it. MQL5 is only for championship.

2. No pending orders. Use time series like iMA(i), close(i) in onTick() function. Read more codebase.

Ad.1. Disagree. There are already brokers offering MT5 for live trading (just to mention Alpari), so it is not only for championship. IMHO better to learn MQL5 - more prospective language and much more powerful - the more will you become fluent in coding, the more you will appreciate the advantages of MQL5. Personally I'd never come back to MQL4, even just for one reason: no object-oriented programming in MQL4.

Ad.2. What do you mean by "no pending orders"?? Of course there are both market and pending orders in MetaTrader5 -> https://www.metatrader5.com/en/terminal/help/trading/general_concept

MQL5 Articles
MQL5 Articles
  • www.mql5.com
MQL5 Programming Articles
 
FxAnomaly82:

Hi, I started learning mql4 two weeks ago, along the way I noticed mql5 programming is growing.

1. From your perspective : Do i rather stop learning mql4 and switch to mql5 stright away? Or, learn programming in mql4(many helpful articles=learning faster) than just learn how to convert bot to mql5? Which way will you choose? 

2. My trading system consists of pending SendOrder's, but from MA lvls. Is it possible to program bot buying and selling from MA's?

As i searched in web and so far could not find article about that. All orders are made upon closing,openning prices ,etc or from static levels, here lvl change every bar close.

But nothing like for examp. SendOrder(Bid=iMA*point)  just in short description. Or maybe use Ordermodify which will modify Bid by MA lvls refreshed every close bar....Signal will be MA's cross, than pending order from MA to sell or buy.

Is such a order from MA automaticly possible?

Please help. Thanks.

Best regards.   

Keep on learning MQL5. You'll be grateful when you start doing things you hadn't imagined.

It is not only that it is much more powerful than MQL4, it is that you can't do a lot of things in MQL4 and you can in MQL5. For example, backtest and optimize multi currency EAs or more precise backtests and optimizations due to the fact that the spread IS in the histories.

MQL5 is a bit more difficult to learn, but it really worths the effort.

And another reason: MT5 is still growing and spreading faster than MT4.

In MT5 you can do everything you did in MT4, regardless of what people will tell you. The truth is that for doing some things (like discriminate orders and deals with magic) you'll have to invent your own way.

Regarding your question 2.- I think that the key of your question is not "Pending Orders", which obviously can be done, it is "both buying and selling" . In MQL5 you have the concept of Position , which can be only long or short for a specified symbol. This virtually prevents you from opening at the same time a long and a short in one symbol. The truth is that there's an article in this site that helps you achieve this, thanks to "virtual orders".

To summarize, you can do in your ea anything you can imagine. The limit is your imagination and your programming skills.

Reason: