Add Initial commit
This commit is contained in:
@ -1,20 +1,26 @@
|
|||||||
#include "TradingBot.h"
|
#include "TradingBot.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include "main.cpp"
|
||||||
|
|
||||||
Bot::Bot(std::string filename)
|
Bot::Bot(MerkelMain _app)
|
||||||
{
|
{
|
||||||
orders = CSVReader::readCSV(filename);
|
app = _app;
|
||||||
Print(20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::Print(int intLimit)
|
std::vector<double> Bot::linearRegresion(std::vector<OrderBookEntry> orderList, unsigned int start, unsigned int end)
|
||||||
{
|
{
|
||||||
int i = 0;
|
//get all dates from the order book
|
||||||
for (OrderBookEntry &entry : orders)
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> Bot::getTimeStamps()
|
||||||
{
|
{
|
||||||
std::cout << entry.product << " " << entry.price << " " << entry.amount << std::endl;
|
std::vector<std::string> timeStamps;
|
||||||
i++;
|
//timeStamps.push_back(app.;
|
||||||
if (i == intLimit)
|
//while(std::find(timeStamps.begin(), timeStamps.end(), ))
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double Bot::getMean(std::vector<OrderBookEntry>)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -7,11 +7,13 @@
|
|||||||
class Bot
|
class Bot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Bot(std::string filename);
|
MerkelMain app;
|
||||||
|
Bot(MerkelMain app);
|
||||||
/** returns a vector with the Y, B0 and B1 values in the formula Y = B0 + B1.X */
|
/** returns a vector with the Y, B0 and B1 values in the formula Y = B0 + B1.X */
|
||||||
std::vector<double> linearRegresion(std::vector<OrderBookEntry> orderList, unsigned int start, unsigned int end);
|
std::vector<double> linearRegresion(std::vector<OrderBookEntry> orderList, unsigned int start, unsigned int end);
|
||||||
void Print(int intLimit);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<OrderBookEntry> orders;
|
double getMean(std::vector<OrderBookEntry>);
|
||||||
|
std::vector<std::string> Bot::getTimeStamps();
|
||||||
};
|
};
|
||||||
@ -6,6 +6,6 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
MerkelMain app{};
|
MerkelMain app{};
|
||||||
Bot myBot("20200317.csv");
|
Bot myBot(app);
|
||||||
//app.init();
|
//app.init();
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
CM2010 Software Design and Development/Topic 3/7.2.6/a.exe
Normal file
BIN
CM2010 Software Design and Development/Topic 3/7.2.6/a.exe
Normal file
Binary file not shown.
BIN
CM2010 Software Design and Development/Topic 3/7.2.6/cppunit.lib
Normal file
BIN
CM2010 Software Design and Development/Topic 3/7.2.6/cppunit.lib
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cppunit/TestCase.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "Hello!" << std::endl;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user