Questions from Beginners MQL5 MT5 MetaTrader 5 - page 127

 

Good afternoon.

I wrote an EA that opens a position with already set SL and TP levels. As soon as the next bar starts, TP level disappears and TP changes to zero in the position description. The position is open, the price has not reached the TP, SL remains there, the buy price line is also there. As long as the bar at which the position is opened lasts, TP can be changed manually - it changes and stays there. But as soon as the next bar is formed, TP disappears both automatically and manually. And when I try to return it manually after the level has disappeared, it disappears again (apparently, with a new tick). In the code, TP is set once at order description and even the variable corresponding to TP does not appear anywhere else - only at order description. What "forces" may remove the TP level?

Thank you in advance.

 
lord1952:
Please advise, I just started to learn mql5, I downloaded an advisor, it is displayed in the navigator, I install it on the chart, but it is not installed....why???????????
ask where you downloaded it)
 
Do brokers block the copying of signals in their terminals? I mean the function of copying signals is installed in the terminal itself, it does not work with me at traidfort and roboforex, I have been struggling for a day, in the terminal my trade markets everything works
Торговые сигналы
Торговые сигналы
  • www.mql5.com
Торговые Сигналы для MetaTrader: копирование сделок, мониторинг счета, автоматическое исполнение сигналов и социальный трейдинг
 
Hello, I have a simple question, but I can not find anywhere to answer, if the signal has a balance of eg 1000 dollars and I only have 100 and I want to copy his transactions, how to make it copy the coefficient, because if he will not have a margin of 10%, I will go to zero, and another question, I have to set the same leverage as the signal?
 
s07641069:
Hello, I have a simple question, but I can't find the answer anywhere. If the signal has a balance of e.g. 1000 dollars and I only have 100 and I want to copy his deals, how should I copy the deals with coefficient, because if he has a 10% leverage, I will break even.
In the settings you specify the % of the supplier's volume, there is an article on the website (I couldn't find it, I was in a hurry) Look in the terminal, you can figure it out yourself.
 
s07641069:
Hello, I have a simple question, but I can not find anywhere to answer it. If the signal has a balance of eg 1000 dollars and I only have 100 and I want to copy his deals, how can I make it copy with a coefficient, because if he has a margin of 10%, I will go to zero, and another question, I have to put in the settings the same leverage as the signal?

https://www.metatrader5.com/ru/terminal/help/signals/signal_subscriber

https://www.metatrader5.com/ru/terminal/help/signals/signal_subscriber

 
Hello! I have 2 indicators (different, any, e.g. SAR and MA) not getting along in my Expert Advisor. Separately, everything works fine, but if together, the second indicator gives out 4806! I have already solved my problem! I've already tried to connect both class and icustom.
 
temass:
Hello! I have 2 indicators (different, any, e.g. SAR and MA) not getting along in my Expert Advisor. Separately, everything works fine, but if together, the second indicator gives out 4806! I have already solved my problem! I tried to connect the class as well as with icustom.
show code
 
DC2008:
Show code
void OnInit()
{
hdl_ama = iAMA(_Symbol,_Period,5,2,4,0,PRICE_CLOSE);
hdl_sar = iSAR(_Symbol,_Period,0.02,0.2);
SetIndexBuffer(0,sar,INDICATOR_DATA);
SetIndexBuffer(1,ama,INDICATOR_DATA);
ArraySetAsSeries(ama,true);
ArraySetAsSeries(sar,true);
}

void OnTick()
{
if (CopyBuffer(hdl_sar,0,0,10,sar)==-1) Alert("Ошибка SAR"+GetLastError());

if (CopyBuffer(hdl_ama,1,0,10,ama)==-1) Alert("Ошибка AMA"+GetLastError());



 
temass:
Hello! I don't get along with 2 indicators (different ones, any, e.g. SAR and MA) in my Expert Advisor. It works fine separately, but if I use them together, the second indicator gives me 4806! I have already solved my problem! I've already tried to connect both class and icustom.

Insert the code with the SRC button like this:

   void OnInit()
     {
      hdl_ama = iAMA(_Symbol,_Period,5,2,4,0,PRICE_CLOSE);
      hdl_sar = iSAR(_Symbol,_Period,0.02,0.2);
      SetIndexBuffer(0,sar,INDICATOR_DATA);
      SetIndexBuffer(1,ama,INDICATOR_DATA);
      ArraySetAsSeries(ama,true);
      ArraySetAsSeries(sar,true);
     }

   void OnTick()
     {
      if(CopyBuffer(hdl_sar,0,0,10,sar)==-1) Alert("Ошибка SAR"+GetLastError());
      if(CopyBuffer(hdl_ama,0,0,10,ama)==-1) Alert("Ошибка AMA"+GetLastError());

     }

The first thing that catches your eye is that the iAMA indicator has only one buffer "0" and you have "1".

Документация по MQL5: Технические индикаторы / iAMA
Документация по MQL5: Технические индикаторы / iAMA
  • www.mql5.com
Технические индикаторы / iAMA - Документация по MQL5
Reason: