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

 
FAQ:
Look in the list of objects, maybe they are there, but with a crooked price, and, or time

I checked. No, they're not. I have tried everything.
 
It's just that all the other indicators I have are working. This must be the only one. I suspect MODE TICKVALUE, but don't know what to replace it with.
 
Fox_RM:

Checked no. I've tried everything.

So you have one name for all objects, so you create the same object all the time.
 
FAQ:

So you have one name for all objects, so you create the same object all the time.

I added +Time[i] to the name
 
If you run from an init, the indicator will not find its window. In any case, print out what ObjectCreate() returns and what goes into your function.
 
FAQ:
If you run from an init, the indicator will not find its window. This may be the reason. in any case, print out what ObjectCreate() returns to you and what goes into your function.
Got it. Ok, thanks, I'll try it out!
 

Can you please tell me what code is needed to make a long close at the maximum of the current EMA?

Doesn't anyone know how to write it?

Suppose, in the if statement, we specify to open a position at the minimum of the MA and to close it at the maximum.

But a stop is triggered and then the program starts to frantically open and

immediately close the long position, since daily bar conditions are fulfilled and vice versa.

if ( iLow (Symbol(),Period(),0) <= MA_2_t) // 
{ 
Opn_B=true; // Критерий откр. Buy
Cls_S=true; //  Привожу эту строку для наглядности, зацикливания постоянного открытия и закрытия позиции. 
} 

HOW TO BYPASS THIS SITUATION, I.E. TO SPECIFY THAT THE LEVEL OF CLOSING THE LONG IS THE CURRENT MAXIMUM OF THE YEMA.

I have been working on this question for two days, but I have practically no experience in MQL .

 

I wrote a question herehttps://www.mql5.com/ru/forum/142582/page326#790513 .

If you don't look into my functions please advise how to implement so that an order is sent when a level of some indicator, e.g. rsi, is touched.

I.e. there is a level, for example, 50. The Expert Advisor should send a buy order when the price has touched this level. And only at this level. If the indicator value is higher, we will not buy. As I have implemented this task, you can see by following the link above. I would like to ask you to correct it. For some reason, some orders do not open where they should.

 
Answer, please, who knows, is it necessary to keep the proxy server on or not?
 
hoz:

I wrote a question herehttps://www.mql5.com/ru/forum/142582/page326#790513 .

If you don't look into my functions please advise how to implement so that an order is sent when a level of some indicator, e.g. rsi, is touched.

I.e. there is a level, for example, 50. The Expert Advisor should send a buy order when the price has touched this level. And only at this level. If the indicator value is higher, we will not buy. As I have implemented this task, you can see by following the link above. I would like to ask you to correct it. For some reason, some of the orders do not open where they should.


1) You must understand exactly what "touched" means.

2) Remember that you can know the position of the indicator (as well as any line on the chart) you can know only at the open candle point, what happens inside the candle you can learn only when you go down in TF (to a smaller), and also only by time (opening price).

3) You can not identify the "touch" - you can only understand that at one point, one line was below the other, and the next one was higher (ie, crossing).

Once you realise this for yourself, everything will go right back to normal.

Reason: