Errors, bugs, questions - page 1929

 

Now it is impossible to determine whether the Expert Advisor is running in trading mode or in frame receiving mode. Please add an appropriate mention in the EA name, as it is already done with Debug-start.

 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

A100, 2017.07.11 17:50

Give me an example of this use case

         const int a;
const uchar Tmp[]; // 'Tmp' - 'const' variable must be initialized  
FrameAdd(Name, ID, Value, Tmp); // Нужно передать только Value
 
fxsaber:

We need an analogue of IndicatorParameters for EAs - ExpertParameters.

Due to its absence, it is impossible to understand in OnTesterPass which input parameters of the calculated pass have arrived.

Doesn't the FrameInputs function help? Or maybe I don't understand what and how it's supposed to be used.

 
Stanislav Korotky:

Doesn't the FrameInputs function help? Or I don't understand what and how it's supposed to be used.

Yes, that's what you need! I couldn't see it.

 

Before you could drag a DLL into me and see the list of available functions, now you can't do that, or has it changed somehow?

 

Once again the HistorySelect error in the tester. In 1626, I don't think there was one. In 1629 there is.

#include <Trade\Trade.mqh>

void OnTick()
{
  static CTrade Trade;

  const datetime NowTime = TimeCurrent();
  
  if (Trade.Buy(1) && Trade.PositionClose(_Symbol) && HistorySelect(NowTime, NowTime))
  {
    Print(HistoryDealsTotal()); // 0 - это при том, что мы открыли и закрыли позицию в NowTime-время
      
    ExpertRemove();
  }
}
 
fxsaber:

Once again the HistorySelect error in the tester. In 1626, I don't think there was one. In 1629 - there is.

Expert Advisor is running on your computer with pre-loaded information.

It takes some time (less than 10 seconds) for action done now to be displayed:

1. Your terminal sends a request to the server

2. Server processes it.

3) updates your terminal information

4. After that you will receive the correct HistorySelect and HistoryDealsTotal

Meaning: to see the last action in the history, you need to execute Sleep after Trade and before HistorySelect

... or check in some way that the history is not out of date.

(the same as for the quotes - you have them but they are the same as they were at the time of downloading)

 
Ivan Ivanov:
fxsaber:

Once again the HistorySelect errorin the tester. In 1626, I don't think there was one. In 1629 there is.

 

Here's an example :

//--- отправка запроса
    if ( !OrderSend(request,result) )
      PrintFormat("OrderSend error %d",GetLastError());
    else
    { Sleep(9999); // Time to get result
      ..... // Здесь мне нужен result
    }

Without Sleep it doesn't work for me, but when there's 10 seconds it's fine.

https://www.mql5.com/ru/docs/trading/ordersend
Документация по MQL5: Торговые функции / OrderSend
Документация по MQL5: Торговые функции / OrderSend
  • www.mql5.com
Торговые функции / OrderSend - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Ivan Ivanov:

Here is an example :

It's about a tester.
Reason: