Questions from Beginners MQL5 MT5 MetaTrader 5 - page 389
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
Good day to all.
I've started to study MQL5 programming not so long ago, got acquainted with documentation and watched some webinars on youtube. I managed to make some humble steps :) I've been working on it for three days now :( I would like to ask the professionals for some help.
The general concept is as follows: first, we get the Ask and Bid prices (I used MqlTick and SymbolInfoTick for this purpose), then we look whether there is an open deal or not (I used PositionsTotal for this purpose), if there are no open positions, we open a position at Ack or Bid prices according to a certain condition. Namely, if we had a previous trade to buy and it turned out to be positive (we bought low and closed high), we will open a new position to buy... That is in general terms :) The problem is that I can not get information about what was the type of last transaction and consequently at what price it opened and at what price it closed ...
Here is the code I wrote:
Thanks in advance for your help :)
I moved away from paper books a long time ago, as well as from pirate books in electronic form. I got used to it.
You can't live beautifully.
I have newcomers asking me what to read and I don't remember what I have.
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!
Inserting the code correctly in the forum
Here's a sample script, applying your enumeration:
Inserting the code correctly in the forum
Here's a sample script, using your listing:
Thank you!
And more, please tell me, is there a construction in MQ4 like associative array with text keys, for example: Array["Here is the key!"]?
Thank you!
Also, could you please tell me if MQ4 has a construction like associative array with text keys, for example: Array["Here is the key!"]?
In your example, the keys are numbers, and I meant using strings as keys.
Hello!
Can you please advise how to get information about open and closed trades in MQL EA code (what price was opened, what were the TP and SL)? at least for the last 1.
And is there any built-in function or library that returns an array with n last values of moving average(preferably weighted or exponential)?
Hello!
Can you please advise how to get information about open and closed trades in MQL EA code (what price was opened, what were the TP and SL)? at least for the last 1.
And is there any built-in function or library that returns an array with n last values of moving average(preferably weighted or exponential)?