Библиотеки: Input_Struct - страница 4

 
hini #:

There is a scenario where certain external input parameters that control EA behavior are hidden when made public, but need to be controlled for personal use!

DINPUT and HINPUT are different targets

 
hini #:

DINPUT and HINPUT are different targets

Да, я полностью согласен с вами. Спасибо за предложение, добавлю в библиотеку.

 
Alexey Viktorov #:

But I'm not Russian……
 
hini #:
But I'm not Russian……

Тем не менее в других темах пишете по русски…

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

Галерея UI написанных на MQL

hini, 2024.08.09 19:42

Это должно быть связано с языком: в китайском, японском и корейском языках такое возможно.

 
Alexey Viktorov #:

Тем не менее в других темах пишете по русски…

он не пишет по-русски. Некоторые темы, в том числе и тема Петра, автоматически дублируются на другие языки в реальном времени. Он пишет в английской ветке-дубликате, а может даже в китайской, и его переведенные сообщения мгновенно появляются в русской ветке-оригинале.

по какому принципу некоторые ветки становятся интернациональными, я не знаю. Возможно вручную админами, возможно при достижении определенного количества подписчиков, или как-то еще...
 
Alexey Viktorov #:

Тем не менее в других темах пишете по русски…


Those are automatically translated into Russian, and what I see is also translated into Chinese......
 
fxsaber #:

Да, я полностью согласен с вами. Спасибо за предложение, добавлю в библиотеку.

Добавил. @hini, спасибо.

// INPUT_STRUCT_ADDON / INPUT_STRUCT_ADDON_WITHOUT_FILENAME
#define DINPUT(NAME, TYPE, DEFAULT)                             // disable input
#define _INPUT(NAME, TYPE, DEFAULT)                             // input without struct
#define SINPUT(NAME, TYPE, DEFAULT) MACROS(NAME, TYPE, DEFAULT) // sinput
#define  INPUT(NAME, TYPE, DEFAULT) MACROS(NAME, TYPE, DEFAULT) // input
#define  GROUP(NAME)                                            // group
#define HINPUT(NAME, TYPE, DEFAULT) MACROS(NAME, TYPE, DEFAULT) // hide input
hini
hini
  • 2023.06.11
  • www.mql5.com
Профиль трейдера
 
fxsaber #:

Добавил. @hini, спасибо.

good !
 
  template <typename T>
  bool GetDefaultValue(T &Value, const string &Name) const
  {
     #define MACROS(A, B, C) if (Name == #A) { Value = (T)(C); return true; }
     MACROS_MULTI
     #undef MACROS
     return false; // Not Found Name
  }

  // example
  Print(Inputs.OrderLimit); // Inputs.OrderLimit == 999
  Inputs.OrderLimit = 111; // changed
  int count = 0;
  bool ok = Inputs.GetDefaultValue(count, "OrderLimit"); // default value: count == 999

I'm unsure if the library already implements this functionality, but in accordance with my needs, I've added a method to retrieve the default value of a specified input parameter.

This allows me to access the default value of any given parameter and also reset a specific parameter without necessitating the reset of all parameters to their defaults.



 
hini #:

I'm unsure if the library already implements this functionality, but in accordance with my needs, I've added a method to retrieve the default value of a specified input parameter.

This allows me to access the default value of any given parameter and also reset a specific parameter without necessitating the reset of all parameters to their defaults.

#define INPUT_STRUCT_ADDON
#include "MACD_Input.mqh" // https://www.mql5.com/ru/forum/460726/page2#comment_54150955

template <typename T>
T GetInputsDefault( void )
{
  T Input;
  
  Input.Default();
  
  return(Input);
}

void OnStart()
{
  inMACD_INPUT.InpMACDOpenLevel = GetInputsDefault<MACD_INPUT>().InpMACDOpenLevel;  
}