Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 530

 
Vitaly Muzichenko:

How to record, Alexey answered. It would be great if he could write the code, as he sees it, if he has time and wish).

Alexey hasn't answered anything yet, I don't understand how to write the condition"first bear, second bull, third bear" in the loop

 
Vitaly Muzichenko:

PS. By the way, is it an indicator or an EA?

Probably an indicator, can an EA do the whole story without a tester?

 
PolarSeaman:

Probably an indicator, is it possible to go through all the history with an EA without a tester?

It makes no difference what you pass through, it all depends on what you need to do. You can also go through the script

P.S. You can forge this indicator, and on the basis of it to do what you need, there's 90% of the code is ready

Candle_row
Candle_row
  • votes: 14
  • 2017.11.22
  • Vitaly Muzichenko
  • www.mql5.com
Индикатор отслеживает непрерывную последовательность баров одного направления и ставит на них метки. В индикаторе есть Alert для оповещения при последовательном направлении N-свечей. mCandle_row - только в главном окне. sCandle_row - с графиком в подокне. Входные параметры Font size arrow - размер шрифта; Bull arrow candle - цвет Bull...
 
Vitaly Muzichenko:

It makes no difference what you do, it all depends on what you want to do. You can also go through the script

Now the goal is to find out the longest sequence, the result will depend on further implementation. Maybe count how many sequences of N candles with what periodicity, or...

 
Vitaly Muzichenko:

P.S. You can dig this indicator and make what you need on its basis, the code is 90% ready there.

mql5, not even opened yet. But I found one on mql4 from how to make a multidirectional sequence here?

     BER=0;
      for(int y=i+1;y<=i+BarCount;y++)
        {
         
         if(Open[y]<Close[y]){BER++;}
        }
 
PolarSeaman:

mql5 yet, haven't even opened it.

And it's time to open it and close mt4 and forget about it.
Here is mt4, find the difference in the code from mt5

Candle_row
Candle_row
  • votes: 11
  • 2017.11.22
  • Vitaly Muzichenko
  • www.mql5.com
Индикатор отслеживает непрерывную последовательность баров одного направления и ставит на них метки. В индикаторе есть Alert для оповещения при последовательном направлении N-свечей. mCandle_row - только в главном окне. sCandle_row - с графиком в подокне. Входные параметры Font size arrow - размер шрифта; Bull arrow candle - цвет Bull...
 
Vitaly Muzichenko:

And it's time to open, and to close mt4 and forget about it.
Here is mt4, find the difference in the code from mt5

When one direction is clear, but how do you do multi-directional ones?

 
PolarSeaman:

When in one direction I understand, but how do I make multidirectional ones?

the same way, but set the flag differently, and add a global variable to write the maximum value

 
Vitaly Muzichenko:

the same, but to set the flag differently, and add a global variable to write the maximum value

if(open[i]<close[i]&&open[i+1]>close[i+1])

I'm asking if this is wrong, how do you want the sequence to be tracked?

 
PolarSeaman:

I'm asking about this, it's not right, how do you trace the sequence?

You compare the next bar, and if the sequence is broken, reset the flag and record how many were correct, and go on in the loop.

It is enough to find out that the bar is bullish, and the next one is bearish. If the next one is the same as the previous one, then you write down the value and reset the flag. And so on to the end

Reason: