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: Refactor code structure and imports #30

Merged
merged 5 commits into from
Jul 14, 2023

Conversation

matiasvillaverde
Copy link
Owner

  • Combine multiple functions in core/src/lib.rs into single modules for better organization and readability
  • Modify core/src/validators/funding.rs to update validation for trade capital and rules
  • Reorder and remove unnecessary imports in various files to improve code cleanliness and consistency

- Combine multiple functions in `core/src/lib.rs` into single modules for better organization and readability
- Modify `core/src/validators/funding.rs` to update validation for trade capital and rules
- Reorder and remove unnecessary imports in various files to improve code cleanliness and consistency
- Renamed the `can_cancel` function to `can_cancel_funded`
- Added a new function `can_cancel_submitted` with tests
- Modified test `test_validate_cancel_not_funded` to use `can_cancel_funded`
- Added new methods to `TrustFacade` struct: `create_account`, `search_account`, `search_all_accounts`, `search_all_rules`, `create_transaction`, `search_overview`, `search_all_overviews`, `create_rule`, `deactivate_rule`, `search_rules`, `create_trading_vehicle`, `search_trading_vehicles`, `calculate_maximum_quantity`, `create_trade`, `search_trades`, `fund_trade`, `submit_trade`, `sync_trade`, `fill_trade`, `stop_trade`, `close_trade`, `cancel_funded_trade`, `cancel_submitted_trade`, `target_acquired`
- Added new functions to the `MockBroker` implementation for canceling trades, submitting trades, syncing trades, and closing trades.
- Added various methods to the `TrustFacade` struct for creating and searching accounts, rules, transactions, overviews, trading vehicles, and trades.
- Implemented a `cancel_trade` method in the `Broker` trait and added it to the `AlpacaBroker` and `MockBroker` implementations.
- Created a new file `cancel_trade.rs` in the `alpaca-broker` module to handle trade cancellation logic.
- Introduced error handling in the `cancel_entry` function of the `cancel_trade` module.
- Added test cases for the `cancel_trade` function in the `integration_test_cancel_trade.rs` and `integration_test_account.rs` files.
- Restructured the `cancel_trade` implementation in the `AlpacaBroker` by moving it to a separate file.
…trades, and trading vehicles

- Add new methods to the `TrustFacade` struct for creating and searching accounts, rules, trading vehicles, and trades.
- Implement methods for handling trade events, such as funding, submission, syncing, filling, stopping, and closing trades.
- Add a method to calculate the maximum quantity for a trade.
- Implement methods for canceling funded and submitted trades.
- Add a method for handling target acquired trade events.
- Added debug print statements for easier troubleshooting
- Improved logging in `cancel_trade` function
- Made changes to improve code readability and maintainability
@matiasvillaverde matiasvillaverde merged commit e6d7620 into main Jul 14, 2023
@matiasvillaverde matiasvillaverde deleted the feature/close-submitted-trade branch July 14, 2023 14:16
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