Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1515 1...150815091510151115121513151415151516151715181519152015211522...1605 New comment Yuriy Bykov 2024.04.13 19:16 #15141 AkaEdie #:... and the result, what does red and dark green mean? It's probably just a colour scale for sets of parameters based on good - bad results. The greener and darker the better. Vitaly Muzichenko 2024.04.13 19:48 #15142 I've been sitting for over an hour and I can't solve the puzzle. Is the terminal broken, or do I have a problem? Doesn't get data from any other timeframe, only from the one specified when creating the MA int OnInit() { hMA1=iMA(Symbol(), PERIOD_H1, 5, 0, MODE_EMA, PRICE_CLOSE); if(hMA1<0) { Alert("ERROR handle MA"); return(INIT_FAILED); } return(INIT_SUCCEEDED); } int hMA1=-1; double buf[1]; -- int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { Print( CopyBuffer(hMA1,0,10,1,buf),"=", buf[0] ); ... -- Printing on any other timeframe -- Printing onH1, no problems A division by zero Please help me solve Problem with the delay Vitaly Muzichenko 2024.04.13 20:25 #15143 Which helps get the data from the MA No ticks, it's the weekend, so that's the only way -- Now the question arises? How to get data from another timeframe not on the next ticks, but on the first one, as the native timeframe, on which the indicator is created, gets it? Discussion of article "Limitless MQL5 bug when working Features of the mql5 Vitaly Muzichenko 2024.04.13 23:04 #15144 I've done it this way when no data is received, update the chart ChartSetSymbolPeriod(0,Symbol(),PERIOD_CURRENT); But this is not even a crutch solution, but a complete amateurishness How to make a normal solution, and why does it work like this? Как получить данные с другого таймрейма не на следующих тиках, а на первом, как это получат родной таймфрейм, на котором создан индикатор? Grigori.S.B 2024.04.14 07:05 #15145 Vitaly Muzichenko #: Как получить данные с другого таймрейма не на следующих тиках, а на первом, как это получат родной таймфрейм, на котором создан индикатор? How to make a normal solution, and why is this the case? Perhaps, request this data in OnInit() so that it would be ready by the first tick. Alexey Viktorov 2024.04.14 09:16 #15146 Vitaly Muzichenko #:I did it this way when no data is received, update the chart But this is not even a crutch solution, but a complete amateurishness How to make a normal solution, and why is it like this? Take a look at this one. bool f = false; /****************Custom indicator iteration function*****************/ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { if(!f) { f = true; return 0; } Print(CopyBuffer(hMA1,0,10,1,buf),"=", buf[0]); return rates_total; }/*****************************************************************/ It will probably be more expensive to run synchronisation. Vitaly Muzichenko 2024.04.14 11:05 #15147 Alexey Viktorov #:Check this one out. It will probably be more expensive to run synchronisation. Thanks, but the question is about a closed market - there are no ticks, and OnCalculate triggers once when switching timeframe I did it this way and it works, but it's not really a normal condition int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { if(rates_total-prev_calculated==0) return(rates_total); int res=Start(rates_total); // если "0" - то данные от МА не получены if(fl && res==0) { ChartSetSymbolPeriod(0,Symbol(),PERIOD_CURRENT); ChartRedraw(); fl=false; return(0); } return(rates_total); } problem persists with indicator Any questions from newcomers "New Neural" is an Alexey Viktorov 2024.04.14 12:16 #15148 Vitaly Muzichenko #:Thanks, but the question is about a closed market - there are no ticks and OnCalculate is triggered once when switching timeframe I did it this way and it works, but it's not really a normal condition Vitaly, would it be more useful to check? Vitaly Muzichenko 2024.04.14 12:56 #15149 Alexey Viktorov #:Vitaly, would it be more useful to check? Checked. Your design is identical to mine, but without ChartSetSymbolPeriod and checking that the MA did not return a result It starts working only like this bool f = false; /****************Custom indicator iteration function*****************/ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { if(!f) { f = true; ChartSetSymbolPeriod(0,Symbol(),PERIOD_CURRENT); return 0; } Print(CopyBuffer(hMA1,0,10,1,buf),"=", buf[0]); return rates_total; }/*****************************************************************/ Vitaly Muzichenko 2024.04.14 12:58 #15150 Check. Your design is identical to mine, but without ChartSetSymbolPeriodand checking that the MA did not return a result It only starts working like this bool f = false; /****************Custom indicator iteration function*****************/ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { if(!f) { f = true; ChartSetSymbolPeriod(0,Symbol(),PERIOD_CURRENT); // только так работает return 0; } Print(CopyBuffer(hMA1,0,10,1,buf),"=", buf[0]); return rates_total; }/*****************************************************************/ 1...150815091510151115121513151415151516151715181519152015211522...1605 New comment
... and the result, what does red and dark green mean?
It's probably just a colour scale for sets of parameters based on good - bad results. The greener and darker the better.
I've been sitting for over an hour and I can't solve the puzzle.
Is the terminal broken, or do I have a problem?
Doesn't get data from any other timeframe, only from the one specified when creating the MA
--
Printing on any other timeframe
--
Printing onH1, no problems
Which helps get the data from the MA
No ticks, it's the weekend, so that's the only way
--
Now the question arises?
How to get data from another timeframe not on the next ticks, but on the first one, as the native timeframe, on which the indicator is created, gets it?
I've done it this way
when no data is received, update the chart
But this is not even a crutch solution, but a complete amateurishness
How to make a normal solution, and why does it work like this?
How to make a normal solution, and why is this the case?
Perhaps, request this data in OnInit() so that it would be ready by the first tick.
I did it this way
when no data is received, update the chart
But this is not even a crutch solution, but a complete amateurishness
How to make a normal solution, and why is it like this?
Take a look at this one.
It will probably be more expensive to run synchronisation.
Check this one out.
It will probably be more expensive to run synchronisation.
Thanks, but the question is about a closed market - there are no ticks, and OnCalculate triggers once when switching timeframe
I did it this way and it works, but it's not really a normal condition
Thanks, but the question is about a closed market - there are no ticks and OnCalculate is triggered once when switching timeframe
I did it this way and it works, but it's not really a normal condition
Vitaly, would it be more useful to check?
Vitaly, would it be more useful to check?
Checked.
Your design is identical to mine, but without ChartSetSymbolPeriod and checking that the MA did not return a result
It starts working only like this
Check.
Your design is identical to mine, but without ChartSetSymbolPeriodand checking that the MA did not return a result
It only starts working like this