I want to create a SQLite file on MQL5/Files, but this code didn't do so. I don't know what is wrong!
voidOnTick()
{
datetime Recolection = StringToTime(TimeToString(TimeCurrent(),TIME_DATE) + " " + 00:00:00);
if(TimeCurrent() == Recolection)
{
string filename="Foreign_Exchange.sqlite";
int Foreign_Exchange=DatabaseOpen(filename, DATABASE_OPEN_READWRITE | DATABASE_OPEN_CREATE | DATABASE_OPEN_COMMON);
DatabaseClose(Foreign_Exchange);
if(DatabaseTableExists(Foreign_Exchange, _Symbol) == false)
{
DatabaseExecute(Foreign_Exchange,
StringFormat("CREATE TABLE %s("
"ID INT PRIMARY KEY,"
"EVENT_ID INT NOT NULL,"
"CURRENCY TEXT NOT NULL,"
"COUNTRY TEXT NOT NULL,"
"NEWS_CODE TEXT NOT NULL,"
"CALENDAR_IMPORTANCE INT,"
"TIME TEXT NOT NULL,"
"IMPACT INT NOT NULL,"
"ACTUAL_VALUE REAL,"
"FORECAST_VALUE REAL,"
"PREV_VALUE REAL,"
"PRICE REAL NOT NULL,"
"VALIDITY REAL NOT NULL,"
"RELIABILITY REAL NOT NULL,"
"TAKEPROFIT REAL NOT NULL,"
"STOPLOSS REAL NOT NULL,"
"PROBABILITY REAL NOT NULL);",_Symbol));
}
}
}
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.
I want to create a SQLite file on MQL5/Files, but this code didn't do so. I don't know what is wrong!