Errors, bugs, questions - page 677

 
I've forgotten something. Who can tell me how to use #import correctly for a library that is in a subdirectory of the main folder?
 
danielalmaty:

Hello, could you give me a hint?


The difference is that in the original version the object is described as:

CiADX *m_ADX;

i.e. the object is dynamic. And in yours:

CiADX m_ADX;

In this case, the method should look like this:

//+------------------------------------------------------------------+
//| Create ADX indicator.                                            |
//| INPUT:  indicators -pointer of indicator collection.             |
//| OUTPUT: true-if successful, false otherwise.                     |
//| REMARK: no.                                                      |
//+------------------------------------------------------------------+
bool CSignalMY_MA_ADX::InitADX(CIndicators* indicators)
  {
//--- add ADX indicator to collection
   if(!indicators.Add(m_ADX))
     {
      printf(__FUNCTION__+": error adding object of the ADX");
      return(false);
     }
//--- initialize ADX indicator
   if(!m_ADX.Create(m_symbol.Name(),m_period,m_period_ADX))
     {
      printf(__FUNCTION__+": error initializing object of the ADX");
      return(false);
     }
//--- ok
   return(true);
  }
 
Interesting:
I've forgotten something. Who can tell me how to use #import correctly for the library which is located in the subdirectory of the main folder?

In MT4, it works like this: #import "TrendLine\\\MemoryDLL.dll"
 

https://www.mql5.com/ru/forum/23/page15

MetaTester: Changed operation of the testing method "by open prices". As before, the Expert Advisor's OnTick is triggered only at bar opening, but instead of M1 OHLC ticks, it plays states high, low and close of the bar being tested. Because of this, stops and pending orders may trigger at a price different from the specified one. This has allowed us to achieve a multiple acceleration of testing.

Can we keep the old mode along with the new one? Everyone will be able to choose a compromise between speed and quality.
 
papaklass:

For quality, would the 'all ticks' mode not suit you?

In certain cases, no. I really don't like the mode in which trades may not be executed at the stated price (and this phenomenon will be considered the norm).

Therefore, I will personally support Konstantin's request.

 
papaklass:

What do you mean by "not at the advertised price"? Clarify.

Read the text more carefully.

MetaTester: Changed operation of the testing method "by opening price". As before, OnTick of the Expert Advisor is launched at bar opening only, but instead of M1 OHLC ticks the states high, low and close of the bar being tested are played. Because of this, stops and pending orders may trigger at a price different from the specified one. This has allowed us to achieve a multiple acceleration of testing.

Since I am addicted to working with pending orders, this point is very important to me, and I do not want the pending orders to trigger"not at the stated price".

With this approach, this type of testing is of absolutely no interest to me.

That is why I suppose the variant providing for two types of testing "by opening prices" (on minute bars and on the bar being tested) will be quite a reasonable solution.

 
papaklass:

Yeah, I don't like that point either. On the next bar you can just check if the pending order is in the high - low range of the previous bar. If it did, then it worked at the set prices.

The question is not about checking, it can be done if desired. The question is why? In fact, such an implementation would not be acceptable for me personally in the " Open prices" mode, and hence, when using the "all ticks" mode, I will obtain tremendous slows. Or I don't know what the result will be in a "fast" run.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
 

There's an example of MovingAverages that works the same way (on the current 607 build) in both M1 OHLC mode and Open Prices mode. Why? Because it works strictly at the beginning of a bar - there is a special check.

Set the same condition in your EA and use M1 OHLC. And you will be lucky.

 
stringo:

There's an example of MovingAverages that works the same way (on the current 607 build) in both M1 OHLC mode and Open Prices mode. Why? Because it works strictly at the beginning of a bar - there is a special check.

If you set the same condition in your EA and use M1 OHLC. And you will be happy.


1. Well, yes, he may be trading as it should be. But it is built into his strategy. I don't have it as part of my strategy, I use pending orders.

And it is not clear with respect to stops - since when should (may) they work at prices that are not displayed?

So I won't be happy, at least not unless I switch to "All ticks".

And if I check for a new bar and trade only on its opening, it will be a different strategy.

Do I need that?

Обработчик события "новый бар"
Обработчик события "новый бар"
  • 2010.10.04
  • Konstantin Gruzdev
  • www.mql5.com
Язык программирования MQL5 позволяет решать задачи на совершенно новом уровне. Даже те задачи, которые уже вроде имеют решения, благодаря объектно-ориентированному программированию могут подняться на качественно новый уровень. В данной статье специально взят простой пример проверки появления нового бара на графике, который был преобразован в достаточно мощный и универсальный инструмент. Какой? Читайте в статье.
 
Interesting:

Well, yes, he might be trading properly. But he has it in his strategy. And I don't have it in my strategy, I trade on pending orders.

And I do not understand stops - since when should (may) they work at prices which are not set?

So I won't be happy, at least not unless I switch to "All ticks".

And if I check for a new bar and trade only on its opening, then it will be a completely different strategy.

Do I need it?

No, as I understood it, they offered you a way "how to trade at opening prices in the tester, but taking into account ticks". You need such an option in the tester, don't you? You can reproduce the results of its work by a little completing your code and running it in M1 OHLC mode (you know, like introducing an option/switch in your EA for testing)... And even run it in "all ticks" mode.
Reason: