Export Stocks data to Excel

  1. Open demo account at hotforex.com
  2. Download hotforex’s Meta Trader 5 and install.
  3. Login to Meta Trader
  4. Add the required symbol
  5. How to export data from Metatrader 5
  6. Export to HTML
  7. Copy and paste HTML content to Excel.

Getting balance from Binance

  1. Binance
    1. Create account
    2. Get API keys.
  2. Install mini conda
  3. Create environment
  4. Install there
    1. aiohttp
    2. ccxt – crypto
      1. Suppose to have visual c++ build tools
      2. cl.exe-find it and add it to path.
    3. pandas
    4. numpy
    5. requests
  5. Run the following code:

    • import ccxt

      # Initialize the exchange

      exchange = ccxt.binance({
      ‘apiKey’: ‘5kRM6Qm80hlWGxAEwmBwdSrB0XkPLkd79PWdXyWRRf1DhbebSK1jsMGBVdaB7oVs’,
      ‘secret’: ‘hVpFqyka2ZAjcERaRheWjIs18hbOQI6tFTxTw8hLY1OSRUpL2yzSRawov5SCfAA0’,
      ‘enableRateLimit’: True,
      })

      # Fetch the balance

      balance = exchange.fetch_balance()

      # Extract and display non-zero balances

      non_zero_balances = {symbol: amount for symbol, amount in balance[‘total’].items() if amount > 0}

      # Display non-zero balances in a table format
      print(“Spot Account – Non-Zero Balances:”)

      print(“{:<10} {:<20}”.format(“Asset”, “Balance”))
      for symbol, amount in non_zero_balances.items():
      print(“{:<10} {:<20}”.format(symbol, amount))

Comments are closed.