Good afternoon, please advise... After upgrading to the latest build, errors in "SmoothAlgorithms" started to fly out. And sma, lwma, parma, vidya averaging stopped working. It is swearing at this line: "array out of range in 'SmoothAlgorithms.mqh' (3394,9)". How should I fix it? Thank you!
007yurik: Good afternoon, please advise... After upgrading to the latest build, errors in "SmoothAlgorithms" started to pop up. And sma, lwma, parma, vidya averaging stopped working. It is swearing at this line: "array out of range in 'SmoothAlgorithms.mqh' (3394,9)". How should I fix it? Thank you!
Write to the author on the discussion page of his library:
Is there any way to programmatically set a list of parameters to be optimised?
The thing is that I have a lot of parameters. Thousands of them. I put them in a separate program. EA loading them during initialization through external file. So my task is to optimize these parameters now.
That is for example a list of optimizable parameters with values and ranges in a file. Read from there and write the result there as well.
I am writing a function to close charts with no EAs or scripts. I get the name of Expert Advisor and script on the chart using ChartGetString function. If both are empty, I close them. The problem is in the line with chart closing according to the condition. The condition is never satisfied. Here is the code.
Good afternoon! I have made .mqh for data processing and storage in the resource. Everything works, but there is a nuance, if I compile the indicator, the .mqh is reset and re-does the weight process for storage. Target - as long as there is data in the resource it is not reset. Where is the error, how to fix it?
// Сохранение данных#include <fxsaber\TradeTransactions\ResourceData.mqh> // https://www.mql5.com/ru/code/22166#include <GlobalVariables.mqh>
const RESOURCEDATA<MqlTick>m_Resource("::"+__FILE__); // Ресурс для передали данных (тики)//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+class CMyTicks
{
protected:
public:
//+------------------------------------------------------------------+//| Constructor. |//+------------------------------------------------------------------+ void CMyTicks()
{
_GlobalVariableSet("ResourceName",m_Resource.GetFullName()); // Записали в глобальную переменную полное имя ресурса (read-only)
}
//+------------------------------------------------------------------+//| Destructor. |//+------------------------------------------------------------------+ void ~CMyTicks()
{
//_GlobalVariableDel("ResourceName");
}
//+------------------------------------------------------------------+ void CollectTicks()
{
MqlTick m_Ticks[];
CopyTicks(_Symbol,m_Ticks,COPY_TICKS_ALL,0,5); // Сформировали данные
m_Resource=m_Ticks; // Записали данные
}
};
//+------------------------------------------------------------------+
// Получение данных#property indicator_chart_window#property indicator_plots0#include <Test_Keep_Info_13.mqh>
CMyTicks Test;
#include <fxsaber\TradeTransactions\ResourceData.mqh> // https://www.mql5.com/ru/code/22166#include <GlobalVariables.mqh>
staticconst RESOURCEDATA<MqlTick>Resource(_GlobalVariableGet<string>("ResourceName")); // Создали ресурс на основе переданного в глобальной переменной полного имени MqlTick Ticks[];
//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,constint prev_calculated,constint,constdouble &[])
{
if(prev_calculated==0)
{
Resource.Get(Ticks); // Считали данные из ресурса.ArrayPrint(Ticks); // Распечатали полученные данныеif(ArraySize(Ticks)<1)
{
Test.CollectTicks();
Print(" SAVE TICKS ");
}
Resource.Get(Ticks); // Считали данные из ресурса.ArrayPrint(Ticks); // Распечатали полученные данные
}
return(rates_total);
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Good afternoon, please advise... After upgrading to the latest build, errors in "SmoothAlgorithms" started to pop up. And sma, lwma, parma, vidya averaging stopped working. It is swearing at this line: "array out of range in 'SmoothAlgorithms.mqh' (3394,9)". How should I fix it? Thank you!
Write about it to the author on the discussion page of his library:
There is a need to use numeric values as enumeration elements.
enum ENUM_HOURS { 0, 1, .., 23 };This is not allowed. Compilation error identifier expected. Is there any way around it (leaving only numeric values)?
There is a need to use numeric values as enumeration elements.
This is not allowed. Compilation error identifier expected. Is there any way around it (leaving only numeric values)?
Can you give me a link to the documentation of what these <> symbols mean?
Is there any way to programmatically set a list of parameters to be optimised?
The thing is that I have a lot of parameters. Thousands of them. I put them in a separate program. EA loading them during initialization through external file. So my task is to optimize these parameters now.
That is for example a list of optimizable parameters with values and ranges in a file. Read from there and write the result there as well.
I am writing a function to close charts with no EAs or scripts. I get the name of Expert Advisor and script on the chart using ChartGetString function. If both are empty, I close them. The problem is in the line with chart closing according to the condition. The condition is never satisfied. Here is the code.
Here is what Print shows
I understand that we can change the condition to the following
Well, how else should we compare the string variable with an empty string?
Good afternoon! I have made .mqh for data processing and storage in the resource. Everything works, but there is a nuance, if I compile the indicator, the .mqh is reset and re-does the weight process for storage. Target - as long as there is data in the resource it is not reset. Where is the error, how to fix it?
How do I correctly compare a variable string with an empty string ?
There are two normal empty strings - "" and NULL. And there can also be custom empty strings.