Hello! There is an array of closing prices of 30 min bars of the EURUSD pair, from 01.01.2012 to 31.12.2012. I get it with function CopyClose. But CopyClose[0] doesn't equal to close price of last bar on 31.12.2012 in terminal, if I open chart. Please tell me what I'm doing wrong. Why the prices from CopyClose and the actual price on the chart do not coincide
Before you call Close_buf[0] you must use ArraySetAsSeries. Once, during entire operation of EA/Script/indicator code.
ryzhak.vladimir: Yes it worked, thank you! Although it's still not clear why the prices only matched when the exact date was specified down to the seconds
Probably because 2012.12.31 defaults to 2012.12.31 00:00:00, not 2012.12.31 24:00:00
The quote from the documentation about the CopyBuffer function:"The data elements to be copied (indicator buffer with index buffer_num) are counted from the start position from the present to the past, i.e. the start position equal to 0 means the current bar (indicator value for the current bar). "But in practice, in order to have the current bar in the 0th element, we have to apply ArraySetAsSeries(Close_buf,true). But it is written in documentation that by default it copies the last bar in the 0th element. Why is there such a difference?
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
ryzhak.vladimir: The quote from the documentation about the CopyBuffer function:"The data elements to be copied (indicator buffer with index buffer_num) are counted from the start position from the present to the past, i.e. the start position equal to 0 means the current bar (indicator value for the current bar). "But in practice, in order to have the current bar in the 0th element, we have to apply ArraySetAsSeries(Close_buf,true). But it is written in documentation that by default it copies the last bar in the 0th element. Why is there such a difference?
Look at the figure more closely. Where is the 'start_pos' item being copied?
Faced the problem of psychological direction. I wrote a trend EA and it seems to be successful. Now I am writing a flat EA and... This is the 5th time this EA is reduced to the previous one, as if I am stuck with only one algorithm. Everything starts out as "new", but after the algorithm is structured, I start writing an EA that starts to adjust to the first (successful) one in every possible way.
If anyone has faced such a thing - tell me how to "get rid" of the imposing algorithm, which only brings down the deposit in the flat.
Faced the problem of psychological direction. I wrote a trend EA and it seems to be successful. Now I am writing a flat EA and... This is the 5th time this EA is reduced to the previous one, as if I am stuck with only one algorithm. Everything starts out as "new", but after the algorithm is structured, I start writing an EA that starts to adjust to the first (successful) one in every possible way.
If anyone has faced such a thing - tell me how to "get rid" of the algorithm, which only brings down the deposit in the flat.
Your trader has not a psychological problem, but a system problem - the lack of precise signs of difference between the trend and the flat. Once you understand this point, everything will work out for you.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello! There is an array of closing prices of 30 min bars of the EURUSD pair, from 01.01.2012 to 31.12.2012. I get it with function CopyClose. But CopyClose[0] doesn't equal to close price of last bar on 31.12.2012 in terminal, if I open chart. Please tell me what I'm doing wrong. Why the prices from CopyClose and the actual price on the chart do not coincide
Before you call Close_buf[0] you must use ArraySetAsSeries. Once, during entire operation of EA/Script/indicator code.
ArraySetAsSeries must be used before calling Close_buf[0]. Once, for the entire duration of the EA/script/indicator code.
It still does not match, it shows 1.32308 instead of 1.31964 (last bar close price in 2012)
Still doesn't match, displays 1.32308 instead of 1.31964 (closing price of last bar in 2012)
Yes it worked, thank you! Although it's still not clear why the prices only matched when the exact date was specified down to the seconds
Probably because 2012.12.31 defaults to 2012.12.31 00:00:00, not 2012.12.31 24:00:00
I wrote a trend EA and it seems to be successful. Now I am writing a flat EA and... This is the 5th time this EA is reduced to the previous one, as if I am stuck with only one algorithm. Everything starts out as "new", but after the algorithm is structured, I start writing an EA that starts to adjust to the first (successful) one in every possible way.
If anyone has faced such a thing - tell me how to "get rid" of the imposing algorithm, which only brings down the deposit in the flat.
Faced the problem of psychological direction.
I wrote a trend EA and it seems to be successful. Now I am writing a flat EA and... This is the 5th time this EA is reduced to the previous one, as if I am stuck with only one algorithm. Everything starts out as "new", but after the algorithm is structured, I start writing an EA that starts to adjust to the first (successful) one in every possible way.
If anyone has faced such a thing - tell me how to "get rid" of the algorithm, which only brings down the deposit in the flat.