Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update targets #33

Merged
merged 4 commits into from
Aug 7, 2023
Merged

feat: update targets #33

merged 4 commits into from
Aug 7, 2023

Conversation

matiasvillaverde
Copy link
Owner

  • feat: Refactor trade modification functionality
  • feat: Implement modify_target function in brokers and workers
  • feat: Refactor trade modification and validation logic
  • feat: Implement new integration test and modify modify_target function

- Added a new `modify-target` command to modify the target order of a filled trade
- Renamed and refactored various files and methods for consistency and clarity
- Implemented the `modify_target` method in the `TradeCommandBuilder` and `TrustFacade`
- Updated the `ModifyDialogBuilder` method in the `dispatcher.rs` file to include the option to modify the target price of a trade
- Added a new function `can_modify_target` for validating modifications to the trade target in `trade.rs`
- Implemented validation for `can_modify_target` based on the trade's status
- Modified the `modify_target` function in the `MockBroker` implementation and added a new parameter `new_target_price`
- Created assertions to check if the `account_id`, `trade.target.unit_price`, and `new_target_price` are equal in the `modify_target` function
- Added a `modify_target` function to the `AlpacaBroker` struct in `lib.rs`
- Modified the `modify_stop` function to take a `new_stop_price` parameter in `lib.rs`
- Added a new method `modify_target` to the `Broker` trait interface in `broker.rs`
- Added a new method `modify_target` to the `MockBroker` struct in `integration_test_account.rs`
- Added a `modify_target` function to the `Broker` trait implementation in `integration_test_cancel_trade.rs`
- Modified the `modify_stop` function to the more general `modify` function in `order_worker.rs`
- Updated the parameter names in the `modify` function to be more descriptive and fixed the return type in `order_worker.rs`
- Added a new method `modify_target` to the `TradeAction` struct and modified the `modify_stop` method to call the `OrderWorker` method `modify` in `trade_action.rs`
- Added import statements for `BrokerLog`, `can_modify_target` and `can_modify_stop` in `trade_action.rs`
- Added a `modify_target` function to the `TrustFacade` struct in `lib.rs`
- Added new modules for modifying stop price and target price in a trade
- Replaced old modules with new ones for modifying stop price and target price
- Removed code related to modifying target prices
- Modified the TradeAction struct and its methods for handling trade status updates, fee payments, fund transfers, and order creation
- Renamed and modified functions and parameters in the modify_trade.rs file
- Updated the function signatures and removed unused code in the trade.rs file's validators and tests
- Added a new integration test for modifying the target price of a trade
- Modified the `modify_target` function in the `MockBroker` implementation
- Changed the initial target price of the trade in the `modify_target` function test
@matiasvillaverde matiasvillaverde merged commit 1cbd700 into main Aug 7, 2023
@matiasvillaverde matiasvillaverde deleted the feature/update-target branch August 7, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant