Questions from Beginners MQL5 MT5 MetaTrader 5 - page 355

 
entitie:

A very valuable and informative reply-commentary, I suggest you use it too...

As a matter of fact, there is no simple command that would overlay the standard trailing stop after opening an order, is there?

This is not a simple command, there are a lot of free trailing stop solutions in the client terminal, put the EA in a separate window of the terminal and it will automatically trail all orders.

https://www.mql5.com/ru/search#!keyword=%D1%82%D1%80%D0%B5%D0%B9%D0%BB%D0%B8%D0%BD%D0%B3

https://www.mql5.com/ru/search#!keyword=%D1%82%D1%80%D0%B5%D0%B9%D0%BB%D0%B8%D0%BD%D0%B3&module=mql5_module_codebase

 
Kino:

There is no simple command, there are a lot of ready-made trailing solutions in the kotbase, put an EA in a separate terminal window to monitor all orders and you will get automatic trailing.

https://www.mql5.com/ru/search#!keyword=%D1%82%D1%80%D0%B5%D0%B9%D0%BB%D0%B8%D0%BD%D0%B3

https://www.mql5.com/ru/search#!keyword=%D1%82%D1%80%D0%B5%D0%B9%D0%BB%D0%B8%D0%BD%D0%B3&module=mql5_module_codebase

Thanks for the reply, at least now I will know, because it's useless to search through documentation. The search engines only point to Expert Advisors.
 
alph:
Can you tell me if this is a realistic tester figure? And is this a good or bad result for a year with a deposit of $3,000?


Not really. The drawdown is too big and there is a lot of it :)
 
720105831:
Could you tell me, comrades, whether it is possible to sign more than one signal on one account?
Why? Better individually, make a portfolio. For instance, you have $5,000, distribute 1,000 on each account. This is 20% of your deposit for each provider. Think about how convenient it is :)
And subscribe to my signal :))
 
alexey frolov:
Can you tell me, comrades, whether it is possible to sign more than one signal on one account?
No, only 1 signal per account. You can bypass it by using copiers.
 

Hello. I'm writing an indicator that uses a built-in RSI indicator, I've encountered this problem...

When I change timeframe, it goes outside the array. I figured out that the problem occurs because when you change timeframe an error in the function CopyBuffer, it doesn't copy elements from the indicator handle. Here is a part of the code, located in the custom function:

int h_rsi = iRSI(symbol, period_trade, period, PRICE_CLOSE);  //возвращаем хэндл индикатора RSI
   if(CopyBuffer(h_rsi, 0, 0, bars, m_rsi)<bars)                 //заполняем массив с данными индикатора RSI
     {
      Print("Не удалось скопировать буфер индикатора!");
     }
   for(int i=0;i<=bars;i++) //цикл по барам
     {
      double rsi = m_rsi[i];
.....

In the first line of the loop an error occurs: Array overrun. When executing the function CopyBuffer (after the timeframe change) there is an error, its code is 4806. I checked if the data exists in the history, I set the time delay (Sleep()) after changing the timeframe and getting the indicator handle, the result is the same. Interesting is that at the moment of error occurrence, if I go to the compiler and recompile the file, the indicator works (until the next timeframe change).

 
ALEKSANDR TELEGUZ:

Hello. I'm writing an indicator that uses a built-in RSI indicator, I've encountered this problem...

When I change timeframe, it goes outside the array. I figured out that the problem occurs because when you change timeframe an error occurs in the function CopyBuffer, it doesn't copy elements from the indicator handle. Here is a part of the code, located in the custom function:

In the first line of the loop an error occurs: Array overrun. When executing the function CopyBuffer (after the timeframe change) there is an error, its code is 4806. I checked if the data exists in the history, I set the time delay (Sleep()) after changing the timeframe and getting the indicator handle, the result is the same. Interesting is that at the moment of error occurrence, if I go to the compiler and recompile the file, the indicator works (until the next timeframe change).

And how do you get the value of variables "bars", "symbol" and "period_trade"?
 
Karputov Vladimir:
How do you get the value of variables "bars", "symbol" and "period_trade"?
input int Analyze_Bars= 300; //сколько баров в истории анализировать

ENUM_TIMEFRAMES Period_Trade; //Период графика
string Trade_Symbol;          //Символ

int OnInit()
  {
   Trade_Symbol=Symbol();
   Period_Trade=Period();

I understand that it is difficult to help with code snippets. I am preparing an article about building resistance and support levels. I made a preliminary agreement withRashid Umarov's administrator, he said it would be better to write code in mql5 (I am programming in mql4 and the indicator was originally written in this language). It's interesting that when I run the indicator for the first time, it works fine, here:

The result of the indicator

But when I change timeframe an error occurs. I don't want to attach an unfinished indicator to the article, but the most important thing is its working principle.

I can send you the whole code if you want. I would appreciate it if you could help me and tell me the error.

 
ALEKSANDR TELEGUZ:

I understand that it is difficult to help with code snippets. I am preparing an article about building resistance and support levels. I made a preliminary agreement with administratorRashid Umarov and he told me that it would be better to write code in mql5 (I am programming in mql4 and initially indicator was written in this language). Interestingly, when I run the indicator for the first time, everything goes well, here:

But when I change timeframe an error occurs. I don't want to attach an unfinished indicator to the article, but the most important thing is its working principle.

I can send you the whole code if you want. I would appreciate it if you could help and show the error.

Send it to me.
 
Karputov Vladimir:
How do you get the value of variables "bars", "symbol" and "period_trade"?
I get the indicator handle from the custom function for a reason, I wrote a multicurrency EA based on it in mql4 and it goes through the symbols in the OnTick() function. I think, it will be more convenient for the readers if they also make EAs trading on different currencies based on the indicator. I tried to receive a handle in the OnInit() function, but it caused the same error.
Reason: