Skip to content

Commit

Permalink
Modified retail trader to use initial capital (vs current capital) to…
Browse files Browse the repository at this point in the history
… calculate quantity
  • Loading branch information
stevenewald committed Oct 14, 2024
1 parent b4c8233 commit 9539713
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exchange/src/exchange/bots/bot_types/retail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RetailBot::take_action(const shared_bot_state& state)
{
static std::uniform_real_distribution<> dis{0.0, 1};

auto p_trade = common::decimal_price{1.0} - get_portfolio().get_capital_utilization();
auto p_trade =
common::decimal_price{1.0} - get_portfolio().get_capital_utilization();

double noise_factor = dis(gen_);

Expand All @@ -26,7 +27,7 @@ RetailBot::take_action(const shared_bot_state& state)
common::decimal_price noised_theo = state.THEO + generate_gaussian_noise(0, .1);
common::decimal_quantity quantity{
(common::decimal_price{1.0} - get_portfolio().get_capital_utilization())
* get_portfolio().get_capital() / noised_theo
* get_portfolio().get_initial_capital() / noised_theo
};
quantity *= RETAIL_ORDER_SIZE;

Expand Down

0 comments on commit 9539713

Please sign in to comment.