Questions from Beginners MQL5 MT5 MetaTrader 5 - page 824
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
Thanks, how do I write a loop to find the number of the bar crossing the two MAs when the first two points of the algorithm are met and there are values of the two MAs on the first bar?
/
.
Aha, you solved it not through arrays after all.
Note: The solution through arrays (copying of LAST THREE values from the indicators into arrays First[], Second[] and Third[]) isCrossing of two iMAs- OnTick():
In your case (one value at a time), the loop will look like this:
MA1_curr - the value of the indicator MA1 on bar #i, MA1_prev - the value of the indicator MA1 on bar #i+1
MA2_curr - the value of the indicator MA2 on bar #i, MA2_prev - the value of the indicator MA2 on bar #i+1
When you get a crossing (the variable signal is either "-1" or "1") - the value of i will be the number of the bar where the crossing occurred.
This is the simplest algorithm for finding the crossover, but it is not the most accurate.
Yeah, you decided not to use arrays after all...
Thank you, your otherMA Cross EA was used as an example
I want to enter it on the third or fifth or...n bars after crossing
In your case (getting one value) the cycle will look like this
Why is there no exit from the loop when a crossover is found?
Can these conditions be put outside the loop?
.
Good afternoon. Could you please tell me in which format to download historical data from Finam or MFD.ru server to import quotes history? I cannot do it at all. I can only save it from txt to csv and that's all.
Good afternoon. Could you please tell me in which format to download historical data from Finam or MFD.ru server to import quotes history? I cannot do it at all. I can only save it from txt to csv and that's all.
You don't have to download anything in MetaTrader 5 :) - As soon as you connect to the trading server, the real tick history is available to you. Look towardsCopyTicks
In MetaTrader 5 you don't need to download anything :) - As soon as you connect to the trade server, the real tick history is available to you. Look towardsCopyTicks
I just need 10 years worth of Russian Stocks. My broker doesn't give me that much and is unlikely to find one.
Problem description
Sequence of operations
RSI.mqh
#property indicator_level1 30
#property indicator_level2 70
In the Calculaite description code. At the end of the line where the line goes through For, I added the function to change colour of the line if it is below this level.
ExtColorsBuffer [i] =0;
if (ExtRSIBuffer [i]> indicator_level2& indicator_levelcolor!=NULL) {
ExtColorsBuffer [i] =1;
}
if (ExtRSIBuffer [i]< indicator_level1& indicator_levelcolor!=NULL) {
ExtColorsBuffer [i] =2;
Expected result
I see the same as on the picture but when I open settings and change level indicator_level1 / 2 in the process of using the indicator I get a redraw. The indicator is re-drawn so if the line crosses a level it changes its colour. But for me it is on the same level as before :)
More info
...
5.0 Build 1755
Problem description
Sequence of operations
RSI.mqh
#property indicator_level1 30
#property indicator_level2 70
In the Calculaite description code. At the end of the line where the line goes through For, I added the function to change colour of the line if it is below this level.
ExtColorsBuffer [i] =0;
if (ExtRSIBuffer [i]> indicator_level2& indicator_levelcolor!=NULL) {
ExtColorsBuffer [i] =1;
}
if (ExtRSIBuffer [i]< indicator_level1& indicator_levelcolor!=NULL) {
ExtColorsBuffer [i] =2;
Expected result
I see the same as on the picture but when I open settings and change level indicator_level1 / 2 in the process of using the indicator I get a redraw. The indicator is re-drawn so if the line crosses a level it changes its colour. But for me it is on the same level as before :)
More info
...
5.0 Build 1755
Problem description
I would like to know why I don't like the answer in a separate topic.
This is the forum for trading, automated trading systems and strategy testing.
I need help in MQL5 #property indicator_level
Alexey Viktorov, 2018.01.31 09:06
Igor, we are both wrong. I didn't immediately understand the task...
Besides #property directive you can set the indicator level with the function
Accordingly, this level should be set in incoming indicator parameters. In this case, the level will be drawn by the specified value and it should be changed by this value.
Test case
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
Aleksey Rodionov, 2018.02.06 16:31
Here is an interesting one:
If you remove %G in pintf then value will not be displayed, but in Print it is displayed without %G
Also in Print the balance value 10000.0 is shown, but in printf just the integer 10000
I am more interested in what is the difference between Print and Printf and most importantly, why it is not shown without %G. I did not understand anything in the reference book.
Hello colleagues, I have a question, I am trying to insert a widget of my signal in the signature on the forum "forex money", but they have disabled or blocked HTML, is there any way to convert it to a URL?
Here's the code <iframe frameborder="0" width="220" height="140" src="https://www.mql5.com/ru/signals/widget/signal/328l?t=green"></iframe>