Skip to content

Commit

Permalink
Removed unnecessary poisson distribution call
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald committed Oct 6, 2024
1 parent 0fd7af6 commit 17772f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion exchange/src/exchange/bots/bot_types/market_maker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MarketMakerBot : public BotTrader {
BotTrader(ticker, interest_limit)
{}

void take_action(const shared_bot_state& state) override;
void take_action(const shared_bot_state& state) final;

const std::string&
get_type() const final
Expand Down
2 changes: 0 additions & 2 deletions exchange/src/exchange/bots/bot_types/retail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ RetailBot::take_action(const shared_bot_state& state)

if (noise_factor >= p_trade * signal_strength)
return;
if (poisson_dist_(gen_) <= 0)
return;

common::decimal_price noised_theo = state.THEO + generate_gaussian_noise(0, .1);
common::decimal_quantity quantity{
Expand Down
5 changes: 2 additions & 3 deletions exchange/src/exchange/bots/bot_types/retail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ namespace nutc::exchange {

class RetailBot : public BotTrader {
std::mt19937 gen_{}; // NOLINT
std::poisson_distribution<> poisson_dist_{};

common::decimal_price
generate_aggresiveness_()
{
static std::normal_distribution<> dist{1000, 2000};
static std::normal_distribution<> dist{700, 1400};
return dist(gen_);
}

Expand All @@ -24,7 +23,7 @@ class RetailBot : public BotTrader {
BotTrader(ticker, interest_limit), AGGRESSIVENESS(generate_aggresiveness_())
{}

void take_action(const shared_bot_state& state) override;
void take_action(const shared_bot_state& state) final;

const std::string&
get_type() const final
Expand Down

0 comments on commit 17772f8

Please sign in to comment.