Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 432
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thank you!) , the variable Cena=FileReadString(handle); I insert into function Separator=StringReplace(Sepa,",","."); it writes error "implicit conversion from number to string" -
doesn't want to read value with separator "," (1,22426) as a string, and StringReplace doesn't work. Or i am doing it wrong?
Please copy the part of the code as you have it, from the beginning of reading the file, specifying the CENA variable type
Please copy the part of the code as you have it, from the beginning of reading the file, specifying the type of the CENA variable
void MyFunc()
{
handle=FileOpen('Data.csv',FILE_CSV|FILE_READ,';');
while(FileIsEnding(handle)!=true)
{ string cena=FileReadString(handle);
string Separ=StringReplace(cena,",".");
if(FileIsEnding(handle)==true)
break;
}
FileClose(handle);
}
void MyFunc()
{
handle=FileOpen('Data.csv',FILE_CSV|FILE_READ,';');
while(FileIsEnding(handle)!=true)
{ string cena=FileReadString(handle);
string Separ=StringReplace(cena,",".");
if(FileIsEnding(handle)==true)
break;
}
FileClose(handle);
}
Please read what this function returns. You are trying to string the result. But this function just replaces a character by a character. You can continue to use cena already with the changes
Thank you, thank you!)
Help, I need to draw a rectangle from the previous candle's high to a point 200p above it and time a bar ahead.
I wrote the code, but I don't understand why the left point of the rectangle doesn't move? And the right one slides behind the hai.
Help, I need to draw a rectangle from the previous candle's high to a point 200p above it and time a bar ahead.
I wrote the code, but I don't understand why the left point of the rectangle doesn't move? And the right one slides behind the hai.
Maybe you are trying to create an object that is already on the chart?
And the previous bar is 1 not 0.
high[0] - это ХАЙ текущего бара
Maybe you are trying to create an object that is already on the chart? It might be better to check if there are already objects on the chart.
Yes and the previous bar is 1 not 0.
That's right, already fixed the indexes.
Changed the name, looked at the list, nothing has changed, still the same, one point hangs in one place, the other follows the hai
Changed the name, looked at the list, nothing has changed, it's still the same, one point hangs in one place, the other follows the hai
It's moving.
It is very simple. You need to set 7 parameters for calculation of iMA. The first parameter, the name of the symbol, is obvious. As the second one, timeframe, set M1. The third parameter - the period - set as many times as you need, how many days is more than one minute. The fourth parameter - shift = 0. The next two parameters - the method of averaging and price type - you know. The last one is the bar number. Please calculate the bar number if you know the time you need. That's all! Double-check it by making calculations for M5 and M15 timeframes. Maybe even for M30.
STARIJ, Thanks for the help, checked, unfortunately the match with the original is poor, and as the TF increases (e.g. from 30 min to weekly) the match decreases significantly. This method is better than nothing, but there is not much accuracy in it. Are there other variants?
STARIJ, Thanks for the help, checked, unfortunately the match with the original is poor, and as the TF increases (e.g. from 30 min to weekly) the match decreases significantly. This method is better than nothing, but there is not much accuracy in it. Are there other variants?