Tiny cdb 0.77 gcc
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <stdexcept>
#include <cstdio>
#include <ctime>
#include "db.hh"
#include "map.hh"
#include "mt4.hh"
using namespace std;
string _Symbol_;
int _Period_;
string _db_;
string _history_;
string _hstfiles_;
string _csvfiles_;
string _marketinfo_;
string Sym[NR_OF_SYMBOLS];
int Per[NR_OF_PERIODS];
int main()
{
init_mt4(MT5);
int Period=PERIOD_M1;
int Period1=PERIOD_M5;
int Period2=PERIOD_H1;
int Period3=PERIOD_H4;
//Timeframe M1
string symbol1="EURUSD";
int timeframe1=PERIOD_M1;
////////////////////////////////////////////////////
std::cout << std::endl;
for(int i=0;i<NR_OF_SYMBOLS;i++)
{
std::cout << Sym[i] << " " << Period1 << " ";
try
{
cdb_to_cdb2(Sym[i],Period,Period1);//PERIOD_M5
}
catch (std::runtime_error e)
{
std::cerr << "catch:" << e.what() << std::endl;
}
catch (...)
{
std::cerr << "unknown exception\n";
}
}
////////////////////////////////////////////////////
std::cout << std::endl;
for(int i=0;i<NR_OF_SYMBOLS;i++)
{
std::cout << Sym[i] << " " << Period2 << " ";
try
{
cdb_to_cdb2(Sym[i],Period,Period2);//PERIOD_H1
}
catch (std::runtime_error e)
{
std::cerr << "catch:" << e.what() << std::endl;
}
catch (...)
{
std::cerr << "unknown exception\n";
}
}
////////////////////////////////////////////////////
std::cout << std::endl;
for(int i=0;i<NR_OF_SYMBOLS;i++)
{
std::cout << Sym[i] << " " << Period3 << " ";
try
{
cdb_to_cdb2(Sym[i],Period,Period3);//PERIOD_H4
}
catch (std::runtime_error e)
{
std::cerr << "catch:" << e.what() << std::endl;
}
catch (...)
{
std::cerr << "unknown exception\n";
}
}
////////////////////////////////////////////////////
std::cout << std::endl;
for(int i=0;i<NR_OF_SYMBOLS;i++)
{
std::cout << Sym[i] << " .idx " ;
try
{
idx_create2(Sym[i],Period, Period1, Period2, Period3);
}
catch (std::runtime_error e)
{
std::cerr << "catch:" << e.what() << std::endl;
}
catch (...)
{
std::cerr << "unknown exception\n";
}
}
/*
for(int shift1=0;shift1<40;shift1++)
{
vector<int> t1=vTimeShift3(symbol1, shift1);
//cout << t1[0] << "," << t1[1] << "," << t1[2] << "," << t1[3] << endl;
vector<double> c1=vCloseShift3(symbol1, shift1);
cout << t1[0] << " - " << c1[0] << "," << c1[1] << "," << c1[2] << "," << c1[3] << endl;
}
*/
return 0;
}