Obtaining EA Tester settings parameter info in MQL5

 

Hi everyone.


I'm trying to obtain the value of the "modelling" field in the strategy tester settings form shown below:


Does anyone know if this is possible and easy in MQl5. I can't find any way to do it.


Many thanks,

E


 
EdFuk: I'm trying to obtain the value of the "modelling" field in the strategy tester settings form

Why? You are testing your code. It shouldn't do anything different during test vs. demo vs. live.

 
William Roeder:

Why? You are testing your code. It shouldn't do anything different during test vs. demo vs. live.

That is precisely what I'm trying to achieve William, consistency between backtest and demo/live.

I tend to trade using swing strategies and trade from the close of bars. 15 mins + and therefore I'm trying to utilise the open prices only model which will save a lot of time during back test. I set the trading timeframe from within the code and how I want to process the data - every tick, M1 or open prices. Before I run the back test I want to make sure that I have selected the corresponding tick model in the tester settings, hence me asking the question. I'm still learning the ins and outs so sorry if it's a stupid question.


Unless you use real ticks in the testing phase it is different to reality! Because I'm using higher timeframes for trading I have the luxury of using open prices in testing and hopefully saving some time. Any ideas?

E

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
 
EdFuk:

Hi everyone.


I'm trying to obtain the value of the "modelling" field in the strategy tester settings form shown below:


Does anyone know if this is possible and easy in MQl5. I can't find any way to do it.


Many thanks,

E


I guess this isn't possible without saving the settings file and reading that?

 

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Особенности языка mql5, тонкости и приёмы работы

fxsaber, 2017.11.23 00:21

// Returns true only if the mode by real ticks is selected (in the tester) 
// There must be at least one OnTick called by the tester before use
bool IsRealTicks( void )
{
  MqlTick Tick;
  
  return(SymbolInfoTick(_Symbol, Tick) && (Tick.volume || !(Tick.flags & TICK_FLAG_LAST)));
}


Usage example

// The Expert Advisor will be tested only in the real tick mode
void OnTick()
{
  static bool IsRemove = true;
  
  if (IsRemove)
  {
    IsRemove = MQLInfoInteger(MQL_TESTER) && !IsRealTicks();
    
    if (IsRemove)
    {
      Print("Real ticks mode is needed!");
      
      ExpertRemove();
      
      return;
    }
  }
  
  //........
}
How to do this in OnInit (without OnTick) - I don't know.
 

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Библиотеки: MultiTester

fxsaber, 2019.12.10 00:09

Now Expert Advisors launched in the Tester can receive their data.
// Getting the Tester settings by the Expert Advisor running on the local Agent.

#include <fxsaber\MultiTester\MTTester.mqh> // https://www.mql5.com/ru/code/26132

void OnInit()
{
  string Str;
  
  if (MQLInfoInteger(MQL_TESTER) && MTTESTER::GetSettings(Str))
    Print(Str);
}


Result.

[Tester]
Symbol=EURUSD
Period=M1
Optimization=0
Model=4
FromDate=2019.01.15
ToDate=2019.12.08
ForwardMode=0
Deposit=100000
Currency=USD
ProfitInPips=1
Leverage=100
ExecutionMode=0
OptimizationCriterion=6
Visual=0
[TesterInputs]
 
fxsaber:

Thank you very much, that looks exactly what I'm after.

I will try it out,

Many thanks,

E

Reason: