Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1405
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
Question on
What would be the index of the initial M1 bar if I were to draw a trend line on the past H1?
And by the start and end time of the line it is not clear how to find it.
Sorry, if I am not explaining it clearly.
It is difficult for me.
Besides indices there is also time...
Question on
What would be the index of the initial M1 bar if I were to draw a trend line on the past H1?
And by the start and end time of the line it is not clear how to find it.
Sorry, if I am not explaining it clearly.
It is difficult for me.
H1 has a bar open time - it is iTime()
To understand the index of a bar with this time on M1 there is iBarShift()
It remains to know the minimum and maximum bar at M1 using iHighest() and iLowest()
Hello! 2021.03.01_19:49 GMT+3. Wanted to improve the results of my trading system. But it seems that iOpen() and iClose() functions do not work. In the strategy tester, I checked the Expert Advisor, among 175 trades, only 81 of them seem to be closed by the conditions described in the code above. This code does not work. What can we do to make it work? How about asking MetaQuotes programmers? Now I'll look through the strategy tester logs and post how rarely these functions work. Found it. 20210228.log . Time 13:53:02.192, open #155, iCloseB()=1.3434. Attached is the log file. Now I hope someone can tell me what to do with these iClose() and iOpen() functions to make them work. Because the trading system is not efficient enough. That's all for now. 2021.03.01_20:12 GMT+3.
The code seems fine, but I'm confused by the slippage...very small, put more slippage and check
Good heavens! Did I want something? Did I ask for anything? Who do you think I am?
Hello! 2021.03.01_19:49 GMT+3. Wanted to improve the results of my trading system. But it seems that iOpen() and iClose() functions do not work. In the strategy tester, I have tested the Expert Advisor, among 175 trades, only 81 of them seem to be closed by the conditions described in the code above. This code does not work. What can we do to make it work? How about asking MetaQuotes programmers? Now I'll look through the strategy tester's logs and post how rarely these functions work. Found it. 20210228.log . Time 13:53:02.192, open #155, iCloseB()=1.3434. Attached is the log file. Now I hope someone can tell me what to do with these iClose() and iOpen() functions to make them work. Because the trading system is not efficient enough. That's all for now. 2021.03.01_20:12 GMT+3.
Try to rewrite it that way, because it's the same thing.
Or, that's how I write it.
Hi all!
Here's the problem:
Price crosses the MA down or up.
I need to memorise it in order to use it later in calculating the number of points passed.
This is how I understand it:
double FixPrice; // variable
bool Fix=false; // marker
if ( Fix==false) {
if ( Close[0] > MA_lo ) FixPrice = Close[0];
} // measure until the price crosses the MA
if ( Close[0] < MA_lo ) Fix=true;
if ( Fix==true) FixPrice_L = FixPrice ;
And here is the next hitch - the price is not memorized!
This is how you want it to be memorised.
But keep in mind that at the opening of a candle.
Therefore, if you need immediate, real-time data, you'd better use
It's better to normalize all prices, which will be compared in the condition, so you won't be surprised :)
Чтобы перевернуть ФИБО поменяй местами р1 и р2
С алертом я не помогу(
To reverse FIBO, swap p1 and p2
I can't help with the alerts(
Hi, thanks, got two different solutions, yours is the easiest....