Questions from Beginners MQL5 MT5 MetaTrader 5 - page 98
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
Boris.45:
I do not use this element of the array, because I immediately proceed to the algorithm for searching fractals at the last 5 bars. While Time_H1[1][0] is the open time of the zero bar where parameters of this bar have not been formed yet.Maybe I am mistaken, but from my own experience, I have seen that using parameters of a zero bar to form time series leads to their distortion
Ok, let me clarify the question:
If "Time_H1[nomer_instr][i]=Time_buf[i];" and "Time_H1[1][1]=2011.01.03 11:00:00", what does Time_buf[0] return?
Please send me a link to close a certain (specific) position.
That is, at a certain point, when conditions to close a position are fulfilled, say BUY, the Expert Advisor (at the moment) closes any open BUY position. Now I face a problem, when I need to close a certain (specific) BUY position.For example, when an BUY position is opened, you can give it a specific designation, but when it is closed, you have to specify 'BUY' as a condition.
For example, when opening a BUY position, you can give it a specific designation, but when closing it, you need to specify its "existence".
So you are going to close different "positions" on the same symbol?
Not really.
If a buy-flat is open, I cannot close a buy-trend. And vice versa.
That is, to close certain positions on the same symbol - either a flat (if a flat is open) or a trend (if a trend is open).
That is, to close certain positions on a single symbol - either a flat (subject to opening flat) or a trend (subject to opening trend).
OK, I'll clarify the question:
If "Time_H1[nomer_instr][i]=Time_buf[i];" and "Time_H1[1][1]=2011.01.03 11:00:00", what does Time_buf[0] return?
I'll try to explain the idea I'm trying to implement in the EA.
There are standard functions CopyTime(), CopyOpen(), CopyHigh(), etc., using the corresponding arrays Time_buf[], Open_buf[], High_buf[], etc.
Using these functions, we can get the historical data for different timeframes and different currencies. In this case, Time_buf[0]is the time of the zero bar opening,
High_buf[0] is the maximum price value of the specified currency on the zero bar at the moment of the last arriving tick.
Then I create two-dimensional arrays for each timeframe for each parameter Time, Open, etc. Then I have the following arrays for timeframe H1
Time_H1[i][j], Open_H1[i][j], High_H1[i][j], etc. In these arrays each row is dedicated to the historical data of a certain currency. Thus,
using the loop by currency number for( i=1; i<=nomer_instr; i++ ) I overwrite the historical data Time_buf[j], High_buf[j] etc. with the corresponding rows of the arrays
Time_H1[i][j], High_H1[i][j] etc.
If you trade using ticks, you can use the current parameters from the zero bar. Naturally, the current parameters of the zero bar at the moment of
I have an Expert Advisor that uses bars instead of ticks. I have found out that when the EA is operating on bars
the values High_buf[0] and Low_buf[0] are not historical values at the moment of zero bar closing, they are some random values. Therefore if we include
parameters of the zero bar in a history sequence, the whole history sequence of the parameter will be distorted. That is why I do not use parameters of the zero bar.
Sorry it's so long.
Boris.45:
I will try to explain the idea I'm trying to implement in my Expert Advisor.
I wasn't asking about the idea :)
That's what I'm asking, what value returns the array element you mention?
Please advise!
How to change the background colour of currency pairs in the market overview
Or remove the colour altogether!
Thanks in advance!