Trying to send json via WebRequest, the server returns:"\u0022BTCUSD\u0022 is not a valid bundle type for denormalisation.".
I.e. it doesn't like the encoding of inverted commas \u0022 . I tried specifying all encoding variants in headers and StringToCharArray, nothing helps.
From python everything flies out without problems: response = requests.post(url, data=json.dumps(data), headers=headers) i.e. everything is ok with the server.
Let me rephrase the question a bit differently. Is it possible to give the optimiser a command in the OnInit block to skip the testing/optimization variant under certain conditions.
input group "Входные настройки Стохастик"
input bool Stoch = false; // Стохастик включен/выключен
input int in_StochK = 14; // период основной линии K
input int in_StochD = 3; // период первичного сглаживания D
input int in_StochSlow = 3; // период окончательного сглаживания
int OnInit() {
if ((Stoch = false) && ((StochK != 0) || (StochK != 0) || (StochSlow != 0)))
{
// Некая команда, которая говорит, что такой вариант даже не стоит пробовать оптимизировать
}
}
I tried to do this, but it leads to incorrect optimisation variants.
if ((Stoch = false) && ((StochK != 0) || (StochK != 0) || (StochSlow != 0)))
{
Print("Такой вариант тестирования не имеет смысла");
return(INIT_FAILED);
}
The goal is for me to be able to enable the enumeration of variants of 4 stochastic parameters (Stoch, in_StochK, int in_StochD, int in_StochSlow) when optimising.
When stochastic is enabled (Stoch = true), the optimiser is enumerating the variables in_StochK, in_StochD, in_StochSlow. Everything works correctly in this part.
When stochastic is turned off (Stoch = false), the optimiser still searches variables in_StochK, in_StochD, in_StochSlow. And I need to make some kind of a stopper in the code so that it does not search them if Stoch = false.
Perhaps the reason the optimiser is not working correctly is because of this inaccuracy in the code:
That is not the reason. I made the code for an example of the working logic. The full version of the code is too large - there are many different oscillators. When optimising, I want the optimiser to try different combinations (one oscillator on, two oscillators on, three oscillators on, etc.).
- When using this stopper, the optimiser quickly completes work with a small number of passes, although there should be a huge number of them.
- Without using this restriction, the optimiser works better, but produces a lot of empty variants (for the example above - it still searches its parameters when Stochastic is turned off). God be with empty variants, but this is both extra time for optimisation and empty passes instead of useful ones.
I also used this approach to exclude obviously unnecessary combinations of parameters and did not notice incorrect optimiser performance. On the contrary, the optimiser worked exactly as expected.
You can try to add saving the missed parameter combinations to the database or a common file to check how many and which ones are really missed and to understand the reasons.
What prevents you from looking at the code of the Alligator.mq5 indicator?
//--- line shifts when drawingPlotIndexSetInteger(0,PLOT_SHIFT,InpJawsShift);
PlotIndexSetInteger(1,PLOT_SHIFT,InpTeethShift);
PlotIndexSetInteger(2,PLOT_SHIFT,InpLipsShift);
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.
Trying to send json via WebRequest, the server returns:"\u0022BTCUSD\u0022 is not a valid bundle type for denormalisation.".
I.e. it doesn't like the encoding of inverted commas \u0022 .
I tried specifying all encoding variants in headers and StringToCharArray, nothing helps.
From python everything flies out without problems:
response = requests.post(url, data=json.dumps(data), headers=headers)
i.e. everything is ok with the server.
How to solve the problem?
Let me rephrase the question a bit differently. Is it possible to give the optimiser a command in the OnInit block to skip the testing/optimization variant under certain conditions.
I tried to do this, but it leads to incorrect optimisation variants.
if ((Stoch = false) && ((StochK != 0) || (StochK != 0) || (StochSlow != 0))) { Print("Такой вариант тестирования не имеет смысла"); return(INIT_FAILED); }The goal is for me to be able to enable the enumeration of variants of 4 stochastic parameters (Stoch, in_StochK, int in_StochD, int in_StochSlow) when optimising.
Hello @taramortom.
It would probably help if you just replaced
to
Hello, @taramortom.
It would probably help if you just replace
to
Perhaps the reason the optimiser is not working correctly is because of this inaccuracy in the code:
Perhaps the reason the optimiser is not working correctly is because of this inaccuracy in the code:
That is not the reason. I made the code for an example of the working logic. The full version of the code is too large - there are many different oscillators. When optimising, I want the optimiser to try different combinations (one oscillator on, two oscillators on, three oscillators on, etc.).
- When using this stopper, the optimiser quickly completes work with a small number of passes, although there should be a huge number of them.
- Without using this restriction, the optimiser works better, but produces a lot of empty variants (for the example above - it still searches its parameters when Stochastic is turned off). God be with empty variants, but this is both extra time for optimisation and empty passes instead of useful ones.
Hello! I am writing an indicator based on MA - ExtJawsHandle=iMA(NULL,0,Period,0,Method,AppliedPrice);
how can I programmatically get to the levels of MA, as shown in the figure below.
A construct of the type
IndicatorSetInteger(INDICATOR_LEVELS,1);
IndicatorSetDouble(INDICATOR_LEVELVALUE,0,10);
does not work.
IndicatorSetDouble(INDICATOR_LEVELVALUE,0,10);
doesn't work.
no options?)
no other options?)
What prevents you from looking at the code of the Alligator.mq5 indicator?