[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 459

 
Vinin:

Closing on a stop loss does not mean that the trade is losing, and vice versa. Unless, of course, stops and takes were set at the opening and have not been touched again.
were set at the opening and were not touched again
 
belck:
have been set at opening and have not been touched again


Then it is best to look at the comments, when closing on stop, sl is added, on take tp. But string functions always add slack. You can just check profit(). Positive or negative. Unless the Expert Advisor closes positions by itself, of course.

And the history should be checked from the end.

 
Vinin:


Then the best thing to do is to look at the comments, when you close on a stop it adds a sl, on a take tp. But string functions always add brakes. You can just check profit(). Positive or negative. Unless, of course, the Expert Advisor closes positions by itself.

And check the history from the end.

I was thinking of trying to tie a martini, but I saw that there was no point, as there were so many losses, and it was not relevant.

I also did not know about the differences between the two versions of the forex.

 

Tell me why in my case the alert doesn't work, there doesn't seem to be any error. I'm trying to output an error via alert or print - no reaction. Without for loop it works fine, but with it Alert doesn't work.

   int i = 0;
   double MACD = iCustom(Symbol(),0,"MyMACD",5,21,1,0,i);
   
   
     
     for(i=0;MACD > 0; )
       {
       i++;
       }
     
   Alert("Ошибка ",GetLastError());
 
sss2019:

Tell me why in my case the alert doesn't work, there doesn't seem to be any error. I'm trying to output an error via alert or print - no reaction. Without for loop, everything works fine, but Alert doesn't work with it.

Is this a joke? The code is a joke. Is it a joke? It's not right at all.

Here's a joke from me:

void start()
{
 int i++;
 while(true) Sleep(2147000000);
 Alert(i);
}
For some reason my alert doesn't work :-(
 
Zhunko:
Is this a joke? The code is a joke. A joke? It's completely wrong.

And what is the mistake, please write it down.
 
sss2019:

And what is the error, please write it down.
That's the point, it's not clear what you want from this code.
 
Zhunko:
That's the point, it's not clear what you want from this code.

I need to look for MACD value until it is less than 0 or close to it.
 
sss2019:

I have to look for the MACD value until it is less than 0 or close to it.

So you're not looking for it anywhere.
 
sss2019:

I need to look for the MACD value until it is less than 0 or close to it.
   int i = 0;
   double MACD = 1;
   
   for (i=0; MACD > 0; i++) MACD = iCustom(Symbol(),0,"MyMACD",5,21,1,0,i);
Reason: