Update linearRegression to header file

This commit is contained in:
Lev
2021-06-13 17:56:00 -05:00
parent fdfd01b0f3
commit a202119969
3 changed files with 8 additions and 8 deletions

View File

@ -7,13 +7,12 @@ OrderBookEntry::OrderBookEntry(
std::string _product, std::string _product,
OrderBookType _orderType, OrderBookType _orderType,
std::string _username) std::string _username)
: : price(_price),
price(_price), amount(_amount),
amount(_amount), timestamp(_timestamp),
timestamp(_timestamp), product(_product),
product(_product), orderType(_orderType),
orderType(_orderType), username(_username)
username(_username)
{ {
} }

View File

@ -8,6 +8,8 @@ class Bot
{ {
public: public:
Bot(std::string filename); Bot(std::string filename);
/** 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);
void Print(int intLimit); void Print(int intLimit);
private: private:

View File

@ -22,7 +22,6 @@ public:
* assumes the order was made by the owner of the wallet * assumes the order was made by the owner of the wallet
*/ */
void processSale(OrderBookEntry &sale); void processSale(OrderBookEntry &sale);
/** generate a string representation of the wallet */ /** generate a string representation of the wallet */
std::string toString(); std::string toString();
friend std::ostream &operator<<(std::ostream &os, Wallet &wallet); friend std::ostream &operator<<(std::ostream &os, Wallet &wallet);