Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1107

 
blo0ds.:
Well yes nonsense I wrote in the last post) Did as you wrote changing the ray) Everything works!!!! Thank you. Just do not understand how to put + here(((

How crazy is that?


We have 2 right angled triangles. BC / AB = DE / AD = tg(A)

AB = 22 bars the price at point C is, at point B is. Their difference divided by _Point is the number of points or BC. Hence DE = (BC/AB)*101 at _Points...

Price at point E = Price at point A+DE*_Point

That is all...

This allows you to get the required value without resorting to graphical elements.

 

Hello.

Can you tell me what's wrong? The indicator doesn't work in the tester and neither does the Expert Advisor on it.

Gives out an error:

2016.10.20 20:10:38.734 2016.10.03 00:09 Testing pass stopped due to a critical error in the EA

2016.10.20 20 20:10:38.640 2016.10.03 00:08 PrizeMACD_s4_s2_p72 EURUSD,M1: array out of range in 'PrizeMACD_s4_s2_p72.mq4' (147,17)

2016.10.20 20:10:38.625 PrizeMACD_s4_s2_p72 inputs: base=500; Multiplikator=10; InpSignalSMA=9;

Which points to the i in a1_buffer

   if(prev_calculated==0)// first calculation    
     {
      limit=rates_total-TOCHKA_VHODA;
      //--- set empty value for first limit bars
// Всего баров  rates_total, i может принимать значения от rates_total - 1 до 0
//Если rates_total=1000 , а TOCHKA_VHODA =200, и я хочу обнулить 200 первых значений 
// то эти значения будут от 999 до 800 включительно. Тоесть limit=rates_total-TOCHKA_VHODA -1 = 799 это следующая 
//расчетная точка. А если 800 желательно пересчитать?
// Если было посчитано prev_calculated = 300 баров то это бары под номерами от 999 до 700 из 1000 баров 
//но 700 бар нам нужно персчитать снова тогда лимит достаточно limit=rates_total-prev_calculated;
      for(i=rates_total-1;i>=limit;i--)
      {
       a1_Buffer[i]=0.00001;
       a2_Buffer[i]=0.00001;
       a3_Buffer[i]=0.00001;
       a4_Buffer[i]=0.00001;
       a5_Buffer[i]=0.00001;
       a6_Buffer[i]=0.00001;
      }

     }
   else limit=rates_total-prev_calculated;
//--- main loop
   for(i=limit;i>=0 && !IsStopped();i--)
   {
//===========================================================================================
   Znach = iMA(NULL,0,base*2,0,MODE_SMA,PRICE_OPEN,i);

I think I've got it all worked out for me on my fingers, where am I wrong?

Files:
 
AlexeyVik:

How crazy is that?


We have 2 right triangles. BC / AB = DE / AD = tg(A)

AB = 22 bars the price at point C is, at point B is. Their difference divided by _Point is the number of pips or BC. Hence DE = (BC/AB)*101 at _Points...

Price at point E = Price at point A+DE*_Point

That is all...

This allows you to get the required value without resorting to graphical elements.

Calculation with specific numbers.


OS = (1.09869-1.09795)/0.00001 = 74.

tg(A) = 74/22 = 3.3636363636

DE = 3.3636363636 * 101 = 339.72727272

The price at point E = 1.09795+339.72727272*0.00001 = 1.10134727272 normalized to 5 digits 1.10135, as required.

 
what is the latest build of mt4 ? 1012 ?
 
AlexeyVik:

Calculation with specific numbers.


OS = (1.09869-1.09795)/0.00001 = 74.

tg(A) = 74/22 = 3.3636363636

DE = 3.363636363636 * 101 = 339.72727272

Price at point E = 1.09795+339.72727272*0.00001 = 1.10134727272 normalized to 5 digits 1.10135, as required.

And also, Archimedes lever AC*E - AE*C+EC*A=0, then E=( AE*C-EC*A)/AC or ( 102*1.09869- 79*1.09795)/23 =1.101232, perhaps somewhere with the number of intervals miscalculated.:)

 
filpan:
Also, Archimedes lever AC*E - AE*C+EC*A=0, then E=( AE*C-EC*A)/AC or ( 102*1.09869- 79*1.09795)/23 =1.101232, maybe somewhere with the number of intervals miscalculated.:)

101 and 22 and you have 102 and 23.

 
AlexeyVik:

101 and 22 and you have 102 and 23


Yeah, 1.10134727272727.
 
filpan:

Hello.

Can you tell me what's wrong? The indicator doesn't work in the tester and neither does the Expert Advisor on it.

Gives out an error:

2016.10.20 20:10:38.734 2016.10.03 00:09 Testing pass stopped due to a critical error in the EA

2016.10.20 20 20:10:38.640 2016.10.03 00:08 PrizeMACD_s4_s2_p72 EURUSD,M1: array out of range in 'PrizeMACD_s4_s2_p72.mq4' (147,17)

2016.10.20 20:10:38.625 PrizeMACD_s4_s2_p72 inputs: base=500; Multiplikator=10; InpSignalSMA=9;

Which points to the i in a1_buffer

I think I've got it all on my fingers, where am I wrong?

limit turns out to be negative:

 
Sepulca:

The result is negative:

Thank you, I will look into it.

What could it be related to? To the gaps in the history? I have over 1000 bars on all my charts.

 
Sepulca:

The result is negative:

YES, thanks again. Reduced the base parameter to 200 (the POINT parameter should have been 425) the indicator worked in the tester using the date. But if I use all history it still does not work. It shows the same error.