#pragma once #include "MerkelMain.h" // required to interact with the order book, place bids, withdraw bids, place asks #include "OrderBookEntry.h" // required to build vectors of this type #include #include #include #include #include class TradingBot { public: TradingBot(MerkelMain *merkel); /** start the Trading Bot interface */ void startBot(); private: // ===== Functions ===== // Interface functions void printMenu(); int getUserOption(); void processUserOption(int userOption); void printPredictions(); // ==== Exchange functions ==== void retrieveOrders(); void predictRates(); void makeAutoBids(); void makeAutoAsks(); void processBidsAsks(); // ==== Helper functions ==== static std::vector regressionFromHistory(std::vector> history, std::string product); static double getMean(std::vector orders, std::string product); static void logAssets(std::string wallet, std::string timestamp, std::string mode); static void logBidsAsks(OrderBookEntry order, std::string mode); static void logUserSales(std::vector sales, std::string mode); // ===== Variables ===== MerkelMain *merkel; std::vector products; std::vector bookBids; std::vector bookAsks; std::vector lastSales; std::vector> bidHistory; std::vector> askHistory; std::vector salesHistory; std::map predictedBids; std::map predictedAsks; std::map currentBids; std::map currentAsks; };