Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 803
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
Maybe there are examples. Visually it would be easier to understand. Thank you.
Hello. I'm reading a textbook. There are some examples of how to write indicators. I have a question concerning the separatewindow.mq4 indicator. You can set the number of calculated bars there. What if you need to specify the calculation from the opening price of the day (or from zero) to the closing price of the day? How should I do it? I tried to search for a solution, but did not find it.
Here is the opening price of the day in the current timeframe
Hello! Is it possible to find the right bar on the history to the RIGHT of a given bar by condition? Thank you.
Hello! Is it possible to find the right bar on the history to the RIGHT of a given bar by condition? Thank you.
Yes, we can.
You can.
How do you do it? Can you tell me about it, please?
How do you find a given bar?
How do you find a given bar?
It took me a long time, but I wrote a function like this:
double GetPatt5barsDN()
{
double low3 = 0;
int index = 0;
for(int i=1; i<20; i++)
{
if
((Close[i] > Open[i]) &&
(Close[i+1] > Open[i+1]) &&
(Close[i+2] > Open[i+2]) && //Low[i+2] is needed on this candle
(Close[i+3] < Open[i+3]) &&
(Close[i+4] < Open[i+4])
low3 = Low[i+2];
index = i+2;
}
return(low3);
}
here is the opening price of the day in the current TF
Thank you, Igor. But I have not formulated it correctly. The indicator is calculated and drawn for a specified number of bars (50 in this case) and in the separate window. It needs not the open price but the first bar of the day to indicate the MA. But anyway, thank you.
here is the opening price of the day on the current TF
Can you tell me what is written in
int i,limit=prev_calculated==0 ? rates_total-1 : rates_total-prev_calculated;
"==" , "?" , ": "
?
It took me a long time, but I wrote a function like this:
Return also the index in the function parameter passed by the link