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

 
Vitaly Muzichenko:

:D


Thank you, Good Man!

 

Here it is more detailed

 
Ras al Ghul:

Either your variant is very complicated, or I don't understand the value you're talking about...


In my variant, the highlighted piece is sworn out:

'Array' - array required.

Don't we put the indicator value into the array in this way?



Note that there must obviously be more than one value in the array for correct calculation.Vitaly Muzichenko rightly pointed out the error, I won't repeat it once again.

 
voron_026:

Yes, you are right. The rectangles are drawn on the same coordinates. Solved the problem as follows:

Added variableTimeFrame, for quick change of calculated timeframe

Well, yeah, that's about right.

Note theUseDojiCandles equality sign.

if(UseDojiCandles == true && Doji() == 1 && New_Bar == true)
 
Aleksey Vyazmikin:

Yeah, that's about right.

Note the equality sign ofUseDojiCandles

So you expand the answer that there is a comparison "==" and there is an assignment "="

 
Vitaly Muzichenko:

So you expand the answer, that there is a comparison "==" and there is an assignment "=".


The man clearly knows, he just made a typo.

 
Aleksey Vyazmikin:

The man clearly knows, he just made a typo.


Yes, that's right, thanks for the tip. Already corrected it.

I'm working on it.

Hooked up the hammer and inverted hammer pattern
 
voron_026:

Yes, that's right, thanks for the tip. Already fixed it.

I am working on it now.

I have connected "Hammer" and "Inverted Hammer" patterns

I have an assumption that similar patterns will work differently when prices are moving north and south - I think this should be taken into account when interpreting them.

 
  for(int i=0; i<limit; i++) {
    Last[i] = Symbol1_Vol*Vol1*iClose(Symbol1_Name,0,iBarShift(Symbol1_Name,0,Time[i])) - 
              Symbol2_Vol*Vol2*iClose(Symbol2_Name,0,iBarShift(Symbol2_Name,0,Time[i]));



 for(int i=0; i<limit; i++) {
    if(ButtonSt) { // кнопка выбора, отображать Bands, или Envelopes
     MA[i]=iMAOnArray(Last,0,Env_Period,0,MODE_SMA,i);
     LineUp[i]=iEnvelopesOnArray(Last,0,Env_Period,MODE_SMA,0,Env_Dev,MODE_UPPER,i);
     LineDn[i]=iEnvelopesOnArray(Last,0,Env_Period,MODE_SMA,0,Env_Dev,MODE_LOWER,i);
    } else {
     MA[i]=iMAOnArray(Last,0,BB_Period,0,MODE_SMA,i);
     LineUp[i]=iBandsOnArray(Last,0,BB_Period,BB_Dev,0,MODE_UPPER,i);
     LineDn[i]=iBandsOnArray(Last,0,BB_Period,BB_Dev,0,MODE_LOWER,i);
    }
  }

Technically, how to do it seems to be clear.

for(int i=0; i<limit; i++) {
    RSI[i] = iRSI(Symbol(),TimeFrame,14,PRICE_CLOSE,i);
  }

for(int i=0; i<limit; i++) {
    BandsMn[i]=iBandsOnArray(RSI,0,BB_Period,BB_Dev,0,MODE_MAIN,i);
    BandsUp[i]=iBandsOnArray(RSI,0,BB_Period,BB_Dev,0,MODE_UPPER,i);
    BandsDn[i]=iBandsOnArray(RSI,0,BB_Period,BB_Dev,0,MODE_LOWER,i);
  }

But the essence of the process is not clear:

e.g. what value should the limit have and why exactly that value?

Judging by the variable i at the end of indicator functions, we are entering data with a shift.

That is, limit should depend on the period of the indicator?


Thank you for your attention and patience.

 
Ras al Ghul:

Technically, how to do it seems to be clear.

But the essence of the process is not clear:

e.g. what value should the limit have and why exactly that value?

Judging by the variable i at the end of indicator functions, we introduce the data with a shift.

That is, limit should depend on the period of the indicator?


Thank you for your attention and patience.

Limit - the number of bars in the chart; it needs to display the indicator until the end of the history when scrolling the history.