Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int buyPrice = 0;
- int maxFound = 90;
- private OrderAction makeDecision(GameState body, String username) {
- UserInfo userInfo = body.findUser(username);
- if(userInfo.getShares() == 0) {
- if(body.getStockValue() <= maxFound / 2) {
- buyPrice = body.getStockValue();
- return new OrderAction(OrderType.BUY, 1000000);
- }
- } else if(body.getStockValue() > maxFound) {
- return new OrderAction(OrderType.SELL, 1000000);
- }
- maxFound = Math.max(maxFound, body.getStockValue());
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement