This is a draft.
It works ONLY ONLINE. On the story DOES NOT WORK. When pumping more than one bar - DOES NOT WORK.
Vladimir, thanks a lot for your draft! I really appreciate it!
I created a for cycle to print all values of the graph, and it obtains right values for all graph bars.
int limit = prev_calculated -1; if( limit < 0 ) limit = 0; for( int pos=limit; pos<rates_total; pos++ ) { double amount_fast=0.0; double amount_slow=0.0; for(int i=0; i<k; i++) { double array_temp[]; // array temp of Moving Average values int values_to_copy=rates_total; // number of values copied from the iMA indicator //--- if FillArrayFromBuffer returns false, it means the information is nor ready yet, quit operation if(!FillArrayFromBuffer(array_temp,Inp_MA_ma_shift,handles_iMA_fast[i],values_to_copy)) return(0); amount_fast+=array_temp[pos]; //--- if FillArrayFromBuffer returns false, it means the information is nor ready yet, quit operation if(!FillArrayFromBuffer(array_temp,Inp_MA_ma_shift,handles_iMA_slow[i],values_to_copy)) return(0); amount_slow+=array_temp[pos]; } //--- FastBuffer[pos]=amount_fast; SlowBuffer[pos]=amount_slow; }
Anyway, it works well only if I put as input symbol only the current chart symbol name, if I try to work on multiple symbols I obtain error code 4806 on BarsCalculated of other symbols handles.
It occurs both on your original code (that plot values only of rates_total-1 candle) and on my change with a for cycle.
It seems absurd to me that in MQL5 it's impossible to have a multicurrency indicator... In MQL4 it can be done in a couple of minutes with few rows of code....
***
It occurs both on your original code (that plot values only of rates_total-1 candle) and on my change with a for cycle.
It seems absurd to me that in MQL5 it's impossible to have a multicurrency indicator... In MQL4 it can be done in a couple of minutes with few rows of code....
There is no problem - there is a problem in you: you do not want to handle elementary errors. For example, you probably don’t even understand that for some characters there are BARS BARS - for example, on the symbol # 1 we have 1000 bars, and on the symbol # 2 - only 980.
The old language (especially WITHOUT #property strict) forgave all your mistakes - as a result, you began to work carelessly.
I always try to handle and manage error in the code, I never worked without property strict in mql4.
I found the mql5 language more complicated than mql4 and all my knowledge in mql4 is pretty useless, it changed a lot of things.
Thanks again for your help and your new version, I'll study it deeply to better understand.
It remains to overcome these values (they are on the LEFT bars)
Hello guys,
I'm trying to code some ideas in mql5 rather than mql4 in order to better test my multicurrency indicators and experts but I've big issues accessing indicator values (ex. MA) of symbols. I read all documentation deeply and looked also on the forum I'm getting very confused.
This is my attempt, theorically I used all functions correctly, but I can't get right values, sometimes I get "+inf" value, sometimes 0, sometimes wrong value, it's very randomic.
PS: SYMBOLS[] is an array in which I splitted my calcSymbols string, countSymbols is the results of split (aka array size).
It's funny that MQL5 becomes more difficult and intricate compared to MQL4. Usually newer languages becomes more easy and understandable, but it's not our case. I hope I'll wrong when I learn MQL5 better.
Thanks for everyone that want to spend some time to helping me! :-)
Ciao, hai risolto? Anch'io ho lo stesso problema... fatto tutto nella 4 m qualche problema con la 5. Io carico i 28 handles su un array in OnInit
if(f > 3)
for(uchar x = 0; x < sizePairs; x++)
{
switch(f)
{
case 4:
h[x] = iCustom(pairsT[x], PERIOD_CURRENT, " indicator1", 1);
break;
case 5:
h[x] = iCustom(pairsT[x], PERIOD_CURRENT, "indicator2", r1);
break;
case 6:
h[x] = iCustom(pairsT[x], PERIOD_CURRENT, "indicator3", r1);
break;
}
poi faccio i copyBuffer all'occorrenza prima di leggere gli array... ma da problemi...
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys,
I'm trying to code some ideas in mql5 rather than mql4 in order to better test my multicurrency indicators and experts but I've big issues accessing indicator values (ex. MA) of symbols. I read all documentation deeply and looked also on the forum I'm getting very confused.
This is my attempt, theorically I used all functions correctly, but I can't get right values, sometimes I get "+inf" value, sometimes 0, sometimes wrong value, it's very randomic.
PS: SYMBOLS[] is an array in which I splitted my calcSymbols string, countSymbols is the results of split (aka array size).
It's funny that MQL5 becomes more difficult and intricate compared to MQL4. Usually newer languages becomes more easy and understandable, but it's not our case. I hope I'll wrong when I learn MQL5 better.
Thanks for everyone that want to spend some time to helping me! :-)