[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 185

 

Question.

Why the condition doesn't go

if(Close_1>Open_1 && ( Close_1-Open_1)>=30*Point) buffer[i]=High_1;

Conditional example. \

Looks for everything...but not the size in points... Checked it via Comment(waste,5);

Ie... if(Close_1>Open_1) condition looks fine, but the condition ( Close_1>Open_1 && Close_1-Open_1)>=30*Point) why NOT...!!!

What am I doing wrong?

Thanks in advance!!!)):

 
deyron:
If there were attempts to open an order, it would be shown in the messages. And if there is no attempt to open an order, why would there be an error. The question is whether the conditions of Macha passing through the levels are set correctly. Why do the orders open much later than expected when the parameters are hardcoded?

Print() and GetLastError() in the right places would answer all your questions.
 

Good afternoon!

I need to find the value of the last point of a past Parabolic series. Let's say this one:

I've written a function to find it:

double FindLastLevel ()                             
 {double Level; int i;
  for (i=0; Level==0; i++) 
  {double SAR0=iSAR(Symbol(),Period(), Step, Maximum, i),
          SAR1=iSAR(Symbol(),Period(), Step, Maximum, i+1),
          SAR2=iSAR(Symbol(),Period(), Step, Maximum, i+2);

   if (SAR0>SAR1){if(SAR1<SAR2){Level=SAR2; return (Level);}}
   if (SAR0<SAR1){if(SAR1>SAR2){Level=SAR2;return (Level);}}
  }}

I.e. it recalculates each value of Parabolic, starting from the current bar. As soon as the condition of gradual decrease/increase of values is violated, the function returns the value on that bar which "broke" the trend. However, if there was a jump of 1 bar, like this one:


The function "doesn't see" it.

Please advise how to rewrite the function? Maybe there is a ready solution?

 
Heroix:

Good afternoon!

I need to find the value of the last point of a past Parabolic series. Let's say this one:

I've written a function to find it:

I.e. it recalculates each value of Parabolic, starting from the current bar. As soon as the condition of gradual decrease/increase of values is violated, the function returns the value on that bar which "broke" the trend. However, if there was a jump of 1 bar, like this one:


The function "doesn't see" it.

Please advise how to rewrite the function? Maybe there is a ready solution?

You also have to look at the position in relation to the price.
 
Zhunko:
You also have to look at the position in relation to the price.

I.e. compare not only the indicator itself, but also the position of its values at i relative to the price value at i, say?
 

Check out this advisor to see if there is anything interesting https://www.mql5.com/ru/code/10649

 
People tell me why if(OPN<CLS && (CLS-OPN)>=50*Point) is not looking for????
 
nlp2311:

Question.

Why the condition doesn't go

if(Close_1>Open_1 && ( Close_1-Open_1)>=30*Point) buffer[i]=High_1;

...

Instead of

if(Close_1>Open_1 && ( Close_1-Open_1)>=30*Point) buffer[i]=High_1;

make it like this

if (Close_1>Open_1)
{  if (Close_1-Open_1>=30*Point) buffer[i]=High_1;
}

Post here the part of the code where this condition is present. Maybe there is an error in the loop. Publish the code on the forum using SRC.

 
paladin80:

Try this instead of

like this.

Post here the part of the code where this condition is present. Maybe there is an error in the loop. On the forum, post the code using SRC.


Tried.... doesn't work.

I've put brackets in different ways, twisted as I could... I can't anymore!!!!!!!!!!!))))

That's why I'm asking HOW I can do it without any distortions):?

It seems that this creep MT4 doesn't see pips by condition if(.....) at all...((

What's more, I separately wrote an indicator to hold this condition... I can't(...):

WHY is it like that?

 
nlp2311:

Here it is.... bastard(((!!!!

already angry...


What did you check?
Reason: