-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Smart Trading Log & Crash Fix #18
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
Draft
google-labs-jules
wants to merge
8
commits into
main
Choose a base branch
from
palette-cli-ux-15393839409157771076
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e965b12
🎨 Palette: Smart Trading Log & Crash Fix
google-labs-jules[bot] 52d8f88
Merge branch 'main' into palette-cli-ux-15393839409157771076
EiJackGH b2c2466
Merge branch 'main' into palette-cli-ux-15393839409157771076
EiJackGH a97aad8
🎨 Palette: Smart Trading Log & Crash Fix
google-labs-jules[bot] 8cbd7cb
Merge branch 'main' into palette-cli-ux-15393839409157771076
EiJackGH 602bf04
Fix undefined name 'main' and flake8 issues
google-labs-jules[bot] 770ec0c
Fix syntax error in f-strings
google-labs-jules[bot] 57aeb0c
Rename test.py to test_simulation.py for pytest discovery
google-labs-jules[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| ## 2024-05-22 - Visual Hierarchy in CLI Output | ||
| **Learning:** Adding color-coded indicators (Green/Red) and emojis (💰, 📉) in CLI tools significantly reduces cognitive load when parsing financial data streams. It transforms a wall of text into a scannable narrative. | ||
| **Action:** For data-heavy CLI applications, always implement a semantic color system and visual anchors (icons/emojis) for key events. | ||
|
|
||
| ## 2024-05-23 - CLI Accessibility and Control | ||
| **Learning:** While color and emojis enhance UX, they can be inaccessible (color blindness) or intrusive (automation logs). Providing `--no-color` and `--quiet` flags is essential for a robust CLI tool that respects user context and accessibility needs. | ||
| **Action:** Always include flags to disable visual enhancements and suppress verbose output in CLI tools. | ||
| ## 2024-05-22 - Signal vs Noise in CLI Logs | ||
| **Learning:** Users running simulations care about *events*, not *progress*. A daily log of "nothing happened" drowns out critical Buy/Sell signals. | ||
| **Action:** For event-driven CLIs, suppress "heartbeat" logs. Highlight state changes with colors/icons to improve scanability. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,3 @@ | |
|
|
||
| # debug information files | ||
| *.dwo | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.pyc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,56 +1,2 @@ | ||
| # Bitcoin Trading Simulation | ||
|
|
||
| A Python-based CLI tool that simulates Bitcoin trading using a 'Golden Cross' moving average strategy. It generates synthetic price data using Geometric Brownian Motion, executes trades based on technical indicators, and provides a daily ledger with a final performance summary. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Price Simulation:** Uses Geometric Brownian Motion to simulate Bitcoin prices. | ||
| - **Trading Strategy:** Implements a Golden Cross strategy (Short MA > Long MA = Buy, Short MA < Long MA = Sell). | ||
| - **Rich CLI Output:** Features color-coded logs (Green for Buy/Profit, Red for Sell/Loss) and emojis for better readability. | ||
| - **Performance metrics:** Compares the strategy's performance against a "Buy and Hold" approach. | ||
| - **Customizable:** Configure simulation parameters via command-line arguments. | ||
|
|
||
| ## Installation | ||
|
|
||
| 1. Clone the repository. | ||
| 2. Install the required dependencies: | ||
|
|
||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| Run the simulation script with default settings (60 days, $10k initial cash): | ||
|
|
||
| ```bash | ||
| python bitcoin_trading_simulation.py | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| Customize the simulation with the following arguments: | ||
|
|
||
| ```bash | ||
| python bitcoin_trading_simulation.py --days 100 --initial-cash 5000 --initial-price 60000 --volatility 0.03 | ||
| ``` | ||
|
|
||
| - `--days`: Number of days to simulate (default: 60) | ||
| - `--initial-cash`: Initial cash amount (default: 10000) | ||
| - `--initial-price`: Initial Bitcoin price (default: 50000) | ||
| - `--volatility`: Price volatility (default: 0.02) | ||
| - `--quiet`: Suppress daily portfolio log (only show final result) | ||
| - `--no-color`: Disable colored output (for accessibility or logging) | ||
|
|
||
| Example: | ||
| ```bash | ||
| python bitcoin_trading_simulation.py --days 30 --quiet --no-color | ||
| ``` | ||
|
|
||
| ## Tests | ||
|
|
||
| Run the test suite using `pytest`: | ||
|
|
||
| ```bash | ||
| pytest | ||
| ``` | ||
| # code | ||
| Programming with C++ code |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.