Skip to content

Latest commit

 

History

History
467 lines (368 loc) · 12.9 KB

File metadata and controls

467 lines (368 loc) · 12.9 KB

Crypto Tracker - Examples

⚙️ Interactive Mode (Recommended)

Starting the Interactive Shell

Simply run the application without arguments:

python crypto.py

You'll enter an interactive shell with auto-completion, command history, and a beautiful interface:

crypto-tracker> _

Interactive Mode Workflow

# Start the application
python crypto.py

# Inside the shell:
crypto-tracker> help                           # See all available commands
crypto-tracker> watch BTC                      # Start live tracking (press Ctrl+C to stop)
crypto-tracker> snapshot BTC,ETH,BNB           # Quick price check
crypto-tracker> alarm add "BTC<100000"         # Add a price alert
crypto-tracker> alarm list                     # View all alarms
crypto-tracker> alarm remove 1                 # Remove an alarm
crypto-tracker> health                         # Check API connectivity
crypto-tracker> clear                          # Clear the screen
crypto-tracker> history                        # View command history
crypto-tracker> exit                           # Quit the application

Interactive Mode Features

  • TAB Completion: Press TAB to auto-complete commands, symbols (BTC, ETH, etc.), and flags
  • Command History: Use ↑/↓ arrow keys to navigate through previous commands
  • Syntax Highlighting: Commands are color-coded for better readability
  • Ctrl+C Handling: During watch mode, Ctrl+C returns you to the prompt (doesn't exit)
  • Session Info: See active alarms and last prices on startup
  • Help System: Type help anytime to see all available commands

Example Interactive Session

crypto-tracker> alarm add "BTC>100000 USD"
✓ Alarm added successfully!
ID: 1 | Rule: BTC > 100000.0 USD | Type: Persistent

crypto-tracker> alarm add "ETH<2000 EUR" --once
✓ Alarm added successfully!
ID: 2 | Rule: ETH < 2000.0 EUR | Type: One-time

crypto-tracker> alarm add "BTC>3000000 TRY" --name "BTC Alert With TRY"
✓ Alarm added successfully!
ID: 3 (BTC Turkish Alert) | Rule: BTC > 3000000.0 TRY | Type: Persistent

crypto-tracker> alarm list
┌────┬────────────────────┬──────────────────────┬────────┬───────────┐
│ ID │ Name               │ Rule                 │ Status │ Type      │
├────┼────────────────────┼──────────────────────┼────────┼───────────┤
│ 1  │ -                  │ BTC>100000 USD       │ Active │ Persistent│
│ 2  │ -                  │ ETH<2000 EUR         │ Active │ One-time  │
│ 3  │ BTC Alert With TRY │ BTC>3000000 TRY      │ Active │ Persistent│
└────┴────────────────────┴──────────────────────┴────────┴───────────┘

crypto-tracker> searchcoin pepe
🔍 Searching for: pepe

Found 5 results:
1. PEPE (pepe)
2. PepeCoin (pepecoin)
3. Pepe 2.0 (pepe20)
4. Pepe Unchained (pepe-unchained)
5. Sad Hamster (sadhamster)

crypto-tracker> addcoin PEPE pepe
[ADD] Adding PEPE → pepe...
[SUCCESS] Successfully added PEPE coin (pepe)

crypto-tracker> listcoins
                 Supported Cryptocurrencies (49 total)
┌────────────┬──────────────────────┬──────────┐
│ Symbol     │ CoinGecko ID         │ Type     │
├────────────┼──────────────────────┼──────────┤
│ BTC        │ bitcoin              │ Default  │
│ ETH        │ ethereum             │ Default  │
│ ...        │ ...                  │ ...      │
│ PEPE       │ pepe                 │ Custom   │
└────────────┴──────────────────────┴──────────┘

crypto-tracker> watch PEPE -c USD
🚀 Starting live tracking...
Symbols: PEPE | Currency: USD | Interval: 5s
Press Ctrl+C to stop and return to prompt

[Live price table shows PEPE at $0.000006...]

^C
Stopped tracking. Returning to prompt...

crypto-tracker> removecoin PEPE
[SUCCESS] Removed PEPE (CoinGecko ID: pepe)

crypto-tracker> exit
👋 Thanks for using Crypto Tracker!

📋 Direct Command Mode Examples

You can also run commands directly from the terminal without entering interactive mode:

Basic Examples

1. Watch Single Cryptocurrency

python crypto.py watch BTC

2. Watch Multiple Cryptocurrencies

python crypto.py watch BTC,ETH,BNB

3. Multi-Currency Display

python crypto.py watch BTC,ETH -c TRY -i 10

Alarm Examples (with Multi-Currency Support!)

4. Simple Price Alert (Default USD)

# Alert when Bitcoin drops below $30,000
python crypto.py alarm add "BTC<30000"

5. Multi-Currency Alarms

# Alert in US Dollars
python crypto.py alarm add "BTC>100000 USD"

# Alert in Euros
python crypto.py alarm add "ETH<2000 EUR"

# Alert in Turkish Lira
python crypto.py alarm add "BTC>3000000 TRY"

# Alert in British Pounds
python crypto.py alarm add "BNB>500 GBP"

6. Named Alarms for Easy Identification

# Give your alarms descriptive names
python crypto.py alarm add "BTC<30000" --name "BTC Dip Alert"
python crypto.py alarm add "ETH>5000 USD" --name "ETH Moon" --once
python crypto.py alarm add "BTC>3000000 TRY" --name "BTC TRY Target"

7. Multiple Alarms with Different Currencies

# Mix and match currencies for comprehensive monitoring
python crypto.py alarm add "BTC<30000 USD"
python crypto.py alarm add "BTC>50000 EUR"
python crypto.py alarm add "ETH<2000 GBP"
python crypto.py alarm add "ETH>3000 TRY"

8. Watch with Inline Alarms

# Add alarms while starting watch
python crypto.py watch BTC,ETH -a "BTC<30000" -a "ETH>2500"

9. One-Time Alarms

# Alarm triggers once and auto-deactivates
python crypto.py watch BTC -a "BTC<30000" --once

10. Persistent Alarm Storage

# Save alarms to custom database
python crypto.py watch BTC,ETH -a "BTC<30000" --db my_alarms.db

Custom Cryptocurrency Examples

11. Search for Coins on CoinGecko

# Search for PEPE coin
python crypto.py searchcoin pepe

# Search for Shiba Inu
python crypto.py searchcoin shiba

# Search for any coin
python crypto.py searchcoin "your search term"

12. Add Custom Cryptocurrencies

# Add PEPE coin
python crypto.py addcoin PEPE pepe

# Add SHIB
python crypto.py addcoin SHIB shiba-inu

# Add DOGE
python crypto.py addcoin DOGE dogecoin

13. List All Coins (Default + Custom)

# See all supported coins with their types
python crypto.py listcoins

14. Track Custom Coins

# After adding PEPE, you can track it
python crypto.py watch PEPE -c USD
python crypto.py snapshot PEPE
python crypto.py alarm add "PEPE>0.00001 USD"

15. Remove Custom Coins

# Remove a custom coin when no longer needed
python crypto.py removecoin PEPE

Advanced Examples

16. Portfolio Tracking with Custom Currency

# Track multiple assets in Turkish Lira
python crypto.py watch BTC,ETH,BNB,ADA,SOL -c TRY -i 15

# Track in Euros
python crypto.py watch BTC,ETH,BNB -c EUR -i 10

17. Quick Multi-Currency Price Check

# Get snapshot in different currencies
python crypto.py snapshot BTC,ETH -c USD
python crypto.py snapshot BTC,ETH -c EUR
python crypto.py snapshot BTC,ETH -c TRY

18. Complete Alarm Management Workflow

# Add diverse alarms
python crypto.py alarm add "BTC>100000 USD"
python crypto.py alarm add "ETH<2000 EUR" --once
python crypto.py alarm add "BTC>3000000 TRY" --name "TRY Target"

# List all alarms
python crypto.py alarm list

# List including inactive alarms
python crypto.py alarm list --all

# Remove specific alarm (e.g., ID 1)
python crypto.py alarm remove 1

# Reactivate deactivated alarm
python crypto.py alarm activate 2

# Clear all alarms
python crypto.py alarm clear --yes

19. Trading Range Monitoring (Multi-Currency)

# Monitor BTC in a specific USD range
python crypto.py alarm add "BTC<29000 USD" --once --name "Buy Zone"
python crypto.py alarm add "BTC>31000 USD" --once --name "Sell Zone"

# Monitor ETH in EUR range
python crypto.py alarm add "ETH<1800 EUR" --name "ETH Support"
python crypto.py alarm add "ETH>2200 EUR" --name "ETH Resistance"

# Start tracking
python crypto.py watch BTC,ETH -i 5

20. DCA (Dollar Cost Average) Helper with Multiple Currencies

# Monitor buy prices for DCA strategy in USD
python crypto.py alarm add "BTC<28000 USD" --name "DCA Level 1"
python crypto.py alarm add "BTC<27000 USD" --name "DCA Level 2"
python crypto.py alarm add "BTC<26000 USD" --name "DCA Level 3"

# Alternative: DCA in EUR
python crypto.py alarm add "BTC<25000 EUR" --name "EUR DCA 1"
python crypto.py alarm add "BTC<24000 EUR" --name "EUR DCA 2"

python crypto.py alarm list

21. High Frequency Monitoring

# Fast updates (every 1 second) - be mindful of rate limits!
python crypto.py watch BTC,ETH -i 1

# More conservative (5 seconds)
python crypto.py watch BTC,ETH,BNB,ADA,SOL -i 5

22. Verbose Debug Mode

# Enable detailed logging for troubleshooting
python crypto.py watch BTC -v

23. Meme Coin Tracking

# Add popular meme coins
python crypto.py addcoin PEPE pepe
python crypto.py addcoin SHIB shiba-inu
python crypto.py addcoin DOGE dogecoin

# Track them all
python crypto.py watch PEPE,SHIB,DOGE -c USD -i 10

# Set micro-price alarms
python crypto.py alarm add "PEPE>0.00001 USD"
python crypto.py alarm add "SHIB>0.00005 USD"

24. Complete Custom Coin Workflow

# Search for new coin
python crypto.py searchcoin "linea"

# Add it
python crypto.py addcoin LINEA linea

# Track it immediately
python crypto.py watch LINEA -c USD

# Set alert
python crypto.py alarm add "LINEA>5 USD" --name "Linea Target"

# List all coins to verify
python crypto.py listcoins

25. Health Check and Diagnostics

# Check API connectivity before trading session
python crypto.py health

# Expected output:
# ✓ CoinGecko API: OK
# ✓ Exchange Rate API: OK
# ✓ Database: OK

17. Health Check Before Trading

# Verify API connectivity
python crypto.py health

18. Reactivate Old Alarms

# List all alarms including inactive
python crypto.py alarm list --all

# Reactivate alarm by ID
python crypto.py alarm activate 3

Real-World Scenarios

19. Day Trader Setup

# Monitor major pairs with tight alarms
python crypto.py alarm add "BTC<42000"
python crypto.py alarm add "BTC>43000"
python crypto.py alarm add "ETH<2900"
python crypto.py alarm add "ETH>3100"
python crypto.py watch BTC,ETH -i 3 --db daytrading.db

20. Long-Term Holder

# Set buy opportunity alerts
python crypto.py alarm add "BTC<25000"
python crypto.py alarm add "ETH<1800"
python crypto.py alarm add "BNB<250"
python crypto.py watch BTC,ETH,BNB -i 60 --db longterm.db

21. Altcoin Portfolio

# Track smaller cap coins
python crypto.py watch SOL,AVAX,MATIC,DOT,ATOM -i 15

22. International Investor

# Monitor in local currency
python crypto.py watch BTC,ETH -c TRY -i 10

23. Stop-Loss Monitoring

# Set stop-loss alerts with one-time trigger
python crypto.py alarm add "BTC<41000" --once
python crypto.py alarm add "ETH<2800" --once
python crypto.py watch BTC,ETH --db stoploss.db

24. Take-Profit Alerts

# Set multiple take-profit levels
python crypto.py alarm add "BTC>45000"  # TP1
python crypto.py alarm add "BTC>47000"  # TP2
python crypto.py alarm add "BTC>50000"  # TP3
python crypto.py watch BTC -i 5

25. Market Overview Dashboard

# Monitor top 10 cryptos
python crypto.py watch BTC,ETH,BNB,XRP,ADA,DOGE,SOL,DOT,MATIC,LTC -i 20

Tips & Tricks

  • Use -i 1 for second-by-second updates (watch rate limits)
  • Use -i 60 or higher for background monitoring
  • Combine --once with critical price levels
  • Use multiple databases (--db) for different strategies
  • Press Ctrl+C to stop watching gracefully
  • Use snapshot for quick checks without staying in terminal
  • Check python crypto.py health if experiencing issues

Environment-Specific

Windows PowerShell

# All examples above work directly in PowerShell
python crypto.py watch BTC

Command Prompt

python crypto.py watch BTC

Windows Terminal

# Better colors and display in Windows Terminal
python crypto.py watch BTC,ETH -i 5