Questions from Beginners MQL5 MT5 MetaTrader 5 - page 390
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Karputov Vladimir:
Пожалуйста, всегда уточняйте для какой версии MQL4 или MQL5 Ваш вопрос.
MQL5
Gentlemen programmers!
In MQL5, how can I synchronize bars on different currency pairs in time?
It used to be "iBarShift", but how was it replaced?
Gentlemen programmers!
In MQL5, how can I synchronize bars on different currency pairs by time?
It used to be "iBarShift", but how was it replaced?
CopyTime()
Thanks, I found it. I did what I wanted in a few minutes. great article. kudos to the developer!
https://www.mql5.com/ru/articles/81
Hello!
Can you please advise how to get information about open and closed trades in MQL5 Expert Advisor code (what price was opened, what were the TP and SL)?
And is there any built-in function or library that returns an array with n latest valuesof moving average(preferably weighted or exponential)?
Thank you!
And please advise, if there is any such a construction in MQ4 as an associative array with text keys, for example: Array["Here is the key!"]?
Yes, there is. Read the article on this subject:"MQL5 Recipes - Implementing an associative array or dictionary for quick access to data".
The elements of an array are accessed by an index. The index is the whole int type.
I recommend you to read the article too.
Good day to all!
I need to get from the input field in the EA window the timeframe selected by the user from the drop-down list. How to use it in the function, I'm struggling with it for the second day in a row, please advise me)!
Code:
input enum timeFrame {
Hour_1 = 60,
Hour_4 = 240,
Day_1 = 1440,
Week_1 = 10080
};
iADX(currencySelect, THIS IS HOW TO INSTALL SELECTED DATA!, ADXparam, PRICE_CLOSE, MODE_MINUSDI,2)
Thank you!
Do not reinvent the wheel. Make the ENUM_TIMEFRAMES enumeration as an input parameter.
Insert code correctly on the forum
Here is an example of a script that uses your enumeration:
Why do you advise a wrong approach? You are well aware that it is nonsense to invent your own enumeration of timeframes.
ulong a =OrderGetTicket( 1); // number in the order list
MetaEditor does not consider thisfunction to be a function. And the parameter(ORDER_POSITION_ID) in the function ---> positionID = OrderGetInteger(ORDER_POSITION_ID); it is not considered as parameter at all...
People!!! I do not understand the language in which experts and scripts are written in MT4 these days. If I started to replace all functions in my code with MQL5 functions, MetaEditor from MT4 terminal, has not recognized all functions as functions! For example this function
ulong a =OrderGetTicket( 1); // number in the order list
MetaEditor does not consider thisfunction to be a function. And the parameter(ORDER_POSITION_ID) in the function ---> positionID = OrderGetInteger(ORDER_POSITION_ID); it is not considered as parameter at all...