Questions from Beginners MQL5 MT5 MetaTrader 5 - page 525

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
Let string a="true" be used;
alternatively through a custom function
if you read the string from a file, you can
alternatively through a custom function
if you read the string from a file, you can
Thanks, interesting solution!
I need to read from a file - I had a custom class made, I wanted to make a function for bool values, but I understand that FileReadBool will not work by analogy?
The class returns a value by column and cell number. Excerpt:
//+------------------------------------------------------------------+
//| GetDoubleValue |
//+------------------------------------------------------------------+
double CSVReader::GetDoubleValue(int row,int column)
{
if(CheckIndexes(row,column)==false) return(0.0);
//---
int index=m_total_columns*row+column;
if((index>=0) && (index<ArraySize(m_cells)))
{
return(StringToDouble(m_cells[index]));
}
return(0.0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| GetBoolValue |
//+------------------------------------------------------------------+
double CSVReader::GetBoolValue(int row,int column)
{
if(CheckIndexes(row,column)==false) return(0.0);
//---
int index=m_total_columns*row+column;
if((index>=0) && (index<ArraySize(m_cells)))
{
return(FileReadBool(m_cells[index]));
}
return(0.0);
}
//+------------------------------------------------------------------+
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
Nickolay72, 2016.02.29 13:56
Good afternoon gentlemen, maybe someone has faced such a problem, advise.I have written an advisor on my computer Win7x32 works without any problems, but I put it on another computer, Win8x64, and it will not work. Not only that all awkwardly installed, three times reinstall, until I was convinced that the MT4 is installed on the eighth, the advisor only through the database can be thrown in place from a flash drive, and it works refuses.Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
Vladislav Andruschenko, 2016.02.29 14:13
hit him on the head with a shovel.
But seriously, the psychic department is in the other thread
Thanks, interesting solution!
I need to read from a file - I had a class made to order, I wanted to make a function for bool values there, but I understand that FileReadBool will not work by analogy?
The class returns a value by column and cell number. Excerpt:
//+------------------------------------------------------------------+
//| GetDoubleValue |
//+------------------------------------------------------------------+
double CSVReader::GetDoubleValue(int row,int column)
{
if(CheckIndexes(row,column)==false) return(0.0);
//---
int index=m_total_columns*row+column;
if((index>=0) && (index<ArraySize(m_cells)))
{
return(StringToDouble(m_cells[index]));
}
return(0.0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| GetBoolValue |
//+------------------------------------------------------------------+
double CSVReader::GetBoolValue(int row,int column)
{
if(CheckIndexes(row,column)==false) return(0.0);
//---
int index=m_total_columns*row+column;
if((index>=0) && (index<ArraySize(m_cells)))
{
return(FileReadBool(m_cells[index]));
}
return(0.0);
}
//+------------------------------------------------------------------+
Nickolay72, 2016.02.29 13:56
Of course, you will get a compilation error when you write it that way, because you have to pass the file handle into it.
It's not clear why they didn't make a standard string-to-value translation for bool.
I will write 0 and 1 in the file and make a check.
if ( StringToDouble(m_cells[index])==1 ) return (true);
else return (false);
Will it work?
It's not clear why they didn't make a standard string-to-value translation for bool.
I will write 0 and 1 in the file and make a check.
if ( StringToDouble(m_cells[index])==1 ) return (true);
else return (false);
will it work?
should, replace this line here
also change it to
should, this line here.
also replace this line with
Nickolay72, 2016.02.29 13:56
Flash drive needs to be formatted as NTFS.