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

 

FEAR:

good answer

And most importantly, the right one...
 
VladislavVG:


bool SLowTen = (Open[1]==Low[1]); // no lower shadow of a bullish candlestick

Search the forum for proper comparison of real numbers.

Anyone can offend an artist, you should have written it correctly. I like criticism very much - a constructive one. I know about ugly code myself.

I have one more question about it - how to write in a condition that the size of a candle is more than 60 points (in five digits).

 
alexey1979621:

Anyone can be offended by an artist, you should have written it properly. I like criticism very much - constructive criticism. I know about the ugly code myself.

Here is another question about it - how to write in the condition that the candle's size is larger than 60 points (in five-digits).


Comparison double:

if (NormalizeDouble(p1-p2,Digits)<0.5*Point) {
   // Значит равны
   }

How to prescribe in the condition that the size of the candle is more than 60 pips (on five dig its).

if (размер_свечи>60*Point) {}
 
artmedia70:

Comparison double:

How to prescribe in the condition that the size of the candle is more than 60 pips (on a five digit).


Forgive my obtuseness, but p1 and p2 are High and Low respectively? And what does 0.5 mean?

Applied to my existing code

   double STelo = MathAbs(Close[1]-Open[1])/Point; // тело бычьей свечи
   double SHighTen = (High[1]-Close[1])/Point; // верхняя тень бычьей свечи
   bool SLowTen = (Open[1]==Low[1]);    // отсутствие нижней тени бычьей свечи
  
   
   double Razmer_1 = (High[1]-Low[1])/Point; // размер свечи

        
   if(Volume[0]>1) return;

   if (Open[1]<Close[1] && SHighTen > 5*STelo && SLowTen == true && Razmer_1 > 60*Point)


Я правильно должен прописать: 
   double STelo = MathAbs(Close[1]-Open[1])/Point; // тело бычьей свечи
   double SHighTen = (High[1]-Close[1])/Point; // верхняя тень бычьей свечи
   bool SLowTen;

   if (NormalizeDouble(Open[1]-Low[1],Digits)<0.5*Point)  // отсутствие нижней тени бычьей свечи
  
   
   double Razmer_1 = (High[1]-Low[1])/Point; 

        
   if(Volume[0]>1) return;

   if (Open[1]<Close[1] && SHighTen > 5*STelo && SLowTen == true && Razmer_1 > 60*Point) // продажа
 
alexey1979621:

Anyone can be offended by an artist, you should have written it properly. I like criticism very much - constructive criticism. I know about the ugly code myself.

That's just one more question about it - how to write in the condition that the size of the candle is more than 60 points (in five-digits).



This is basic knowledge that you need to understand, not just look it up. The question is so chewed up on the forum that only the very lazy cannot find the answer and figure it out. By the way, it is much more useful for you.

But what about the ugliness of the code - that's not for me. It seems to me that it's quite normal to introduce additional variables to make code more readable.

 
artmedia70:

Comparison double:



In this case.

if (NormalizeDouble(p1-p2,Digits)<0.5*Point) {
   

NormalizeDouble() is redundant ;).

 
VladislavVG:


In this case

NormalizeDouble() is redundant ;).

And then explain to him why there is no normalization here and normalized prices in trade orders? That's why I put normalization here, so that he won't round his eyes when he sends non-normalized prices in trade orders.
 
artmedia70:
And then explain to him why there is no normalisation here, but with prices in trade orders with normalisation? That's why I put normalisation in here, so that he doesn't round his eyes when he sends non-normalised prices in the trade order.


)))))))))))))))))) yes, that's an argument.
 
VladislavVG:

)))))))))))))))))) yes, that's an argument.
I think he will eventually learn where he needs to and where he doesn't need to. At the same time, he will immediately know that normalisation is necessary. And when it is possible to do without it, it will be on the next stage of learning... ;) From such considerations...
 
Folks, please help. It's been five days now and I can't figure it out. I have made my EA to modify the stop loss of an order when the right criteria are triggered. And stop loss - which should be put, take profit of the last closed order. But when modification starts, the robot always sets a Stop Loss of 1.0000. I do not understand what is wrong. I have already wracked my brains. Does anybody have any variants, how to take the take profit of the previous order against the stop loss of the current order?